OFFSET
0,2
LINKS
T. D. Noe, Table of n, a(n) for n = 0..1023
FORMULA
a(2^k + 2^j + m) = 2(k-j)*a(2^j + m) + a(m) when 2^k > 2^j > m >=0. a(0) = 1, a(2^k) = 2(k+1), a(2^k + 1) = 4*k + 1 (k>0), a(2^k - 1) = the (k+1)-th Pell number.
EXAMPLE
n: a(n)/A072727 has continued fraction:
0: 1/0 = [infinity]
1: 2/1 = [2]
2: 4/1 = [4]
3: 5/2 = [2;2]
4: 6/1 = [6]
5: 9/2 = [4;2]
6: 9/4 = [2;4]
7: 12/5 = [2;2,2]
8: 8/1 = [8]
9: 13/2 = [6;2]
10: 17/4 = [4;4]
11: 22/5 = [4;2,2]
12: 13/6 = [2;6]
13: 20/9 = [2;4,2]
14: 22/9 = [2;2,4]
15: 29/12= [2;2,2,2]
MATHEMATICA
a[0] = 1; a[n_] := a[n] = Which[IntegerQ[k = Log[2, n]], 2 (k + 1), IntegerQ[k = Log[2, n - 1]], 4 k + 1, IntegerQ[k = Log[2, n + 1]], Fibonacci[k + 1, 2], True, Clear[k]; Hold[2*(k - j)*a[2^j + m] + a[m]] /. ToRules[Reduce[2^k > 2^j > m >= 0 && n == 2^k + 2^j + m, {k, j, m}, Integers]] // ReleaseHold];
Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 63}] (* Jean-François Alcover, Jul 13 2016 *)
CROSSREFS
KEYWORD
easy,frac,nice,nonn
AUTHOR
Paul D. Hanna, Jul 09 2002
STATUS
approved