A072205 a(n) = (p^2 - p + 2)/2 for p = prime(n); number of squares modulo p^2.
2, 4, 11, 22, 56, 79, 137, 172, 254, 407, 466, 667, 821, 904, 1082, 1379, 1712, 1831, 2212, 2486, 2629, 3082, 3404, 3917, 4657, 5051, 5254, 5672, 5887, 6329, 8002, 8516, 9317, 9592, 11027, 11326, 12247, 13204, 13862, 14879, 15932, 16291, 18146, 18529
Offset: 1
Keywords
Programs
-
Mathematica
seq[n_Integer?Positive] := Module[{fn01 = 1, fn10 = 1, fnout = 1}, Do[{fn10, fn01, fnout} = {fn10 + 1, fn01 + fn10, fn01 + fnout}, {n - 1}]; {fn10, fn01, fnout}]; Ar = Flatten[ Table[ seq[ Prime[n]], {n, 1, 50}]]; a = {}; Do[a = Append[a, Ar[[n]]], {n, 2, 150, 3}]; a
-
PARI
a(n)=binomial(prime(n),2)+1 \\ Charles R Greathouse IV, Jan 11 2012
-
Sage
[(p^2 - p + 2)/2 for p in prime_range(200)]
Formula
a(n) = A008837(n) + 1.
Extensions
Name edited by Bert Seghers, Jan 01 2012
Comments