login
a(0)=0; thereafter a(n+1) = a(n) + 1 + number of 0's in binary representation of a(n), counted with A080791.
29

%I #25 Jun 03 2018 08:00:59

%S 0,1,2,4,7,8,12,15,16,21,24,28,31,32,38,42,46,49,53,56,60,63,64,71,75,

%T 79,82,87,90,94,97,102,106,110,113,117,120,124,127,128,136,143,147,

%U 152,158,162,168,174,178,183,186,190,193,199,203,207,210,215,218,222

%N a(0)=0; thereafter a(n+1) = a(n) + 1 + number of 0's in binary representation of a(n), counted with A080791.

%C These are iterates of A233272: a(0)=0, and for n>0, a(n) = A233272(a(n-1)). The difference from A216431 stems from the fact that it uses A023416 to count the 0-bits in the binary expansion of n, while this sequence uses A080791, which results a slightly different start for the iteration, and a much better alignment with sequences related to "infinite trunk of binary beanstalk", A179016.

%C Apart from term a(2)=2, it seems that each term a(n) >= A179016(n). Please see their ratio plotted with Plot2, and also their differences: A233270.

%H Antti Karttunen, <a href="/A233271/b233271.txt">Table of n, a(n) for n = 0..8727</a>

%H A. Karttunen <a href="http://oeis.org/plot2a?name1=A233271&amp;name2=A179016&amp;tform1=untransformed&amp;tform2=untransformed&amp;shift=0&amp;radiop1=ratio&amp;drawlines=true"> Ratio A233271/A179016 plotted with OEIS Plot2-script</a>

%F a(0)=0, and for n>0, a(n) = A233272(a(n-1)).

%F a(0)=0, and for n>0, a(n) = a(n-1) + 1 + A080791(a(n-1)).

%F a(n) = A054429(A218616(n)) = A054429(A179016(A218602(n))) [This sequence can be mapped to the infinite trunk of "binary beanstalk" with involutions A054429 & A218602].

%F For all n, a(A213710(n)) = 2^n = A000079(n).

%F For n>=3, a(A218600(n)) = A000225(n).

%t a[0] = 0; a[n_] := a[n] = If[n == 1, 1, # + 1 + Last@ DigitCount[#, 2] &@ a[n - 1]]; Table[a@ n, {n, 0, 59}] (* or *)

%t Insert[NestList[# + 1 + DigitCount[#, 2, 0] &, 0, nn], 1, 2] (* _Michael De Vlieger_, Mar 07 2016, the latter after _Harvey P. Dale_ at A216431 *)

%o (Scheme, with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library)

%o (definec (A233271 n) (if (zero? n) n (A233272 (A233271 (- n 1)))))

%o ;; Alternative version:

%o (define (A233271 n) (A054429 (A218616 n)))

%Y Differs from A216431 only in that here 1 has been inserted into position a(1), between 0 and 2.

%Y Cf. A080791, A010062, A233272, A179016, A233270, A218616, A054429, A213710, A218600.

%K nonn,base

%O 0,3

%A _Antti Karttunen_, Dec 12 2013