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-4 of 4 results.

A273373 Squares ending in digit 6.

Original entry on oeis.org

16, 36, 196, 256, 576, 676, 1156, 1296, 1936, 2116, 2916, 3136, 4096, 4356, 5476, 5776, 7056, 7396, 8836, 9216, 10816, 11236, 12996, 13456, 15376, 15876, 17956, 18496, 20736, 21316, 23716, 24336, 26896, 27556, 30276, 30976, 33856, 34596, 37636, 38416, 41616
Offset: 1

Views

Author

Vincenzo Librandi, May 21 2016

Keywords

Comments

These are the only squares whose second last digit is odd. This implies that the only squares whose last two digits are the same are those ending with 0 or 4; those ending with 1, 5, and 9 are paired with even second last digits. - Waldemar Puszkarz, May 24 2016

Crossrefs

Cf. A017341 (numbers ending in 6), A017343 (cubes ending in 6).
Cf. squares with last digit k: A017270 (k=0), A273372 (k=1), A273375 (k=4), A017330 (k=5), this sequence (k=6), A273374 (k=9).

Programs

  • Magma
    /* By definition: */ [n^2: n in [0..200] | Modexp(n,2,10) eq 6];
    
  • Magma
    [(10*n - 3*(-1)^n - 5)^2/4: n in [1..50]];
  • Maple
    seq(seq((10*i+j)^2,j=[4,6]),i=0..20); # Robert Israel, May 24 2016
  • Mathematica
    Table[(10 n - 3 (-1)^n - 5)^2/4, {n, 1, 50}]
    CoefficientList[Series[4 (4 + 5 x + 32 x^2 + 5 x^3 + 4 x^4) / ((1 + x)^2 (1 - x)^3), {x, 0, 50}], x]
    Select[Range[250]^2,Mod[#,10]==6&] (* Harvey P. Dale, May 31 2020 *)

Formula

G.f.: 4*x*(4 + 5*x + 32*x^2 + 5*x^3 + 4*x^4)/((1 + x)^2*(1 - x)^3).
a(n) = 4*A047221(n)^2 = (10*n - 3*(-1)^n - 5)^2/4.
a(n) = A090773(n)^2. - Michel Marcus, May 25 2016
Sum_{n>=1} 1/a(n) = 2*Pi^2/(25*(5+sqrt(5))). - Amiram Eldar, Feb 16 2023

Extensions

Corrected and extended by Bruno Berselli, May 23 2016

A348488 Positive numbers whose square starts and ends with exactly one 4.

Original entry on oeis.org

2, 22, 68, 202, 208, 218, 222, 642, 648, 652, 658, 672, 678, 682, 692, 698, 702, 2002, 2008, 2018, 2022, 2028, 2032, 2042, 2048, 2052, 2058, 2068, 2072, 2078, 2082, 2092, 2122, 2128, 2132, 2142, 2148, 2152, 2158, 2168, 2172, 2178, 2182, 2192, 2198, 2202, 2208, 2218, 2222, 2228
Offset: 1

Views

Author

Bernard Schott, Oct 24 2021

Keywords

Comments

When a square ends with 4 (A273375), this square may end with precisely one 4, two 4's or three 4's (A328886).
This sequence is infinite as each 2*(10^m + 1), m >= 1 or 2*(10^m + 4), m >= 2 is a term.
Numbers 2, 22, 222, ..., 2*(10^k - 1) / 9, (k >= 1), as well as numbers 2228, 22228, ..., 2*(10^k + 52) / 9, (k >= 4) are terms and have no digits 0. - Marius A. Burtea, Oct 24 2021

Examples

			22 is a term since 22^2 = 484.
638 is not a term since 638^2 = 407044.
668 is not a term since 668^2 = 446224.
		

Crossrefs

Cf. A045858, A273375 (squares ending with 4), A017317, A328886 (squares ending with three 4).
Cf. A002276 \ {0} (a subsequence).
Subsequence of A305719.
Similar to: A348487 (k=1), this sequence (k=4), A348489 (k=5), A348490 (k=6).

Programs

  • Magma
    [2] cat [n:n in [4..2300]|Intseq(n*n)[1] eq 4 and Intseq(n*n)[#Intseq(n*n)] eq 4 and Intseq(n*n)[-1+#Intseq(n*n)] ne 4 and Intseq(n*n)[2] ne 4]; // Marius A. Burtea, Oct 24 2021
    
  • Mathematica
    Join[{2}, Select[Range[10, 2000], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 4 && d[[-2]] != 4 && d[[2]] != 4 &]] (* Amiram Eldar, Oct 24 2021 *)
  • PARI
    isok(k) = my(d=digits(sqr(k))); (d[1]==4) && (d[#d]==4) && if (#d>2, (d[2]!=4) && (d[#d-1]!=4), 1); \\ Michel Marcus, Oct 24 2021
    
  • Python
    from itertools import count, takewhile
    def ok(n):
      s = str(n*n); return len(s.rstrip("4")) == len(s.lstrip("4")) == len(s)-1
    def aupto(N):
      r = takewhile(lambda x: x<=N, (10*i+d for i in count(0) for d in [2, 8]))
      return [k for k in r if ok(k)]
    print(aupto(2228)) # Michael S. Branicky, Oct 24 2021

A348832 Positive numbers whose square starts and ends with exactly 444.

Original entry on oeis.org

666462, 666538, 666962, 667038, 2107462, 2107538, 2107962, 2108038, 2108462, 2108538, 2108962, 2109038, 2109462, 6663462, 6663538, 6663962, 6664038, 6664462, 6664538, 6664962, 6665038, 6665462, 6665538, 6665962, 6666038, 6667462, 6667538, 6667962, 6668038, 6668462, 6668538, 6668962
Offset: 1

Views

Author

Bernard Schott, Nov 09 2021

Keywords

Comments

The 1st problem of British Mathematical Olympiad (BMO) in 1995 (see link) asked to find all positive integers whose squares end in three 4’s (A039685); this sequence is the subsequence of these integers whose squares also start in precisely three 4's (no four or more 4's). Two such infinite subsequences are proposed below.
When a square starts and ends with digits ddd, then ddd is necessarily 444.
The first 3 digits of terms are either 210, 666 or 667, while the last 3 digits are either 038, 462, 538 or 962 (see examples).
From Marius A. Burtea, Nov 09 2021 : (Start)
The sequence is infinite because the numbers 667038, 6670038, 66700038, 667000038, ..., 667*10^k + 38, k >= 3, are terms because are square 444939693444, 44489406921444, 4448895069201444, 444889050692001444, 44488900506920001444, ...
Also, 6663462, 66633462, 666333462, 6663333462, ..., (1999*10^k + 386) / 3, k >= 4, are terms and have no digits 0, because their squares are 44401725825444, 4440018258105444, 444000282580905444, 44400012825808905444,
4440001128258088905444, ... (End)

Examples

			666462 is a term since 666462^2 = 444171597444.
21038 is not a term since 21038^2 = 442597444.
		

References

  • A. Gardiner, The Mathematical Olympiad Handbook: An Introduction to Problem Solving, Oxford University Press, 1997, reprinted 2011, Pb 1 pp. 55 and 95-96 (1995)

Crossrefs

Subsequence of A039685, A045858, A273375, A305719, A346892.
Similar to: A348488 (d=4), A348831 (dd=44), this sequence (ddd=444).

Programs

  • Magma
    fd:=func; fs:=func; [n:n in [1..6700000]|fd(n) and fs(n)]; // Marius A. Burtea, Nov 09 2021
  • Mathematica
    Select[Range[100, 7*10^6], (d = IntegerDigits[#^2])[[1 ;; 3]] == d[[-3 ;; -1]] == {4, 4, 4} && d[[-4]] != 4 && d[[4]] != 4 &] (* Amiram Eldar, Nov 09 2021 *)
  • Python
    from itertools import count, takewhile
    def ok(n):
      s = str(n*n); return len(s.rstrip("4")) == len(s.lstrip("4")) == len(s)-3
    def aupto(N):
      ends = [38, 462, 538, 962]
      r = takewhile(lambda x: x<=N, (1000*i+d for i in count(0) for d in ends))
      return [k for k in r if ok(k)]
    print(aupto(6668962)) # Michael S. Branicky, Nov 09 2021
    

A348831 Positive numbers whose square starts and ends with exactly 44, and no 444.

Original entry on oeis.org

212, 2112, 6638, 6662, 6688, 20988, 21012, 21062, 21112, 21138, 21162, 21188, 21212, 66338, 66362, 66388, 66412, 66438, 66488, 66512, 66562, 66588, 66612, 66712, 66738, 66762, 66788, 66812, 66838, 66862, 66888, 66912, 66938, 66988, 67012, 67062, 209762, 209788
Offset: 1

Views

Author

Bernard Schott, Nov 08 2021

Keywords

Comments

When a square starts and ends with digits dd, then dd is necessarily 44.
The last 2 digits of terms are either 12, 38, 62 or 88.
From Marius A. Burtea, Nov 09 2021 : (Start)
The sequence is infinite because the numbers 212, 2112, 21112, ..., (19*10^k + 8) / 9, k >= 3, are terms because the remainder when dividing by 1000 is 544 and 445*10^(2*k - 2) < ((19*10^k + 8) / 9)^2 < 447*10^(2*k - 2), k >= 3.
Also 6638, 66338, 663338, 6633338, 66333338, 663333338, 6633333338, ..., (199*10^k + 14) / 3, k >= 2, are terms and have no digits 0, because their squares are: 44063044, 4400730244, 4400730244, 440017302244, 44001173022244, 4400111730222244, 440011117302222244, ... (End)

Examples

			212 is a term since 212^2 = 44944.
662 is not a term since 662^2 = 438244.
668 is not a term since 668^2 = 446224.
2108 is not a term since 2108^2 = 4443664.
21038 is not a term since 21038^2 = 442597444.
21088 is not a term since 21088^2 = 444703744.
		

Crossrefs

Cf. A017317.
Subsequence of A045858, A273375, A305719 and A346774.
Similar to: A348488 (d=4), this sequence (dd=44), A348832 (ddd=444).

Programs

  • Magma
    fd:=func; fs:=func; [n:n in [1..210000]|fd(n) and fs(n)]; // Marius A. Burtea, Nov 08 2021
    
  • Mathematica
    Select[Range[10, 300000], (d = IntegerDigits[#^2])[[1 ;; 2]] ==  d[[-2 ;; -1]] == {4, 4} && d[[-3]] != 4 && d[[3]] != 4 &] (* Amiram Eldar, Nov 08 2021 *)
  • Python
    from itertools import count, takewhile
    def ok(n):
      s = str(n*n); return len(s.rstrip("4")) == len(s.lstrip("4")) == len(s)-2
    def aupto(N):
      ends = [12, 38, 62, 88]
      r = takewhile(lambda x: x<=N, (100*i+d for i in count(0) for d in ends))
      return [k for k in r if ok(k)]
    print(aupto(209788)) # Michael S. Branicky, Nov 08 2021
Showing 1-4 of 4 results.