OFFSET
1,5
COMMENTS
A quasi-periodic solution to the recurrence a(n) = a(a(n-3)) + a(n-a(n-2)).
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
From Colin Barker, Jun 20 2018: (Start)
G.f.: x*(1 + x + x^2 - x^3 + 3*x^5 + 2*x^6 - x^7 - 2*x^8 - 2*x^9 + x^11) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n>10.
(End)
EXAMPLE
a(3*k-2) = 3, a(3*k-1) = 2, a(3*k) = 3*k - 2 for k > 2.
MATHEMATICA
LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 1, 1, 1, 2, 5, 3, 2, 7, 3, 2, 10}, 100] (* Harvey P. Dale, Apr 20 2022 *)
PROG
(PARI) a=vector(99); a[1]=a[2]=a[3]=a[4]=1; a[5]=2; a[6]=5; for(n=7, #a, a[n] = a[a[n-3]]+a[n-a[n-2]]); a
(PARI) Vec(x*(1 + x + x^2 - x^3 + 3*x^5 + 2*x^6 - x^7 - 2*x^8 - 2*x^9 + x^11) / ((1 - x)^2*(1 + x + x^2)^2) + O(x^80)) \\ Colin Barker, Jun 20 2018
(GAP) a:=[1, 1, 1, 1, 2, 5];; for n in [7..100] do a[n]:=a[a[n-3]]+a[n-a[n-2]]; od; a; # Muniru A Asiru, Jun 26 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Jun 20 2018
STATUS
approved