OFFSET
1,3
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,0,-1,1,0,1,-1,0,1,-1).
FORMULA
a(6*k-3) = 8, a(6*k-2) = 6, a(6*k-1) = 10, a(6*k) = 6*k - 4, a(6*k+1) = 6*k, a(6*k + 2) = 6*k - 2 for k > 2.
From Colin Barker, Jun 20 2018: (Start)
G.f.: x*(1 + x^2 + 5*x^3 - 5*x^4 + 2*x^5 + 4*x^6 - 4*x^7 + 4*x^8 - 6*x^9 + 4*x^10 + 6*x^11 - 3*x^12 - 3*x^14 + 3*x^15 + 3*x^16 - 6*x^17 + 6*x^19 - 6*x^20) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)).
a(n) = a(n-1) - a(n-3) + a(n-4) + a(n-6) - a(n-7) + a(n-9) - a(n-10) for n>13.
(End)
PROG
(PARI) a=vector(99); a[1]=1; a[2]=1; a[3]=2; a[4]=6; a[5]=1; a[6]=2; for(n=7, #a, a[n] = a[a[n-1]]+a[n-a[n-2]]); a
(PARI) Vec(x*(1 + x^2 + 5*x^3 - 5*x^4 + 2*x^5 + 4*x^6 - 4*x^7 + 4*x^8 - 6*x^9 + 4*x^10 + 6*x^11 - 3*x^12 - 3*x^14 + 3*x^15 + 3*x^16 - 6*x^17 + 6*x^19 - 6*x^20) / ((1 - x)^2*(1 + x)^2*(1 - x + x^2)^2*(1 + x + x^2)) + O(x^80)) \\ Colin Barker, Jun 20 2018
(GAP) a:=[1, 1, 2, 6, 1, 2];; for n in [7..100] do a[n]:=a[a[n-1]]+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