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!)
A214913 a(n+1) = a(n) + max(1, count0s), where count0s is number of 0's in binary representation of a(n). 2

%I #14 Apr 21 2016 13:54:09

%S 0,1,2,3,4,6,7,8,11,12,14,15,16,20,23,24,27,28,30,31,32,37,40,44,47,

%T 48,52,55,56,59,60,62,63,64,70,74,78,81,85,88,92,95,96,101,104,108,

%U 111,112,116,119,120,123,124,126,127,128,135,139,143,146,151,154,158

%N a(n+1) = a(n) + max(1, count0s), where count0s is number of 0's in binary representation of a(n).

%H Harvey P. Dale, <a href="/A214913/b214913.txt">Table of n, a(n) for n = 1..1000</a>

%t NestList[#+Max[1,DigitCount[#,2,0]]&,0,70] (* _Harvey P. Dale_, Apr 21 2016 *)

%o (Python)

%o a = 0

%o for n in range(100):

%o print a,

%o ta = a

%o c0 = (a==0)

%o while ta>0:

%o c0 += 1-(ta&1)

%o ta >>= 1

%o a += max(c0,1)

%Y Cf. A010062.

%K nonn,base

%O 1,3

%A _Alex Ratushnyak_, Aug 03 2012

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 2 16:14 EDT 2024. Contains 372197 sequences. (Running on oeis4.)