login
A309636
a(1) = 3, a(2) = 1, a(3) = 4, a(4) = 2, a(5) = 5; a(6) = 3; a(n) = a(n-a(n-1)) + a(n-a(n-4)) for n > 6.
3
3, 1, 4, 2, 5, 3, 6, 4, 7, 10, 8, 6, 9, 7, 10, 13, 6, 14, 12, 10, 18, 6, 14, 17, 10, 23, 11, 14, 22, 10, 28, 16, 14, 27, 10, 33, 16, 14, 32, 10, 38, 16, 19, 37, 10, 43, 16, 24, 42, 10, 48, 16, 24, 47, 10, 53, 16, 24, 52, 10, 58, 16, 24, 57, 10, 63, 21, 24, 62, 10, 68, 26, 24, 67, 10
OFFSET
1,1
COMMENTS
A well-defined quasi-periodic solution for Hofstadter V recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-4))).
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) = 10,
a(5*k+1) = 5*k-2,
a(5*k+2) = 5*(floor((sqrt(2*k-1)-1)/2) + floor((sqrt(2*k-3)-1)/2)) + 6,
a(5*k+3) = 5*(floor(sqrt(k/2)) + floor(sqrt((k-1)/2))) + 4,
a(5*k+4) = 5*k-3.
Also, a(5*k+2) = 5*f(k)+1 and a(5*k+3) = 5*g(k)-1 where f(k) = g(k-g(k-1)) and g(k) = f(k-f(k))+2 with f(1) = g(1) = 1, g(2) = 2.
MATHEMATICA
Nest[Append[#, #[[-#[[-1]] ]] + #[[-#[[-4]] ]]] &, {3, 1, 4, 2, 5, 3}, 69] (* Michael De Vlieger, May 08 2020 *)
PROG
(PARI) q=vector(100); q[1]=3; q[2]=1; q[3]=4; q[4]=2; q[5]=5; q[6]=3; for(n=7, #q, q[n] = q[n-q[n-1]] + q[n-q[n-4]]); q
(Magma) I:=[3, 1, 4, 2, 5, 3]; [n le 6 select I[n] else Self(n-Self(n-1)) + Self(n-Self(n-4)): n in [1..80]]; // Marius A. Burtea, Aug 11 2019
KEYWORD
nonn,easy
AUTHOR
Altug Alkan and Nathan Fox, Aug 10 2019
STATUS
approved