A196272 Number of occurrences of '11' in base-4 expansion of n.
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 3
Offset: 0
Examples
a(21) = 2 because 21 (base 10) = 111 (base 4), whose first two digits are 1's, and whose rightmost two digits are the second substring of "11".
Links
- T. D. Noe, Table of n, a(n) for n = 0..1000
Programs
-
Maple
A196272 := proc(n) local a, dgs ; a := 0 ; dgs := convert(n, base, 4) ; for i from 1 to nops(dgs)-1 do if op(i, dgs)=1 and op(i+1, dgs)=1 then a := a+1 ; end if; end do; a ; end proc: seq(A196272(n), n=0..100) ; # R. J. Mathar, Sep 30 2011
-
Mathematica
Table[d = IntegerDigits[n, 4]; Count[Partition[d, 2, 1], {1, 1}], {n, 0, 100}] (* T. D. Noe, Sep 30 2011 *)
Comments