OFFSET
0,14
COMMENTS
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1000
EXAMPLE
a(4) = 1 because 4 in base 3 is "11" which has one instance of "11".
a(13) = 2 because the number 13 in base 3 is "111" which has two substrings of "11".
MAPLE
A196096 := proc(n)
local a, dgs3 ;
a := 0 ;
dgs3 := convert(n, base, 3) ;
for i from 1 to nops(dgs3)-1 do
if op(i, dgs3)=1 and op(i+1, dgs3)=1 then
a := a+1 ;
end if;
end do;
a ;
end proc:
seq(A196096(n), n=0..80) ; # R. J. Mathar, Sep 28 2011
MATHEMATICA
f[n_] := Count[ Partition[ IntegerDigits[ n, 3], 2, 1], {1, 1}]; Array[f, 100, 0] (* Robert G. Wilson v, Sep 27 2011 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Sep 27 2011
STATUS
approved