login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014083 Occurrences of '1111' in binary expansion of n. 1

%I #23 Jul 24 2017 08:29:42

%S 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,1,2,0,0,

%T 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,1,1,2,3,0,0,0,0,

%U 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,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1

%N Occurrences of '1111' in binary expansion of n.

%H Antti Karttunen, <a href="/A014083/b014083.txt">Table of n, a(n) for n = 0..65536</a>

%H R. Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences ...</a>

%H R. Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(2n) = a(n), a(2n+1) = a(n) + [n congruent to 7 mod 8]. - _Ralf Stephan_, Aug 21 2003

%F G.f.: 1/(1-x) * sum(k>=0, t^15(1-t)/(1-t^16), t=x^2^k). - _Ralf Stephan_, Sep 08 2003

%F a(n) <= log_2(n+1) - 3 for n >= 7. - _Charles R Greathouse IV_, Jan 21 2016

%e a(63) = 3 as 63 = 111111 in binary and 1111 occurs three times (different occurrences may overlap). - _Antti Karttunen_, Jul 24 2017

%p See A014081.

%t Table[SequenceCount[IntegerDigits[n,2],{1,1,1,1},Overlaps->True],{n,0,100}] (* The program uses the SequenceCount function from Mathematica version 10 *) (* _Harvey P. Dale_, Sep 25 2015 *)

%o (PARI) u1111(n)=my(v=binary(n)); sum(k=1,#v-3, v[k]&&v[k+1]&&v[k+2]&&v[k+3])

%o (PARI) a(n)=my(s,t); while(n, n>>=valuation(n,2); t=valuation(n+1,2); s+=max(t-3, 0); n>>=t); s \\ _Charles R Greathouse IV_, Jan 21 2016

%Y Cf. A000120, A014081, A014082.

%K nonn,base,easy

%O 0,32

%A _Simon Plouffe_

%E Term a(0)=0 prepended and more terms from _Antti Karttunen_, Jul 24 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 00:25 EDT 2024. Contains 372298 sequences. (Running on oeis4.)