%I #24 Dec 27 2023 14:59:23
%S 0,1,4,9,16,25,6,19,4,21,10,1,24,19,16,15,16,19,24,1,10,21,4,19,6,25,
%T 16,9,4,1,0,1,4,9,16,25,6,19,4,21,10,1,24,19,16,15,16,19,24,1,10,21,4,
%U 19,6,25,16,9,4,1,0,1,4,9,16,25,6,19,4,21,10,1,24,19,16,15,16,19,24,1
%N a(n) = n^2 mod 30.
%C Equivalently, n^6 mod 30. - _Ray Chandler_, Dec 27 2023
%H G. C. Greubel, <a href="/A070452/b070452.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_28">Index entries for linear recurrences with constant coefficients</a>, signature (-1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1).
%F From _Reinhard Zumkeller_, Apr 24 2009: (Start)
%F a(m*n) = a(m)*a(n) mod 30.
%F a(15*n+k) = a(15*n-k) for k<=15*n.
%F a(n+30) = a(n). (End)
%F a(n)= -a(n-1) +a(n-3) +a(n-4) -a(n-6) -a(n-7) +a(n-9) +a(n-10) -a(n-12) -a(n-13) +a(n-15) +a(n-16) -a(n-18) -a(n-19) +a(n-21) +a(n-22) -a(n-24) -a(n-25) +a(n-27) +a(n-28). - _R. J. Mathar_, Jul 23 2009
%t Table[Mod[n^2,30],{n,0,200}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 27 2011 *)
%t LinearRecurrence[{-1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, 1},{0, 1, 4, 9, 16, 25, 6, 19, 4, 21, 10, 1, 24, 19, 16, 15, 16, 19, 24, 1, 10, 21, 4, 19, 6, 25, 16, 9},80] (* _Ray Chandler_, Aug 26 2015 *)
%t PowerMod[Range[0,80],6,30] (* or *) PadRight[{},80,{0,1,4,9,16,25,6,19,4,21,10,1,24,19,16,15,16,19,24,1,10,21,4,19,6,25,16,9,4,1}] (* _Harvey P. Dale_, Jul 10 2023 *)
%o (Sage) [power_mod(n,2,30)for n in range(0, 75)] # _Zerinvary Lajos_, Nov 03 2009
%o (PARI) a(n)=n^2%30 \\ _Charles R Greathouse IV_, Oct 07 2015
%Y A010462, A070431, A008959, A070435, A070438, A070442, A159852, A000290. - _Reinhard Zumkeller_, Apr 24 2009
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_, May 12 2002