A216431 a(0)=0; thereafter a(n+1) = a(n) + 1 + number of 0's in binary representation of a(n), counted with A023416.
0, 2, 4, 7, 8, 12, 15, 16, 21, 24, 28, 31, 32, 38, 42, 46, 49, 53, 56, 60, 63, 64, 71, 75, 79, 82, 87, 90, 94, 97, 102, 106, 110, 113, 117, 120, 124, 127, 128, 136, 143, 147, 152, 158, 162, 168, 174, 178, 183, 186, 190, 193, 199, 203, 207, 210, 215, 218, 222
Offset: 0
Links
- Harvey P. Dale, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Mathematica
NestList[#+1+DigitCount[#,2,0]&,0,60] (* Harvey P. Dale, Sep 25 2013 *)
-
Python
a = 0 for n in range(100): print(a, end=', ') ta = a c0 = (a==0) while ta>0: c0 += 1-(ta&1) ta >>= 1 a += 1 + c0
-
Scheme
;; With memoizing definec-macro from Antti Karttunen's IntSeq-library. (definec (A216431 n) (if (< n 2) (+ n n) (A233272 (A216431 (- n 1))))) ;; Antti Karttunen, Dec 12 2013
Formula
If n<2, a(n) = 2n, otherwise, a(n) = A233272(a(n-1)). - Antti Karttunen, Dec 12 2013
Extensions
Name edited by Antti Karttunen, Dec 12 2013
Comments