A190321 Number of nonzero digits when writing n in base where place values are squares, cf. A007961.
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
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
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
Comments