login

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”).

A284007
a(n) = a(a(n-A002487(n))) + a(n-a(n-A002487(n))) with a(1) = a(2) = 1, where A002487 = Stern-Brocot sequence.
5
1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 10, 11, 11, 11, 12, 12, 14, 13, 14, 14, 15, 16, 15, 16, 16, 18, 18, 18, 19, 19, 20, 20, 22, 22, 24, 23, 25, 24, 25, 25, 25, 26, 26, 27, 27, 28, 29, 28, 30, 29, 30, 31, 30, 32, 34, 34, 33, 33, 34, 34, 36, 37, 36, 37, 38, 38, 40, 41, 39, 40, 43, 42, 44, 43, 43, 44, 44, 45, 45, 45, 50
OFFSET
1,3
LINKS
FORMULA
a(1) = a(2) = 1, for n > 2, a(n) = a(a(A284013(n))) + a(n-a(A284013(n))).
PROG
(Scheme, with memoization-macro definec)
(definec (A284007 n) (if (<= n 2) 1 (+ (A284007 (A284007 (- n (A002487 n)))) (A284007 (- n (A284007 (- n (A002487 n)))))))) ;; Code for A002487 given under that entry.
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 23 2017
STATUS
approved