OFFSET
1,1
COMMENTS
The terms (n>0) may be written as a left-justified array with rows of length 2^m, m >= 0:
2,
3, 3,
5, 5, 4, 4,
8, 8, 7, 7, 7, 7, 5, 5,
13,13,11,11,12,12, 9, 9,11,11,10,10, 9, 9, 6, 6,
21,21,18,18,19,19,14,14,19,19,17,17,16,16,11,11,18,18,15,15,17,17,13,13,14,14,...
All columns have the Fibonacci sequence property: a(2^(m+2) + k) = a(2^(m+1) + k) + a(2^m + k), m >= 0, 0 <= k < 2^m (empirical observations).
The terms (n>0) may also be written as a right-justified array with rows of length 2^m, m >= 0:
2,
3, 3,
5, 5, 4, 4,
8, 8, 7, 7, 7, 7, 5, 5,
13,13,11,11,12,12, 9, 9,11,11,10,10, 9, 9, 6, 6,
...,19,19,17,17,16,16,11,11,18,18,15,15,17,17,13,13,14,14,13,13,11,11, 7, 7,
Each column is an arithmetic sequence. The differences of the arithmetic sequences repeat the sequence A071585: a(2^(m+2) -1 - 2k) - a(2^(m+1) -1 - 2k) = A071585(k-1), m > 0, 0 <= k < 2^m ; a(2^(m+2) -1 - 2k - 1) - a(2^(m+1) -1 - 2k - 1) = A071585(k-1), m > 0, 0 <= k < 2^m .
n>1 occurs in this sequence phi(n) = A000010(n) times, as it occurs in A007306 (Franklin T. Adams-Watters' comment), that is the sequence obtained by adding numerator and denominator in the Calkin-Wilf enumeration system of positive rationals. A245327(n)/A245328(n) is also an enumeration system of all positive rationals, and in each level m >= 0 (ranks between 2^m and 2^(m+1)-1) rationals are the same in both systems. Thus a(n) has the same terms in each level as A007306.
LINKS
Yosu Yurramendi, Table of n, a(n) for n = 1..4099
FORMULA
PROG
(PARI) b(n) = my(b=binary(n)); fromdigits(concat(b[1], Vecrev(vector(#b-1, k, b[k+1]))), 2); \\ from A059893
a(n) = my(n=b(n), x=1, y=1); for(i=0, logint(n, 2), if(bittest(n, i), [x, y]=[x+y, y], [x, y]=[y, x+y])); x \\ Mikhail Kurkov, Mar 11 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Yosu Yurramendi, May 23 2016
STATUS
approved