login
A309967
a(1) = a(2) = 1, a(3) = 2, a(4) = 3, a(5) = 8, a(6) = 6, a(7) = a(8) = 4; a(n) = a(n-a(n-1)) + a(n-a(n-4)) for n > 8.
1
1, 1, 2, 3, 8, 6, 4, 4, 9, 4, 8, 7, 9, 12, 6, 13, 7, 14, 17, 6, 18, 7, 19, 22, 6, 23, 7, 24, 27, 6, 28, 7, 29, 32, 6, 33, 7, 34, 37, 6, 38, 7, 39, 42, 6, 43, 7, 44, 47, 6, 48, 7, 49, 52, 6, 53, 7, 54, 57, 6, 58, 7, 59, 62, 6, 63, 7, 64, 67, 6, 68, 7, 69, 72, 6, 73, 7, 74, 77, 6, 78, 7
OFFSET
1,3
COMMENTS
A quasilinear solution sequence for Hofstadter V recurrence (a(n) = a(n-a(n-1)) + a(n-a(n-4))).
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