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.

A186439 Numbers whose squares end in three identical digits.

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Feb 21 2011

Keywords

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

Examples

			462 is in the sequence because 462^2 = 213444.
		

Crossrefs

Cf. A016742 (even squares), A186438.
Cf. A346678.

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(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