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

A030098 Squares whose digits are all even.

Original entry on oeis.org

0, 4, 64, 400, 484, 4624, 6084, 6400, 8464, 26244, 28224, 40000, 40804, 48400, 68644, 88804, 228484, 242064, 248004, 446224, 462400, 608400, 640000, 806404, 824464, 846400, 868624, 2022084, 2226064, 2244004, 2624400, 2822400, 2862864, 4000000, 4008004, 4080400
Offset: 1

Views

Author

Keywords

Comments

On the other hand, the only squares whose digits are all odd are 1 and 9, because the tens digit of all odd squares >= 25 (A016754) is always even. - Bernard Schott, Jan 24 2023

Crossrefs

Subsequence of A075787.

Programs

  • Mathematica
    t = {}; n = -1; While[Length[t] < 1000, n++; If[Intersection[IntegerDigits[n^2], {1, 3, 5, 7, 9}] == {}, AppendTo[t, n^2]]] (* T. D. Noe, Apr 03 2014 *)
    Select[Range[0,3000]^2,AllTrue[IntegerDigits[#],EvenQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 19 2016 *)
  • Python
    from math import isqrt
    def ok(sq): return all(d in "02468" for d in str(sq))
    def aupto(limit):
      sqs = (i*i for i in range(0, isqrt(limit)+1, 2))
      return list(filter(ok, sqs))
    print(aupto(4080400)) # Michael S. Branicky, May 20 2021

Formula

a(n) = A030097(n)^2. - Michel Marcus, Apr 03 2014

A202170 Numbers k such that k^2 has only digits 0, 4 and 8.

Original entry on oeis.org

0, 2, 20, 22, 200, 202, 220, 298, 2000, 2002, 2020, 2022, 2200, 2202, 2980, 20000, 20002, 20020, 20022, 20200, 20220, 22000, 22002, 22020, 28998, 29800, 200000, 200002, 200020, 200022, 200200, 200202, 200220, 202000, 202002, 202200, 220000, 220002, 220020, 220200, 289980, 298000, 632522, 2000000
Offset: 1

Views

Author

M. F. Hasler, Dec 13 2011

Keywords

Comments

k = 2*m where m^2 has only digits 0, 1 and 2. - Robert Israel, Jul 17 2018

Crossrefs

Includes 2*A136808.

Programs

  • Magma
    [ n: n in [0..10^6 by 2] | Set(Intseq(n^2)) subset [0,4,8] ]; // Bruno Berselli, Dec 19 2011
  • Maple
    Res:= NULL:
    for x from 0 to 3^12 do
      L:= convert(x,base,3);
      y:= add(L[i]*10^(i-1),i=1..nops(L));
      if issqr(y) then
        Res:= Res, 2*sqrt(y)
      fi
    od:
    Res; # Robert Israel, Jul 17 2018
  • Mathematica
    Select[Sqrt[FromDigits[#]]&/@Tuples[{0,4,8},13],IntegerQ] (* Harvey P. Dale, Sep 08 2024 *)
  • PARI
    is_A202170(n)=!setminus(Set(Vec(Str(n^2))),Vec("048"))
    

Extensions

More terms from Robert Israel, Jul 17 2018

A385300 Integers k containing only odd digits, except the last digit, such that k^2 is composed of only even digits.

Original entry on oeis.org

2, 8, 78, 92, 932, 7798, 51192, 939398, 5157798, 7797578, 7797978, 9393978, 15119592, 15773398, 53179378, 53559332, 77979998, 79175932, 155139378, 157759592, 517751738, 535393932, 917933998, 939597798, 1511979592, 5157759592, 7771757978, 7775735378, 9393959798
Offset: 1

Views

Author

Gonzalo Martínez, Jun 24 2025

Keywords

Comments

Although the terms in this list contain only odd digits, except for the units digit, their squares have only even digits.
The terms of the list are even numbers ending only in 2 or in 8. Proof: if n ends in 0, 4 or 6, since the penultimate digit of n is odd, then the last 2 digits of n can be: 10, 14, 16, 30, 34, 36, 50, 54, 56, 70, 74, 76, 90, 94 and 96. If n ends in 10, 30, 50, 70 or 90, then the antepenultimate digit of n^2 is odd, while in the other cases the penultimate digit of n^2 is odd.
a(n) == 32, 38, 78, 92, 98 (mod 100), for n > 3.
a(n) == 192, 332, 338, 378, 398, 578, 592, 738, 798, 932, 978, 992, 998 (mod 1000), for n > 4. - Chai Wah Wu, Jun 25 2025

Examples

			7798 is a term, since only the last digit is even and 7798^2 = 60808804, whose digits are all even.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^7],NoneTrue[Take[IntegerDigits[#],IntegerLength[#]-1],EvenQ]&&AllTrue[IntegerDigits[#^2],EvenQ]&] (* James C. McMahon, Jun 28 2025 *)
  • PARI
    odd(n) = {my(k=1); while(n>5^k, n-=5^k; k++); fromdigits([2*d+1 | d<-digits(5^k+n-1, 5)]) - 3*10^k}; \\ A014261
    lista(nn) = my(list=List()); forstep (e=2, 8, 2, if (#select(x->(x%2), digits(e^2)) == 0, listput(list, e));); for (n=1, nn, my(o=odd(n)); forstep (e=0, 8, 2, my(oe = 10*o+e); if (#select(x->(x%2), digits(oe^2)) == 0, listput(list, oe)););); Vec(list); \\ Michel Marcus, Jun 25 2025
    
  • Python
    from itertools import count, product, islice
    def A385300_gen(): # generator of terms
        for l in count(1):
            for d in product('13579',repeat=l):
                m = int(''.join(d))-1
                if m>0 and set(str(m**2))<={'0','2','4','6','8'}:
                    yield m
    A385300_list = list(islice(A385300_gen(),29)) # Chai Wah Wu, Jun 25 2025
Showing 1-3 of 3 results.