A070439 a(n) = n^2 mod 16.
0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0, 9, 4, 1, 0, 1, 4, 9, 0
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,1).
Programs
-
Magma
[Modexp(n, 2, 16 ): n in [0..100]]; // Vincenzo Librandi, Mar 28 2016
-
Mathematica
Table[Mod[n^2,16],{n,0,200}] (* Vladimir Joseph Stephan Orlovsky, Apr 23 2011 *) CoefficientList[Series[(x + 4 x^2 + 9 x^3 + 9 x^5 + 4 x^6 + x^7) / (1 - x^8), {x, 0, 100}], x] (* Vincenzo Librandi, Mar 25 2016 *) PowerMod[Range[0,100],2,16] (* Harvey P. Dale, Jul 23 2023 *)
-
PARI
a(n)=n^2%16 \\ Charles R Greathouse IV, Apr 06 2016
Formula
G.f.: -x*(1+4*x+9*x^2+9*x^4+4*x^5+x^6) / ( (x-1)*(1+x)*(x^2+1)*(x^4+1) ). - R. J. Mathar, Jul 27 2015
a(n) = a(n-8). - G. C. Greubel, Mar 24 2016
a(n) = A130909(n^2). - Michel Marcus, Mar 24 2016