OFFSET
1,4
COMMENTS
A well-defined solution sequence for recurrence a(n) = a(n-a(n-3)) + a(n-a(n-4)).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,-1).
FORMULA
For k > 1,
a(13*k-9) = 13*k-8,
a(13*k-8) = 3,
a(13*k-7) = 5,
a(13*k-6) = 6,
a(13*k-5) = 4,
a(13*k-4) = 13*k-3,
a(13*k-3) = 13*k-5,
a(13*k-2) = 9,
a(13*k-1) = 5,
a(13*k) = 2,
a(13*k+1) = 5,
a(13*k+2) = 13*k,
a(13*k+3) = 14.
From Colin Barker, Aug 05 2019: (Start)
G.f.: x*(1 + x + x^2 + 2*x^3 + x^4 + 2*x^5 + 3*x^6 + 5*x^7 + 8*x^8 + 8*x^9 + 7*x^10 + 5*x^11 + 2*x^12 + 3*x^13 + 11*x^14 + 10*x^15 + 14*x^16 + x^17 + x^18 - 6*x^20 + 7*x^21 + 5*x^22 - 5*x^23 - 5*x^24 - 2*x^25 - 4*x^26 + x^27 - 9*x^28 - 3*x^29 - 2*x^30 - 3*x^31 - 3*x^32 + x^33 - 2*x^34 - 2*x^36 - 2*x^41) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12)^2).
a(n) = 2*a(n-13) - a(n-26) for n > 42.
(End)
MAPLE
for n from 1 to 5 do a[n]:= `if`(n=4, 2, 1) od:
for n from 6 to 100 do a[n]:= a[n-a[n-3]] + a[n-a[n-4]] od:
seq(a[n], n=1..100); # Robert Israel, Aug 07 2019
MATHEMATICA
a[1]=a[2]=a[3]=a[5]=1; a[4]=2; a[n_] := a[n] = a[n - a[n-3]] + a[n - a[n-4]]; Array[a, 93] (* Giovanni Resta, Aug 07 2019 *)
PROG
(PARI) q=vector(100); q[1]=q[2]=q[3]=q[5]=1; q[4]=2; for(n=6, #q, q[n]=q[n-q[n-3]]+q[n-q[n-4]]); q
(PARI) Vec(x*(1 + x + x^2 + 2*x^3 + x^4 + 2*x^5 + 3*x^6 + 5*x^7 + 8*x^8 + 8*x^9 + 7*x^10 + 5*x^11 + 2*x^12 + 3*x^13 + 11*x^14 + 10*x^15 + 14*x^16 + x^17 + x^18 - 6*x^20 + 7*x^21 + 5*x^22 - 5*x^23 - 5*x^24 - 2*x^25 - 4*x^26 + x^27 - 9*x^28 - 3*x^29 - 2*x^30 - 3*x^31 - 3*x^32 + x^33 - 2*x^34 - 2*x^36 - 2*x^41) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^10 + x^11 + x^12)^2) + O(x^80)) \\ Colin Barker, Aug 08 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Aug 04 2019
STATUS
approved