OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..3000
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
FORMULA
From R. J. Mathar, Jul 27 2015: (Start)
a(n) = a(n-22).
G.f.: -x*(1 +4*x +9*x^2 +16*x^3 +3*x^4 +14*x^5 +5*x^6 +20*x^7 +15*x^8 +12*x^9 +11*x^10 +12*x^11 +15*x^12 +20*x^13 +5*x^14 +14*x^15 +3*x^16 +16*x^17 +9*x^18 +4*x^19+x^20) ) / ( (x-1) *(1+x^10+x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x) *(1+x) *(1-x+x^2-x^3+x^4-x^5+x^6-x^7+x^8-x^9+x^10) ). (End)
MATHEMATICA
Table[Mod[n^2, 22], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Apr 23 2011 *)
PowerMod[Range[0, 120], 2, 22] (* or *) PadRight[{}, 120, {0, 1, 4, 9, 16, 3, 14, 5, 20, 15, 12, 11, 12, 15, 20, 5, 14, 3, 16, 9, 4, 1}] (* Harvey P. Dale, May 28 2021 *)
PROG
(Maxima) makelist(power_mod (n, 2, 22), n, 0, 81); \\ Bruno Berselli, May 25 2011
(Magma) [n^2 mod (22): n in [0..80]]; // Vincenzo Librandi, May 26 2011
(PARI) a(n)=n^2%22 \\ Charles R Greathouse IV, Apr 06 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved