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.

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..]