login
a(n) = A002487(1+A006068(n)).
4

%I #30 Jan 12 2020 13:50:18

%S 1,1,1,2,1,3,3,2,1,4,5,3,4,3,2,5,1,5,7,4,7,5,3,8,5,4,3,7,2,7,8,5,1,6,

%T 9,5,10,7,4,11,9,7,5,12,3,11,13,8,6,5,4,9,3,10,11,7,2,9,12,7,11,8,5,

%U 13,1,7,11,6,13,9,5,14,13,10,7,17,4,15,18,11,11,9,7,16,5,17,19,12,3,14,19,11,18,13,8,21,7,6,5,11,4,13,14,9,3,13

%N a(n) = A002487(1+A006068(n)).

%C Like in A324337, a few terms preceding each 2^k-th term (here always 1) seem to consist of a batch of nearby Fibonacci numbers (A000045) in some order. For example, a(65533) = 987, a(65534) = 610 and a(65535) = 1597.

%C For all n > 0 A324338(n)/A324337(n) constitutes an enumeration system of all positive rationals. For all n > 0 A324338(n) + A324337(n) = A071585(n). - _Yosu Yurramendi_, Oct 22 2019

%H Antti Karttunen, <a href="/A324338/b324338.txt">Table of n, a(n) for n = 0..16384</a>

%H Antti Karttunen, <a href="/A324338/a324338.txt">Data supplement: n, a(n) computed for n = 0..65537</a>

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%H <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>

%F a(n) = A002487(1+A006068(n)).

%F a(2^n) = 1 for all n >= 0.

%F From _Yosu Yurramendi_, Oct 22 2019: (Start)

%F a(2^m+2^(m-1)+k) = A324337(2^m+ k), m > 0, 0 <= k < 2^(m-1)

%F a(2^m+ k) = A324337(2^m+2^(m-1)+k), m > 0, 0 <= k < 2^(m-1). (End)

%F a(n) = A324337(A063946(n)), n > 0. _Yosu Yurramendi_, Nov 04 2019

%F a(n) = A002487(A233279(n)), n > 0. _Yosu Yurramendi_, Nov 08 2019

%F From _Yosu Yurramendi_, Nov 28 2019: (Start)

%F a(2^(m+1)+k) - a(2^m+k) = A324337(k), m >= 0, 0 <= k < 2^m.

%F a(A059893(2^(m+1)+A000069(k+1))) - a(A059893(2^m+A000069(k+1))) = A071585(k), m >= 1, 0 <= k < 2^(m-1).

%F a(A059893(2^m+ A001969(k+1))) = A071585(k), m >= 0, 0 <= k < 2^(m-1). (End)

%F From _Yosu Yurramendi_, Nov 29 2019: (Start)

%F For n > 0:

%F A324338(n) + A324337(n) = A071585(n).

%F A324338(2*A001969(n) )-A324337(2*A001969(n) ) = A071585(n-1)

%F A324338(2*A001969(n)+1)-A324337(2*A001969(n)+1) = -A324337(n-1)

%F A324338(2*A000069(n) )-A324337(2*A000069(n) ) = -A071585(n-1)

%F A324338(2*A000069(n)+1)-A324337(2*A000069(n)+1) = A324338(n-1) (End)

%F a(n) = A002487(A233279(n)). _Yosu Yurramendi_, Dec 27 2019

%o (PARI)

%o A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068

%o A002487(n) = { my(s=sign(n), a=1, b=0); n = abs(n); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (s*b); };

%o A324338(n) = A002487(1+A006068(n));

%o (R)

%o maxlevel <- 6 # by choice #

%o b <- 0; A324338 <- 1; A324337 <- 1

%o for(i in 1:2^maxlevel) {

%o b[2*i ] <- b[i]

%o b[2*i+1] <- 1 - b[i]

%o A324338[2*i ] <- A324338[i] + A324337[i]* b[i]

%o A324338[2*i+1] <- A324338[i] + A324337[i]*(1-b[i])

%o A324337[2*i ] <- A324338[i]*(1-b[i]) + A324337[i]

%o A324337[2*i+1] <- A324338[i]* b[i] + A324337[i]}

%o #

%o A324338[1:127]; A324337[1:127]

%o # _Yosu Yurramendi_, Oct 22 2019

%Y Cf. A000045, A002487, A006068, A324288, A324337.

%K nonn

%O 0,4

%A _Antti Karttunen_, Feb 23 2019