login
a(n) = a(a(n-1)) + a(n-a(n-2)) with a(1) = a(2) = a(3) = 1.
1

%I #37 Feb 20 2019 21:09:51

%S 1,1,1,2,3,3,3,4,5,6,6,6,6,7,8,9,10,11,11,11,12,12,12,12,12,13,14,15,

%T 16,17,18,19,19,19,20,21,22,22,22,23,23,23,23,24,24,24,24,24,24,25,26,

%U 27,28,29,30,31,32,33,33,33,34,35,36,37,38,38,38,39,40,41,41,41,42,42,42,42,43,44,45,45,45,46,46,46,46

%N a(n) = a(a(n-1)) + a(n-a(n-2)) with a(1) = a(2) = a(3) = 1.

%C A variation of the Hofstadter-Conway $10,000 sequence (A004001). See antisymmetric humps (between its generational boundaries) of a(n) - n/2 in Links section. More precisely, the k-th generation of this sequence begins at 3*2^(k-3) + 2 for k > 2. Similar sequences can be created by generalized recurrence a_i(n) = a_i(a_i(n-1)) + a_i(n-a_i(n-i)) with i + 1 initial conditions a_i(1) = a_i(2) = ... = a_i(i+1) = 1. See also an illustration about this sequence family for i <= 10 in Links section.

%H Altug Alkan, <a href="/A296816/b296816.txt">Table of n, a(n) for n = 1..10000</a>

%H Altug Alkan, <a href="/A296816/a296816.png">Scatterplots of a(n)-n/2 and A004001(n)-n/2 for n <= 10^5</a>

%H Altug Alkan, <a href="/A296816/a296816_1.png">Scatterplots of a_i(n)-n/2 for i <= 10 and n <= 10^5</a>

%H Altug Alkan, <a href="https://doi.org/10.1515/math-2018-0124">On a conjecture about generalized Q-recurrence</a>, Open Mathematics (2018) Vol. 16, Issue 1, 1490-1500.

%t Fold[Append[#1, #1[[#1[[#2 - 1]] ]] + #1[[#2 - #1[[#2 - 2]] ]] ] &, {1, 1, 1}, Range[4, 85]] (* _Michael De Vlieger_, Dec 22 2017 *)

%o (PARI) a=vector(10^5); a[1]=a[2]=a[3]=1; for(n=4, #a, a[n] = a[a[n-1]]+a[n-a[n-2]]); a

%Y Cf. A004001, A005229.

%K nonn,easy

%O 1,4

%A _Altug Alkan_, Dec 21 2017