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.
%I A216431 #29 Jan 01 2025 15:40:47 %S A216431 0,2,4,7,8,12,15,16,21,24,28,31,32,38,42,46,49,53,56,60,63,64,71,75, %T A216431 79,82,87,90,94,97,102,106,110,113,117,120,124,127,128,136,143,147, %U A216431 152,158,162,168,174,178,183,186,190,193,199,203,207,210,215,218,222 %N A216431 a(0)=0; thereafter a(n+1) = a(n) + 1 + number of 0's in binary representation of a(n), counted with A023416. %C A216431 The difference from A233271 stems from the fact that it uses A080791 to count the 0-bits in binary expansion of n, while this sequence uses A023416, which results a slightly different start for the iteration. %H A216431 Harvey P. Dale, <a href="/A216431/b216431.txt">Table of n, a(n) for n = 0..1000</a> %F A216431 If n<2, a(n) = 2n, otherwise, a(n) = A233272(a(n-1)). - _Antti Karttunen_, Dec 12 2013 %t A216431 NestList[#+1+DigitCount[#,2,0]&,0,60] (* _Harvey P. Dale_, Sep 25 2013 *) %o A216431 (Python) %o A216431 a = 0 %o A216431 for n in range(100): %o A216431 print(a, end=', ') %o A216431 ta = a %o A216431 c0 = (a==0) %o A216431 while ta>0: %o A216431 c0 += 1-(ta&1) %o A216431 ta >>= 1 %o A216431 a += 1 + c0 %o A216431 (Scheme) %o A216431 ;; With memoizing definec-macro from Antti Karttunen's IntSeq-library. %o A216431 (definec (A216431 n) (if (< n 2) (+ n n) (A233272 (A216431 (- n 1))))) %o A216431 ;; _Antti Karttunen_, Dec 12 2013 %Y A216431 Differs from A233271 only in that this jumps directly from 0 to 2 in the beginning. %Y A216431 Cf. A023416, A010062, A214913, A233271, A233272. %K A216431 nonn,base %O A216431 0,2 %A A216431 _Alex Ratushnyak_, Sep 08 2012 %E A216431 Name edited by _Antti Karttunen_, Dec 12 2013