OFFSET
1,3
REFERENCES
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 459.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
FORMULA
a(4n)=100*n, a(4n+1)=100*n+1, a(4n+2)=100*n+25, a(4n+3)=100*n+76. - Franklin T. Adams-Watters, Mar 13 2006
From G. C. Greubel, Sep 13 2019: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: x*(1 +24*x +51*x^2 +24*x^3)/((1-x)*(1-x^4)). (End)
MAPLE
for n to 2000 do if n^2 - n mod 100 = 0 then print(n); fi; od;
MATHEMATICA
Select[Range[1200], Mod[ #, 100] == Mod[ #^2, 100] &] (* Stefan Steinerberger, Apr 15 2006 *)
LinearRecurrence[{1, 0, 0, 1, -1}, {0, 1, 25, 76, 100}, 60] (* G. C. Greubel, Sep 13 2019 *)
PROG
(PARI) my(x='x+O('x^60)); concat([0], Vec(x*(1 +24*x +51*x^2 +24*x^3)/((1-x)*(1-x^4)))) \\ G. C. Greubel, Sep 13 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 60); [0] cat Coefficients(R!( x*(1 +24*x +51*x^2 +24*x^3)/((1-x)*(1-x^4)) )); // G. C. Greubel, Sep 13 2019
(Sage) [n for n in (0..1250) if mod(n, 100)==mod(n^2, 100)] # G. C. Greubel, Sep 13 2019
(GAP) a:=[0, 1, 25, 76, 100];; for n in [6..60] do a[n]:=a[n-1]+a[n-4]-a[n-5]; od; a; # G. C. Greubel, Sep 13 2019
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
STATUS
approved