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

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

%I #7 Mar 23 2017 20:32:34

%S 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,

%T 16,15,16,16,18,18,18,19,19,20,20,22,22,24,23,25,24,25,25,25,26,26,27,

%U 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

%N a(n) = a(a(n-A002487(n))) + a(n-a(n-A002487(n))) with a(1) = a(2) = 1, where A002487 = Stern-Brocot sequence.

%H Antti Karttunen, <a href="/A284007/b284007.txt">Table of n, a(n) for n = 1..16384</a>

%F a(1) = a(2) = 1, for n > 2, a(n) = a(a(A284013(n))) + a(n-a(A284013(n))).

%o (Scheme, with memoization-macro definec)

%o (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.

%Y Cf. A002487, A004001, A283474, A284000, A284007, A284013.

%K nonn

%O 1,3

%A _Antti Karttunen_, Mar 23 2017