login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = n^2 mod 29.
8

%I #28 Dec 18 2023 12:39:47

%S 0,1,4,9,16,25,7,20,6,23,13,5,28,24,22,22,24,28,5,13,23,6,20,7,25,16,

%T 9,4,1,0,1,4,9,16,25,7,20,6,23,13,5,28,24,22,22,24,28,5,13,23,6,20,7,

%U 25,16,9,4,1,0,1,4,9,16,25,7,20,6,23,13,5,28,24,22,22,24,28,5,13,23,6,20

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

%C Periodic with period length 29. - _Ray Chandler_, Dec 18 2023

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

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

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

%e 5^2 = 25 == 25 (mod 29), so a(5) = 25.

%e 6^2 = 36 == 7 (mod 29), so a(6) = 7.

%e 7^2 = 49 == 20 (mod 29), so a(7) = 20.

%t Table[Mod[n^2, 29], {n, 0, 115}] (* _Vladimir Joseph Stephan Orlovsky_, Apr 27 2011 *)

%t PowerMod[Range[0, 115], 2, 29] (* _Alonso del Arte_, Jun 29 2018 *)

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

%o (Scala) for (i <- 0 to 115) yield (i * i) % 29 // _Alonso del Arte_, Jun 29 2018

%o (GAP) List([0..100],n->PowerMod(n,2,29)); # _Muniru A Asiru_, Jun 29 2018

%o (Magma) [Modexp(n, 2, 29): n in [0..100]]; // _Vincenzo Librandi_, Jun 30 2018

%Y Cf. A070451.

%K nonn,easy

%O 0,3

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

%E Incorrect g.f. removed by _Georg Fischer_, May 15 2019