login
A309650
a(1) = 3, a(2) = 1, a(3) = 4, a(4) = 2; a(n) = a(n-a(n-2)) + a(n-a(n-3)) for n > 4.
1
3, 1, 4, 2, 5, 3, 6, 9, 7, 5, 3, 11, 14, 7, 5, 8, 16, 19, 7, 5, 8, 21, 24, 12, 5, 8, 26, 29, 12, 5, 8, 31, 34, 12, 5, 13, 36, 39, 12, 5, 13, 41, 44, 12, 5, 13, 46, 49, 17, 5, 13, 51, 54, 17, 5, 13, 56, 59, 17, 5, 13, 61, 64, 17, 5, 18, 66, 69, 17, 5, 18, 71, 74, 17, 5, 18, 76, 79, 17, 5, 18, 81, 84, 22, 5
OFFSET
1,1
COMMENTS
A well-defined quasi-periodic solution for recurrence (a(n) = a(n-a(n-2)) + a(n-a(n-3))).
LINKS
Altug Alkan, Nathan Fox, Orhan Ozgur Aybar, Zehra Akdeniz, On Some Solutions to Hofstadter's V-Recurrence, arXiv:2002.03396 [math.DS], 2020.
FORMULA
For k >= 1:
a(5*k) = 5,
a(5*k+1) = 5*floor(sqrt(k)+1/2)-2,
a(5*k+2) = 5*k+1,
a(5*k+3) = 5*k+4,
a(5*k+4) = 5*floor(sqrt(k))+2.
MATHEMATICA
Nest[Append[#, #[[-#[[-2]] ]] + #[[-#[[-3]] ]]] &, {3, 1, 4, 2}, 81] (* Michael De Vlieger, May 08 2020 *)
PROG
(PARI) q=vector(100); q[1]=3; q[2]=1; q[3]=4; q[4]=2; for(n=5, #q, q[n] = q[n-q[n-2]] + q[n-q[n-3]]); q
(Magma) I:=[3, 1, 4, 2]; [n le 4 select I[n] else Self(n-Self(n-2)) + Self(n-Self(n-3)): n in [1..90]]; // Marius A. Burtea, Aug 11 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan and Nathan Fox, Aug 11 2019
STATUS
approved