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.

A196272 Number of occurrences of '11' in base-4 expansion of n.

This page as a plain text file.
%I A196272 #22 Feb 15 2020 23:58:21
%S A196272 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,
%T A196272 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,
%U A196272 0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,3
%N A196272 Number of occurrences of '11' in base-4 expansion of n.
%C A196272 This is to base 4 A007090 as A196096 is to base 3 and A007089 as A014081 is to base 2 A007088.
%C A196272 Records occur at places where n = '111...11' in base b, that is n = (b^(k+1)-1)/(b-1) for some k > 0, in particular for b=4 as listed in A002450(k+1). - _R. J. Mathar_, Sep 30 2011
%H A196272 T. D. Noe, <a href="/A196272/b196272.txt">Table of n, a(n) for n = 0..1000</a>
%e A196272 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".
%p A196272 A196272 := proc(n)
%p A196272         local a, dgs ;
%p A196272         a := 0 ;
%p A196272         dgs := convert(n, base, 4) ;
%p A196272         for i from 1 to nops(dgs)-1 do
%p A196272                 if op(i, dgs)=1 and op(i+1, dgs)=1 then
%p A196272                         a := a+1 ;
%p A196272                 end if;
%p A196272         end do;
%p A196272         a ;
%p A196272 end proc:
%p A196272 seq(A196272(n), n=0..100) ; # _R. J. Mathar_, Sep 30 2011
%t A196272 Table[d = IntegerDigits[n, 4]; Count[Partition[d, 2, 1], {1, 1}], {n, 0, 100}] (* _T. D. Noe_, Sep 30 2011 *)
%Y A196272 Cf. A007090, A014081, A196096.
%K A196272 nonn,easy,base
%O A196272 0,22
%A A196272 _Jonathan Vos Post_, Sep 29 2011