OFFSET
1,3
COMMENTS
A quasilinear solution sequence for Hofstadter V recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-4))).
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,2,0,0,0,0,-1).
FORMULA
For k > 2:
a(5*k-4) = 5*k-7,
a(5*k-3) = 7,
a(5*k-2) = 5*k-6,
a(5*k-1) = 5*k-3,
a(5*k) = 6.
From Colin Barker, Aug 25 2019: (Start)
G.f.: x*(1 + x + 2*x^2 + 3*x^3 + 8*x^4 + 4*x^5 + 2*x^6 + 3*x^8 - 12*x^9 - 3*x^10 + 3*x^12 - 3*x^13 + 6*x^14 + 3*x^15 - 3*x^16 + 2*x^18 - 2*x^19) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2).
a(n) = 2*a(n-5) - a(n-10) for n > 20.
(End)
PROG
(PARI) q=vector(100); q[1]=q[2]=1; q[3]=2; q[4]=3; q[5]=8; q[6]=6; q[7]=q[8]=4; for(n=9, #q, q[n]=q[n-q[n-1]]+q[n-q[n-4]]); q
(PARI) Vec(x*(1 + x + 2*x^2 + 3*x^3 + 8*x^4 + 4*x^5 + 2*x^6 + 3*x^8 - 12*x^9 - 3*x^10 + 3*x^12 - 3*x^13 + 6*x^14 + 3*x^15 - 3*x^16 + 2*x^18 - 2*x^19) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2) + O(x^40)) \\ Colin Barker, Aug 25 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Altug Alkan, Aug 25 2019
STATUS
approved