login
a(n) = n^2 mod 16.
2

%I #37 Dec 27 2023 08:37:49

%S 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,

%T 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,

%U 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

%N a(n) = n^2 mod 16.

%H G. C. Greubel, <a href="/A070439/b070439.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).

%F 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

%F a(n) = a(n-8). - _G. C. Greubel_, Mar 24 2016

%F a(n) = A130909(n^2). - _Michel Marcus_, Mar 24 2016

%t Table[Mod[n^2,16],{n,0,200}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 23 2011 *)

%t 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 *)

%t PowerMod[Range[0,100],2,16] (* _Harvey P. Dale_, Jul 23 2023 *)

%o (Magma) [Modexp(n, 2, 16 ): n in [0..100]]; // _Vincenzo Librandi_, Mar 28 2016

%o (PARI) a(n)=n^2%16 \\ _Charles R Greathouse IV_, Apr 06 2016

%Y Cf. A054580, A130909.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_, May 12 2002