%I #17 Jun 10 2020 08:18:14
%S 0,0,0,1,0,2,1,1,0,3,2,2,1,2,1,2,0,4,3,3,2,3,2,4,1,3,2,3,1,3,2,2,0,5,
%T 4,4,3,4,3,6,2,4,3,5,2,5,4,4,1,4,3,4,2,4,3,4,1,4,3,3,2,3,2,2,0,6,5,5,
%U 4,5,4,8,3,5,4,7,3,7,6,6,2,5,4,6,3,6,5,6,2,6,5,5,4,5,4,4,1,5,4,5,3,5,4,6,2,5
%N a(n) = A329697(A163511(n)).
%C As the underlying sequence A163511 can be represented as a binary tree, so can be this:
%C 0
%C |
%C ...................0...................
%C 0 1
%C 0......../ \........2 1......../ \........1
%C / \ / \ / \ / \
%C / \ / \ / \ / \
%C / \ / \ / \ / \
%C 0 3 2 2 1 2 1 2
%C 0 4 3 3 2 3 2 4 1 3 2 3 1 3 2 2
%C etc.
%C The nodes at the left edge are all zeros, and their right-hand children give positive integers, A000027.
%C Each left-hand leaning branch stays constant, because A329697(2n) = A329697(n).
%C The right-hand leaning branches are not necessarily monotonic. For example, a((2^6)-1) = 2 > 1 = a((2^7)-1), because A000040(7) = 17 is a Fermat prime (but A000040(6) = 13 is not), and therefore the latter is only one step away from a power of 2.
%H Antti Karttunen, <a href="/A334204/b334204.txt">Table of n, a(n) for n = 0..65537</a>
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F a(n) = A329697(A163511(n)).
%F a(n) = A334109(A334860(n)).
%F a(n) = a(2n) = a(A000265(n)).
%F For all n >= 0, a(2^n) = 0, a(2^n + 1) = n.
%o (PARI)
%o A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
%o A054429(n) = ((3<<#binary(n\2))-n-1); \\ From A054429
%o A163511(n) = if(!n,1,A005940(1+A054429(n)));
%o A329697(n) = if(!bitand(n,n-1),0,1+A329697(n-(n/vecmax(factor(n)[, 1]))));
%o A334204(n) = A329697(A163511(n));
%Y Cf. A000079, A163511, A329697, A334109, A334860, A334867, A334873.
%K nonn
%O 0,6
%A _Antti Karttunen_, Jun 09 2020
|