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

%I #8 Jul 13 2013 12:04:08

%S 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,

%T 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,

%U 2,3,3,3,2,2,3,3,3,3,4,4,2,1,2,2,2,2

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

%C For n > 0: a(A000290(n)) = 1; for n > 1: a(A002522(n)) = 2;

%C a(n) <= A000196(n).

%H Reinhard Zumkeller, <a href="/A190321/b190321.txt">Table of n, a(n) for n = 0..10000</a>

%o (Haskell)

%o a190321 n = g n $ reverse $ takeWhile (<= n) $ tail a000290_list where

%o g _ [] = 0

%o g m (x:xs) | x > m = g m xs

%o | otherwise = signum m' + g r xs where (m',r) = divMod m x

%Y Cf. A190311, A053610.

%K nonn,base

%O 0,6

%A _Reinhard Zumkeller_, May 08 2011