cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A008853 Numbers n such that n^2 and n have same last 3 digits.

This page as a plain text file.
%I A008853 #14 May 12 2025 15:16:08
%S A008853 0,1,376,625,1000,1001,1376,1625,2000,2001,2376,2625,3000,3001,3376,
%T A008853 3625,4000,4001,4376,4625,5000,5001,5376,5625,6000,6001,6376,6625,
%U A008853 7000,7001,7376,7625,8000,8001,8376,8625,9000,9001,9376,9625,10000
%N A008853 Numbers n such that n^2 and n have same last 3 digits.
%D A008853 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.
%H A008853 G. C. Greubel, <a href="/A008853/b008853.txt">Table of n, a(n) for n = 1..1000</a>
%H A008853 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).
%F A008853 a(4n)=1000*n, a(4n+1)=1000*n+1, a(4n+2)=1000*n+376, a(4n+3)=1000*n+625. - _Franklin T. Adams-Watters_, Mar 13 2006
%F A008853 From _G. C. Greubel_, Sep 13 2019: (Start)
%F A008853 a(n) = a(n-1) + a(n-4) - a(n-5).
%F A008853 G.f.: x^2*(1 +375*x +249*x^2 +375*x^3)/((1-x)*(1-x^4)). (End)
%p A008853 for n to 10000 do if n^2 - n mod 1000 = 0 then print(n); fi; od;
%t A008853 LinearRecurrence[{1,0,0,1,-1}, {0,1,376,625,1000}, 60] (* _G. C. Greubel_, Sep 13 2019 *)
%t A008853 Select[Range[0,10000],Mod[#,1000]==Mod[#^2,1000]&] (* _Harvey P. Dale_, May 12 2025 *)
%o A008853 (PARI) my(x='x+O('x^60)); concat([0], Vec(x*(1 +375*x +249*x^2 +375*x^3)/((1-x)*(1-x^4)))) \\ _G. C. Greubel_, Sep 13 2019
%o A008853 (Magma) R<x>:=PowerSeriesRing(Integers(), 60); [0] cat Coefficients(R!( x*(1 +375*x +249*x^2 +375*x^3)/((1-x)*(1-x^4)) )); // _G. C. Greubel_, Sep 13 2019
%o A008853 (Sage) [n for n in (0..1250) if mod(n,1000)==mod(n^2,1000)] # _G. C. Greubel_, Sep 13 2019
%o A008853 (GAP) a:=[0,1,376,625,1000];; 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
%K A008853 nonn,easy,base
%O A008853 1,3
%A A008853 _N. J. A. Sloane_