A186439 Numbers whose squares end in three identical digits.
38, 100, 200, 300, 400, 462, 500, 538, 600, 700, 800, 900, 962, 1000, 1038, 1100, 1200, 1300, 1400, 1462, 1500, 1538, 1600, 1700, 1800, 1900, 1962, 2000, 2038, 2100, 2200, 2300, 2400, 2462, 2500, 2538, 2600, 2700, 2800, 2900, 2962, 3000, 3038, 3100, 3200, 3300, 3400, 3462
Offset: 1
Examples
462 is in the sequence because 462^2 = 213444.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
Programs
-
Maple
with(numtheory):T:=array(1..10):for p from 1 to 10000 do:n:=p^2:l:=length(n):n0:=n:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :T[m]:=u:od:if T[1]=T[2] and T[1]=T[3] then printf(`%d, `,p):else fi:od: # second Maple program: a:= proc(n) local m, r; r:= 1+ irem(n-1, 7, 'm'); [38, 100, 200, 300, 400, 462, 500][r] +500*m end: seq(a(n), n=1..100); # Alois P. Heinz, Feb 24 2011
-
Mathematica
Select[Range[11,10000],Mod[PowerMod[#,2,1000],111]==0&] (* Zak Seidov, Feb 23 2011 *)
-
PARI
for(n=11,10000,if((n^2%1000)%111==0,print1(n", "))) \\ Zak Seidov, Feb 23 2011
-
PARI
Vec(2*x*(19*x^2 +12*x +19)*(x^4 +x^3 +x^2 +x +1)/((x -1)^2*(x^6 +x^5 +x^4 +x^3 +x^2 +x +1)) + O(x^100)) \\ Colin Barker, Jul 03 2014
-
Python
def ok(n): s = str(n*n); return len(s) > 2 and s[-1] == s[-2] == s[-3] print(list(filter(ok, range(3463)))) # Michael S. Branicky, Jul 29 2021
Formula
a(n) = a(n-7) + 500 for n > 7. - Zak Seidov and Bruno Berselli, Feb 23 2011
G.f.: 2*x*(19*x^2 +12*x +19)*(x^4 +x^3 +x^2 +x +1) / ((x -1)^2*(x^6 +x^5 +x^4 +x^3 +x^2 +x +1)). - Colin Barker, Jul 03 2014
Comments