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

A182211 The number of integers k < 10^n such that both k and k^3 mod 10^n have all odd decimal digits.

Original entry on oeis.org

5, 25, 62, 151, 381, 833, 2163, 5291, 13317, 33519, 85179, 213083, 539212, 1344272, 3358571
Offset: 1

Views

Author

Victor S. Miller, Apr 18 2012

Keywords

Comments

Inspired by a discussion on the math-fun list on April 18, 2012 by James R. Buddenhagen.

Crossrefs

Cf. A085597 (n such that both n and n^3 have all odd digits).

Programs

  • Haskell
    oddDigits 0 = True
    oddDigits n = let (q,r) = quotRem n 10
                  in (odd r) && oddDigits q
    oddSet 0 = []
    oddSet 1 = [1,3..9]
    oddSet k = [n | i <- [1,3..9], x <- oddSet (k-1), let n = i*10^(k-1) + x,
                   oddDigits((n^3) `mod` 10^k)]
    main = putStrLn $ map (length . oddSet) [1..]

A353342 Numbers k such that k and k^3 use only even digits.

Original entry on oeis.org

0, 2, 4, 20, 40, 200, 202, 400, 2000, 2002, 2020, 4000, 20000, 20002, 20020, 20200, 40000, 200000, 200002, 200020, 200200, 202000, 400000, 2000000, 2000002, 2000020, 2000200, 2002000, 2020000, 4000000, 20000000, 20000002, 20000020, 20000200, 20000202, 20002000, 20002002, 20020000, 20200000
Offset: 1

Views

Author

Bernard Schott, May 06 2022

Keywords

Comments

Numbers k such that k^3 has only even digits are in A052004.

Crossrefs

Cf. A085597 (similar, but with odd digits).
Intersection of A014263 and A052004.

Programs

  • Mathematica
    seq[ndigmax_] := Module[{nums = Tuples[{0, 2, 4, 6, 8}, ndigmax]}, Select[FromDigits /@ nums, AllTrue[IntegerDigits[#^3], EvenQ] &]]; seq[8] (* Amiram Eldar, May 06 2022 *)
  • Python
    from itertools import count, islice, product
    def agen(): # generator of terms
        for digits in count(1):
            for p in product("02468", repeat=digits):
                if len(p) > 1 and p[0] == "0": continue
                k = int("".join(p))
                if set(str(k**3)) <= set("02468"):
                    yield k
    print(list(islice(agen(), 40))) # Michael S. Branicky, May 06 2022
Showing 1-2 of 2 results.