login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A070433
a(n) = n^2 mod 9.
5
0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1
OFFSET
0,3
COMMENTS
Also decimal expansion of 4692347/333333333. - Enrique Pérez Herrero, Nov 27 2022
FORMULA
From R. J. Mathar, Apr 20 2010: (Start)
a(n) = a(n-9).
G.f.: ( -x*(1+x)*(x^6+3*x^5-3*x^4+10*x^3-3*x^2+3*x+1) ) / ( (x-1)*(1+x+x^2)*(x^6+x^3+1) ). (End)
a(n) = A010878(A000290(n)) = A010878(n^2). - Enrique Pérez Herrero, Nov 27 2022
MATHEMATICA
Table[Mod[n^2, 9], {n, 0, 200}] (* Vladimir Joseph Stephan Orlovsky, Apr 21 2011 *)
PowerMod[Range[0, 200], 2, 9] (* Harvey P. Dale, Jun 11 2011 *)
PROG
(PARI) a(n)=[0, 1, 4, 0, 7, 7, 0, 4, 1][n%9+1] \\ Charles R Greathouse IV, Jun 11 2011
(PARI) a(n)=n^2%9 \\ Charles R Greathouse IV, Jun 11 2011
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, May 12 2002
STATUS
approved