Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Jan 02 2023 12:30:54
%S 0,1,2,3,4,5,6,7,8,9,10,13,14,11,12,15,16,17,18,25,22,21,26,27,30,19,
%T 20,29,28,23,24,31,32,33,34,49,38,41,42,51,46,37,50,53,54,43,58,55,62,
%U 35,36,57,44,45,52,59,60,39,40,61,56,47,48,63,64,65,66,97,70,81,74,99,78,73,82,101,86,83,90,103,94,69,98,105,102,85
%N Permutation of nonnegative integers: a(0) = 0; for n >= 1, a(n) = A057889(1+A057889(n-1)), where A057889 is a bijective bit-reverse.
%H Antti Karttunen, <a href="/A302027/b302027.txt">Table of n, a(n) for n = 0..16383</a>
%H David Newman, et al., <a href="http://list.seqfan.eu/oldermail/seqfan/2018-January/018239.html">New sequences from old, Discussion on SeqFan-mailing list</a>, January 2018.
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F a(0) = 0; for n >= 1, a(n) = A057889(1+A057889(n-1)).
%t f[n_] := FromDigits[Reverse[IntegerDigits[n, 2]], 2]*2^IntegerExponent[n, 2]; Fold[Append[#1, f[1 + f[#2 - 1]]] &, {0, 1}, Range[2, 85]] (* _Michael De Vlieger_, Apr 27 2018, after _Ivan Neretin_ at A057889 *)
%o (PARI)
%o A030101(n) = if(n<1,0,subst(Polrev(binary(n)),x,2));
%o A057889(n) = if(!n,n,A030101(n/(2^valuation(n,2))) * (2^valuation(n, 2)));
%o A302027(n) = if(!n,n,A057889(1+A057889(n-1)));
%Y Cf. A302028 (inverse).
%Y Cf. A057889.
%Y Cf. also A268717, A302793.
%K nonn,base,look
%O 0,3
%A _Antti Karttunen_, Apr 26 2018