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.

Showing 1-6 of 6 results.

A305719 Numbers whose squares have the same first and last digits.

Original entry on oeis.org

1, 2, 3, 11, 22, 26, 39, 41, 68, 75, 97, 101, 109, 111, 119, 121, 129, 131, 139, 141, 202, 208, 212, 218, 222, 225, 235, 246, 254, 256, 264, 303, 307, 313, 319, 321, 329, 331, 339, 341, 349, 351, 359, 361, 369, 371, 379, 381, 389, 391, 399, 401, 409, 411, 419, 421, 429, 431, 439, 441, 638
Offset: 1

Views

Author

Neville Holmes, Jun 08 2018

Keywords

Examples

			For k = 11, k^2 = 121;
for k = 26, k^2 = 676.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[638], (d = IntegerDigits[#^2]; d[[1]] == d[[-1]]) &] (* Giovanni Resta, Jun 25 2018 *)
  • PARI
    for(n=1, 10^3, my(d=digits(n^2)); if( d[1]==d[#d], print1(n,", "))); \\ Joerg Arndt, Jun 10 2018
    
  • Python
    def ok(n): s = str(n*n); return s[0] == s[-1]
    print(list(filter(ok, range(1, 639)))) # Michael S. Branicky, Jul 16 2021

A346774 Numbers whose square starts and ends with exactly 2 identical digits.

Original entry on oeis.org

88, 150, 210, 212, 338, 340, 470, 580, 670, 880, 940, 1050, 1060, 1062, 1070, 1080, 1088, 1090, 1488, 1510, 1512, 1820, 1830, 1838, 1840, 2110, 2112, 2120, 2350, 2360, 2362, 2570, 2580, 2588, 2780, 2790, 2970, 3150, 3160, 3320, 3330, 3350, 3360, 3362, 3370, 3380, 3388, 3390, 3410
Offset: 1

Views

Author

Bernard Schott, Aug 03 2021

Keywords

Comments

The terminal digits are 00 or 44.

Examples

			150 is a term because 150^2 = 22500.
212 is a term because 212^2 = 44944 (smallest square with 2 times two 4's).
2788 is not a term because 2788^2 = 7772944.
		

Crossrefs

Subsequence of A346678.

Programs

  • Mathematica
    Select[Range[32, 3500], (d = IntegerDigits[#^2])[[1]] == d[[2]] != d[[3]] && d[[-1]] == d[[-2]] != d[[-3]] &] (* Amiram Eldar, Aug 03 2021 *)
  • Python
    def ok(n):
        s = str(n*n)
        if len(s) < 4: return False # there are no ok squares with < 4 digits
        return s[0] == s[1] != s[2] and s[-1] == s[-2] != s[-3]
    print(list(filter(ok, range(3411)))) # Michael S. Branicky, Aug 03 2021

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

A346678 Positive numbers whose squares end in exactly two identical digits.

Original entry on oeis.org

10, 12, 20, 30, 40, 50, 60, 62, 70, 80, 88, 90, 110, 112, 120, 130, 138, 140, 150, 160, 162, 170, 180, 188, 190, 210, 212, 220, 230, 238, 240, 250, 260, 262, 270, 280, 288, 290, 310, 312, 320, 330, 338, 340, 350, 360, 362, 370, 380, 388, 390, 410, 412, 420, 430, 438, 440, 450, 460
Offset: 1

Views

Author

Bernard Schott, Jul 29 2021

Keywords

Comments

When a square ends in exactly two identical digits, these digits are necessarily 00 or 44, so all terms are even.
The numbers are of the form: 10*floor((10*k-1)/9), k > 0, or, 50*floor((10*k-1)/9) +- 38, k > 0.
Equivalently: m is in the sequence iff either (m == 0 (mod 10) and m <> 0 (mod 100)) or (m == +- 38 (mod 50) and m <> +- 38 (mod 500)).

Examples

			12 is in the sequence because 12^2 = 144 ends in two 4's.
20 is in the sequence because 20^2 = 400 ends in two 0's.
38 is not in the sequence because 38^2 = 1444 ends in three 4's.
		

Crossrefs

Equals A186438 \ A186439.
Supersequence of A346774.

Programs

  • Mathematica
    Select[Range[10, 460], (d = IntegerDigits[#^2])[[-1]] == d[[-2]] != d[[-3]] &] (* Amiram Eldar, Jul 29 2021 *)
  • Python
    def ok(n): s = str(n*n); return len(s) > 2 and s[-1] == s[-2] != s[-3]
    print(list(filter(ok, range(461)))) # Michael S. Branicky, Jul 29 2021

Formula

a(n+63) = a(n) + 500.

A346812 Positive numbers whose square starts with exactly 2 identical digits.

Original entry on oeis.org

15, 21, 34, 47, 58, 67, 88, 94, 105, 106, 107, 108, 109, 150, 151, 182, 183, 184, 210, 211, 212, 235, 236, 257, 258, 278, 279, 297, 315, 316, 332, 333, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 470, 471, 473, 474, 475, 476, 477, 478, 479, 575, 576, 577, 578, 579, 580, 581
Offset: 1

Views

Author

Bernard Schott, Aug 05 2021

Keywords

Comments

If m is a term, then 10*m is another term.

Examples

			34 is a term because 34^2 = 1156.
149 is not a term because 149^2 = 22201.
		

Crossrefs

Subsequence of A123912.
A346774 is a subsequence.
Cf. A186438, A186439, A346678 (similar, with "ends").

Programs

  • Mathematica
    Select[Range[10, 600], (d = IntegerDigits[#^2])[[1]] == d[[2]] != d[[3]] &] (* Amiram Eldar, Aug 05 2021 *)
  • PARI
    isok(m) = my(d=digits(m^2)); (#d > 2) && (d[2] == d[1]) && (d[3] != d[2]); \\ Michel Marcus, Aug 05 2021
  • Python
    def ok(n): s = str(n*n); return len(s) > 2 and s[0] == s[1] != s[2]
    print(list(filter(ok, range(582)))) # Michael S. Branicky, Aug 05 2021
    

A174499 Smallest number whose square starts and ends with (at least) n identical digits.

Original entry on oeis.org

1, 88, 10538, 235700, 10541000, 57735000, 7453560000, 14907120000, 18257418600000, 29814239700000, 298142397000000, 1490711985000000, 14907119850000000, 105409255338950000000, 7453559924999300000000, 10540925533894600000000
Offset: 1

Views

Author

Michel Lagneau, Feb 22 2011

Keywords

Comments

For n > 3 the last n identical digits are zeros. Proof:
For n = 3, the numbers a(n) == {0, 38, 100, 200, 300, 400, 462, 500, 538, 600, 700, 800, 900, 962} mod 1000, but for n = 4, if the suffix is different from zero, a(n) == {38, 462, 538, 962} mod 1000, and for d from [1..9], (d038)^2 <> 4444 (mod 10000), (d462)^2 <> 4444 (mod 10000), (d538)^2 <> 4444 (mod 10000), (d962)^2 <> 4444 (mod 10000).
Differs from A346926 where exactly n identical digits are required. - Bernard Schott, Aug 08 2021

Examples

			a(3) = 10538 because 10538^2 = 111049444 starts and ends in 3 identical digits.
a(5) = 10541000 because 10541000^2 = 111112681000000 starts with 5 identical digits and ends with 6 identical digits.
		

Crossrefs

Programs

  • Maple
    with(numtheory):T:=array(1..100):p0:=10:for k from 2 to 10 do: id:= 0:for p
      from p0 to 100000000 while(id=0) 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:z:=0:for a from 1
      to k-1 do: if T[l]=T[l-a] and T[1]=T[1+a] then z:=z+1:else fi:od:if z=k-1 then
      print(p):id:=1:p0:=p:else fi:od:od:

Formula

For n > 3, a(n) = A119998(n)*10^q, q = floor(n+1)/2. [corrected by Bernard Schott, Aug 08 2021]

Extensions

Name clarified and a(10) and a(12) corrected by Bernard Schott, Aug 08 2021
Showing 1-6 of 6 results.