login
a(n) = A005185(n+1-A005185(n)).
4

%I #13 Mar 23 2017 11:43:37

%S 1,1,1,1,2,2,2,3,3,3,4,3,4,5,4,5,5,5,6,6,6,6,8,6,8,8,8,8,8,10,8,9,10,

%T 10,10,11,11,10,11,11,11,12,12,12,12,12,16,10,14,14,12,14,16,14,14,16,

%U 14,16,16,16,16,20,16,17,21,16,17,19,20,20,21,21,20,19,19,22,19,21,21,22,22,22,23,21,23,23,23,23,24,24,24,24,24,24,32,17,32

%N a(n) = A005185(n+1-A005185(n)).

%C For n >= 2, a(n) gives the left hand summand for the term q(n+1) of Hofstadter Q-sequence (A005185): q(1) = q(2) = 1; q(n) = q(n-q(n-1)) + q(n-q(n-2)) for n > 2.

%H Antti Karttunen, <a href="/A283467/b283467.txt">Table of n, a(n) for n = 1..10001</a>

%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>

%F a(n) = A005185(n + 1 - A005185(n)).

%t a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - a[n - 2]]; Table[a[n + 1 - a[n]], {n, 97}] (* _Michael De Vlieger_, Mar 22 2017 *)

%o (Scheme) (define (A283467 n) (A005185 (- (+ n 1) (A005185 n)))) ;; Code for A005185 given under that entry.

%o (PARI) q(n) = if(n<3, 1, q(n - q(n - 1)) + q(n - q(n - 2)));

%o a(n) = q(n + 1 - q(n)); \\ _Indranil Ghosh_, Mar 22 2017

%Y Cf. A005185, A280706 (partial sums), A284173.

%K nonn

%O 1,5

%A _Antti Karttunen_, Mar 22 2017