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.

A190321 Number of nonzero digits when writing n in base where place values are squares, cf. A007961.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 1, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 1, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 4, 1, 2, 2, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 4, 4, 2, 1, 2, 2, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, May 08 2011

Keywords

Comments

For n > 0: a(A000290(n)) = 1; for n > 1: a(A002522(n)) = 2;
a(n) <= A000196(n).

Crossrefs

Programs

  • Haskell
    a190321 n = g n $ reverse $ takeWhile (<= n) $ tail a000290_list where
      g _ []                 = 0
      g m (x:xs) | x > m     = g m xs
                 | otherwise = signum m' + g r xs where (m',r) = divMod m x