A039303 Number of distinct quadratic residues mod 6^n.
1, 4, 8, 33, 124, 644, 3288, 18883, 108284, 642234, 3808768, 22785833, 136315044, 817291024, 4900153448, 29395534383, 176340899404, 1057996947014, 6347691029328, 38085710240533, 228511646005364, 1371065953050204
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Programs
-
Magma
I:=[1, 4, 8, 33, 124, 644, 3288, 18883, 108284]; [n le 9 select I[n] else 50*Self(n-2)-553*Self(n-4)+1800*Self(n-6)-1296*Self(n-8): n in [1..30]]; // Vincenzo Librandi, Apr 21 2012
-
Mathematica
CoefficientList[Series[(1-2*x-30*x^2+13*x^3+199*x^4+ 12*x^5-360*x^6-108*x^7)/((1-x)*(1+x)*(1-2*x)*(1+2*x)*(1-3*x)*(1+3*x)*(1-6*x)),{x,0,30}],x] (* Vincenzo Librandi, Apr 21 2012 *)
Formula
a(n+8) = 50 a(n+6) - 553 a(n+4) + 1800 a(n+2) - 1296 a(n) for n >= 1.
G.f.: (1 - 2*x - 30*x^2 + 13*x^3 + 199*x^4 + 12*x^5 - 360*x^6 - 108*x^7)/((1-x)*(1+x)*(1-2*x)*(1+2*x)*(1-3*x)*(1+3*x)*(1-6*x)). - Colin Barker, Mar 14 2012
Comments