|
|
A289205
|
|
a(1) = a(2) = a(3) = 1, a(4) = 3; a(n) = n - a(n-a(n-1)) - a(n-a(n-2)) for n > 4.
|
|
2
|
|
|
1, 1, 1, 3, 1, 4, 2, 1, 6, 1, 9, 2, 1, 11, 1, 14, 2, 1, 16, 1, 19, 2, 1, 21, 1, 24, 2, 1, 26, 1, 29, 2, 1, 31, 1, 34, 2, 1, 36, 1, 39, 2, 1, 41, 1, 44, 2, 1, 46, 1, 49, 2, 1, 51, 1, 54, 2, 1, 56, 1, 59, 2, 1, 61, 1, 64, 2, 1, 66, 1, 69, 2, 1, 71, 1, 74, 2, 1, 76, 1, 79, 2, 1, 81, 1, 84, 2, 1, 86, 1, 89, 2, 1, 91, 1, 94, 2, 1, 96, 1, 99, 2, 1, 101
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,2,0,0,0,0,-1).
|
|
FORMULA
|
a(5k) = a(5k + 3) = 1, a(5k + 1) = 5k - 1, a(5k + 2) = 2, a(5k + 4) = 5k + 1 for k > 0.
G.f.: x*(1 + x)*(1 + x^2 + 2*x^3 - x^4 + 3*x^5 - 3*x^6 + 2*x^7 - 2*x^8 + x^9 + x^10 - 2*x^11 + 2*x^12) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2).
a(n) = 2*a(n-5) - a(n-10) for n>12.
(End)
|
|
MATHEMATICA
|
LinearRecurrence[{0, 0, 0, 0, 2, 0, 0, 0, 0, -1}, {1, 1, 1, 3, 1, 4, 2, 1, 6, 1, 9, 2, 1, 11}, 120] (* Harvey P. Dale, Aug 20 2017 *)
|
|
PROG
|
(PARI) q=vector(10^5); q[1]=q[2]=q[3]=1; q[4]=3; for(n=5, #q, q[n] = n-q[n-q[n-1]]-q[n-q[n-2]]); q
(PARI) Vec(x*(1 + x)*(1 + x^2 + 2*x^3 - x^4 + 3*x^5 - 3*x^6 + 2*x^7 - 2*x^8 + x^9 + x^10 - 2*x^11 + 2*x^12) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)^2) + O(x^100)) \\ Colin Barker, Jun 28 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|