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

A030097 Numbers k such that k^2 has only even digits.

Original entry on oeis.org

0, 2, 8, 20, 22, 68, 78, 80, 92, 162, 168, 200, 202, 220, 262, 298, 478, 492, 498, 668, 680, 780, 800, 898, 908, 920, 932, 1422, 1492, 1498, 1620, 1680, 1692, 2000, 2002, 2020, 2022, 2192, 2200, 2202, 2498, 2502, 2578, 2620, 2832, 2878, 2978, 2980, 4502
Offset: 1

Views

Author

Keywords

Comments

A136904 is a subsequence. - Zak Seidov, Dec 03 2012

Crossrefs

Programs

  • Mathematica
    Select[ Range[ 3000 ], Union[ EvenQ[ IntegerDigits[ #^2 ] ] ] == {True} & ]
  • PARI
    is_A030097(n)=!setminus(Set(Vec(Str(n^2))),Vec("02468"))  \\ M. F. Hasler, Dec 13 2011

Formula

a(n) = sqrt(A030098(n)). - Zak Seidov, Dec 03 2012

Extensions

More terms from Zak Seidov, May 24 2010

A030288 a(n+1) is smallest square > a(n) having no digits in common with a(n), with a(0) = 0.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 81, 225, 361, 400, 529, 676, 841, 900, 1156, 2209, 3136, 4225, 6889, 7225, 8100, 24336, 58081, 69696, 70225, 84681, 90000, 111556, 200704, 316969, 407044, 511225, 608400, 923521, 4000000, 5112121, 6036849
Offset: 0

Views

Author

Keywords

Comments

It appears that from a(102) on, there is a 4-periodic pattern: a(4k) ~ 3*10^(k-3) a(4k+1) ~ 6.1111...*10^(k-3), a(4k+2) ~ 7*10^(k-3), a(4k+3) ~ 8.1111...*10^(k-3), where ~ means the next larger square which has only digits {0, 3, 4, 5, 7} for even-indexed terms, or {1, 2, 6, 8, 9} for odd-indexed terms. - M. F. Hasler, Nov 12 2017

Crossrefs

Programs

  • Mathematica
    FromDigits /@ NestList[Block[{k = Sqrt@ FromDigits@ # + 1, m}, While[ContainsAny[#, Set[m, IntegerDigits[k^2]]], k++]; m] &, {0}, 38] (* Michael De Vlieger, Nov 02 2017 *)
    ssga[a_]:=Module[{k=Floor[Sqrt[a]]+1},While[Length[Intersection[IntegerDigits[k^2],IntegerDigits[ a]]]> 0,k++];k^2]; NestList[ssga,0,40] (* Harvey P. Dale, Sep 10 2024 *)
  • PARI
    next_A030288(n, D(n)=Set(digits(n)), S=D(n))={for(k=sqrtint(n)+1, oo, #setintersect(D(k^2), S)||return(k^2))} \\ Could be made more efficient by implementing the observed patterns, in particular for n >= 104. - M. F. Hasler, Nov 12 2017

Formula

a(n) = A030287(n)^2. - Michel Marcus, Nov 03 2017

A343724 a(n) is the smallest n-digit square with all digits even.

Original entry on oeis.org

0, 64, 400, 4624, 26244, 228484, 2022084, 20268004, 202208400, 2006860804, 20220840000, 200084446864, 2002004266084, 20000286620224, 200080402620484, 2000028662022400, 20000086482842244, 200002866202240000, 2000008648284224400, 20000246442286866064
Offset: 1

Views

Author

Jon E. Schoenfield, May 19 2021

Keywords

Comments

From Robert G. Wilson v, May 20 2021: (Start)
The square root of any term is == {0, 2, 8} (mod 10).
Other than 1 and 9, there are no squares which contain only odd digits.
(End)

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = Floor[ Sqrt[10^n/5]]}, If[OddQ@k, k--]; While[ Union[ EvenQ[ IntegerDigits[ k^2]]] != {True}, k += 2]; k^2]; Array[ a, 20] (* Robert G. Wilson v, May 20 2021 *)

A343725 a(n) is the largest n-digit square with all digits even.

Original entry on oeis.org

4, 64, 484, 8464, 88804, 868624, 8880400, 86862400, 888040000, 8880800644, 88864802404, 888868068804, 8886826042084, 88886806880400, 888686062262244, 8888680688040000, 88868606226224400, 888868068804000000, 8888600480200862404, 88886806880400000000
Offset: 1

Views

Author

Jon E. Schoenfield, May 19 2021

Keywords

Crossrefs

A103751 Squares whose digits are all positive and even.

Original entry on oeis.org

4, 64, 484, 4624, 8464, 26244, 28224, 68644, 228484, 446224, 824464, 868624, 2862864, 8282884, 8868484, 22448644, 26646244, 44462224, 82228624, 82664464, 222248464, 284866884, 662444644, 866242624, 4246868224, 4444622224, 6266622244, 6282464644, 6668682244, 8264264464, 8268628624
Offset: 1

Views

Author

Emeric Deutsch, Mar 28 2005

Keywords

Comments

Subset of A030098.
All terms end with 4, because when k^2 ends with 6, the tens digit of k^2 is always odd. - Bernard Schott, May 02 2022
The sequence is infinite because squares of the form 4 = 2^2, 64 = 8^2, 4624 = 68^2, 446224 = 668^2, 44462224 = 6668^2, ... (2*(10^k + 2) / 3 )^2 , k >= 0, are terms. - Marius A. Burtea, May 02 2022

Crossrefs

Cf. A030098.

Programs

  • Magma
    [n:n in [s*s:s in [1..100000]]| Set(Intseq(n)) subset {2,4,6,8}]; // Marius A. Burtea, May 02 2022
  • Maple
    a:=proc(n) if convert(convert((n^2),base,10),set) subset {2,4,6,8} then n^2 else fi end:seq(a(n),n=1..100000);
  • Mathematica
    pevQ[n_]:=Module[{idn=IntegerDigits[n]},FreeQ[idn,0]&&And@@EvenQ[idn]]; Select[Range[70000]^2,pevQ] (* Harvey P. Dale, Jul 19 2013 *)
  • PARI
    isok(n) = my(d=digits(n)); vecmin(d) && (#select(x->(x%2), d) == 0);
    lista(nn) = {my(list = List()); for (n=1, nn, if (isok(n^2), listput(list, n^2););); Vec(list);} \\ Michel Marcus, May 02 2022
    

Extensions

More terms from Bernard Schott, May 02 2022

A343726 Squares with exactly one even digit.

Original entry on oeis.org

0, 4, 16, 25, 36, 49, 81, 121, 169, 196, 361, 529, 576, 729, 961, 1156, 1369, 1521, 1936, 3136, 3721, 3969, 5329, 5776, 5929, 7396, 7569, 7921, 15129, 15376, 17161, 17956, 19321, 31329, 35721, 51529, 53361, 57121, 59536, 97969, 111556, 113569, 119716, 131769
Offset: 1

Views

Author

Jon E. Schoenfield, May 19 2021

Keywords

Comments

The even digit is always one of the last two digits.
The only squares with no digits even are the one-digit odd squares 1 and 9.

Crossrefs

Programs

  • Maple
    q:= n-> (l-> is(add(i mod 2, i=l)=nops(l)-1))(convert(n, base, 10)):
    select(q, [i^2$i=0..400])[];  # Alois P. Heinz, May 22 2021
  • Mathematica
    Select[Range[0, 400]^2, Count[IntegerDigits[#], ?EvenQ] == 1 &] (* _Amiram Eldar, May 21 2021 *)
  • PARI
    isA343726(n) = if(issquare(n) && (n!=0), my(d=digits(n)); #d - vecsum(d%2) == 1, n==0) \\ Jianing Song, May 22 2021
  • Python
    def ok(sq): return sum(d in "02468" for d in str(sq)) == 1
    def aupto(limit):
      sqs = (i*i for i in range(int(limit**.5)+2) if i*i <= limit)
      return list(filter(ok, sqs))
    print(aupto(131769)) # Michael S. Branicky, May 20 2021
    

Formula

Intersection of A000290 and A118070.

A343728 Numbers with all digits even whose squares have all but one digit odd.

Original entry on oeis.org

0, 2, 4, 6, 24, 44, 86, 244, 424, 444, 846, 2444, 4424, 6286, 42424, 44244, 240244, 244086, 244866, 268286, 420846, 442244, 446286, 628646, 880646, 2402444, 4402044, 4442244, 8448666, 24040244, 24064866, 26682086, 26682866, 26828666, 28244244, 42400424
Offset: 1

Views

Author

Jon E. Schoenfield, May 20 2021

Keywords

Comments

Of course, the one even digit in the square is always the last digit.

Examples

			244086 is a term: all its digits are even, and 244086^2 = 59577975396 has all but one digit odd.
244044086 is a term: all its digits are even, and 244044086^2 = 59557515911575396 has all but one digit odd.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 10^6], AllTrue[IntegerDigits[#], EvenQ] && AllTrue[Most @ IntegerDigits[#^2], OddQ] &] (* Amiram Eldar, May 20 2021 *)
  • Python
    def ok(n):
      r, s = str(n), str(n*n)
      return all(d in "02468" for d in r) and all(d in "13579" for d in s[:-1])
    print(list(filter(ok, range(0, 42400425, 2)))) # Michael S. Branicky, May 20 2021
    
  • Python
    from gmpy2 import digits
    A343728_list = [n for n in (2*int(digits(d,5)) for d in range(10**6)) if set(str(n**2)[:-1]) <= set('13579')] # Chai Wah Wu, May 21 2021

A343727 Numbers with all digits odd whose squares have only one odd digit.

Original entry on oeis.org

1, 3, 5, 7, 9, 15, 17, 51, 53, 79, 91, 93, 151, 155, 157, 533, 535, 775, 779, 793, 917, 1557, 1571, 1575, 5179, 5333, 5335, 7759, 7799, 9317, 9393, 9395, 15557, 15559, 15755, 51595, 53179, 53333, 53335, 77759, 79151, 79175, 93917, 151151, 155135, 155191
Offset: 1

Views

Author

Jon E. Schoenfield, May 20 2021

Keywords

Comments

Of course, the one odd digit in the square is always the last digit.
The sequence is infinite because it contains the family of numbers 5, 53, 533, 5333, ....... with squares 25, 2809, 284089, 28440889, 2844408889. .... and respectively 535, 5335, 53335, ... with squares 286225, 28462225, 2844622225, 284446222225, ... - Marius A. Burtea, May 21 2021

Examples

			53179 is a term: all its digits are odd, and 53179^2 = 2828006041 has only one odd digit.
15113133375599 is a term: all its digits are odd, and 15113133375599^2 = 228406800428644424408608801 has only one odd digit.
		

Crossrefs

Programs

  • Magma
    [n:n in [1..160000 by 2]|Set(Intseq(n)) subset {1,3,5,7,9} and Set(Intseq(n*n div 10)) subset {0,2,4,6,8}]; // Marius A. Burtea, May 21 2021
  • Mathematica
    Select[Range[160000], AllTrue[IntegerDigits[#], OddQ] && AllTrue[Most @ IntegerDigits[#^2], EvenQ] &] (* Amiram Eldar, May 20 2021 *)
  • Python
    def ok(n):
      r, s = str(n), str(n*n)
      return all(d in "13579" for d in r) and all(d in "02468" for d in s[:-1])
    print(list(filter(ok, range(1, 155192, 2)))) # Michael S. Branicky, May 20 2021
    
  • Python
    from itertools import product
    A343727_list = [n for n in (int(''.join(d)) for l in range(1,6) for d in product('13579',repeat=l)) if set(str(n**2)[:-1]) <= set('02468')] # Chai Wah Wu, May 21 2021
    

A349460 Squares composed of digits {0,2,4}.

Original entry on oeis.org

0, 4, 400, 40000, 2244004, 4000000, 42224004, 224400400, 400000000, 424442404, 4222400400, 22200404004, 22440040000, 40000000000, 42444240400, 422240040000, 2220040400400, 2244004000000, 4000000000000, 4024044024004, 4244424040000, 40244204444224, 42224004000000
Offset: 1

Views

Author

Daniel Blam, Nov 18 2021

Keywords

Comments

From Marius A. Burtea, Nov 18 2021: (Start)
The sequence is infinite because if m > 0 is a term, then 100*m is also a term.
Also, the squares of the numbers 20602, 2006002, 200060002, ..., (2*10^(2*k) + 6*10^k + 2), k >= 2, are 424442404, 4024044024004, 40024004400240004, 400024000440002400004, ... and have only the digits 0, 2 and 4 and are not divisible by 100. (End)

Crossrefs

Subsequence of A000290 and A030098.

Programs

  • Magma
    [n : n in [s*s:s in [1..1500000]]|Set(Intseq(n)) subset {0,2,4}]; // Marius A. Burtea, Nov 18 2021
    
  • Mathematica
    Select[Range[0, 10^7, 2]^2, AllTrue[IntegerDigits[#], MemberQ[{0, 2, 4}, #1] &] &] (* Amiram Eldar, Nov 18 2021 *)
  • Python
    from itertools import islice, count
    def A349460(): return filter(lambda n: set(str(n)) <= {'0','2','4'},(n*n for n in count(0)))
    A349460_list = list(islice(A349460(),20)) # Chai Wah Wu, Nov 19 2021

A202172 Squares containing only the digits 0, 4 or 8.

Original entry on oeis.org

0, 4, 400, 484, 40000, 40804, 48400, 88804, 4000000, 4008004, 4080400, 4088484, 4840000, 4848804, 8880400, 400000000, 400080004, 400800400, 400880484, 408040000, 408848400, 484000000, 484088004, 484880400, 840884004, 888040000, 40000000000, 40000800004
Offset: 1

Views

Author

M. F. Hasler, Dec 13 2011

Keywords

Crossrefs

Cf. A030098.

Programs

  • Mathematica
    Select[Range[0, 400000]^2, Complement[Union[IntegerDigits[#]], {0, 4, 8}] == {} &] (* T. D. Noe, Dec 21 2011 *)
    Select[FromDigits/@Tuples[{0,4,8},11],IntegerQ[Sqrt[#]]&] (* Harvey P. Dale, Apr 19 2019 *)
  • PARI
    for(i=0,99999,setminus(Set(Vec(Str(i^2))),Vec("048")) || print1(i^2,","))

Formula

a(n)=A202170(n)^2
Showing 1-10 of 10 results.