login
Number of distinct prime factors of n^2+1.
9

%I #20 Dec 06 2020 10:53:28

%S 1,1,2,1,2,1,2,2,2,1,2,2,3,1,2,1,3,2,2,1,3,2,3,1,2,1,3,2,2,2,3,2,3,2,

%T 2,1,3,2,2,1,2,2,3,2,2,2,4,2,2,2,2,2,3,1,3,1,3,2,2,2,2,2,3,2,2,1,3,2,

%U 2,2,2,3,4,1,3,2,3,2,2,2,3,2,4,1,2,2,3,2,3,1,3,2,3,1,2,2,3,3,3,2,2,2

%N Number of distinct prime factors of n^2+1.

%C a(n) is also the number of distinct prime factors, up to multiplication by units, of n + i in the ring of Gaussian integers. - _Jason Kimberley_, Dec 17 2011

%H Charles R Greathouse IV, <a href="/A128428/b128428.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A001221(n^2+1).

%e a(3) = 2 because 3^2+1 = 2*5.

%p a:= n-> nops(select(isprime, numtheory[divisors](n^2+1))):

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Dec 06 2020

%t a[n_]:=Length[FactorInteger[n^2 + 1]]

%o (PARI) a(n)=omega(n^2+1) \\ _Charles R Greathouse IV_, Jul 31 2011

%Y Cf. A193330 (counted with multiplicity).

%K nonn

%O 1,3

%A Kent Horvath (kenthorvath(AT)gmail.com), May 10 2007