login
A186439
Numbers whose squares end in three identical digits.
5
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,1
COMMENTS
The three ending digits of a(n)^2 are 000 or 444.
n is in the sequence iff either n == 0 mod 100 or n == (+/-)38 mod 500. - Robert Israel, Jul 03 2014
FORMULA
a(A047336(n)) = A039685(n). - Bruno Berselli, Feb 22 2011
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
EXAMPLE
462 is in the sequence because 462^2 = 213444.
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 *)
PROG
(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
CROSSREFS
Cf. A016742 (even squares), A186438.
Cf. A346678.
Sequence in context: A124141 A093649 A020167 * A044225 A044606 A244177
KEYWORD
nonn,base,easy
AUTHOR
Michel Lagneau, Feb 21 2011
STATUS
approved