OFFSET
1,1
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = A168230(n+1) for n >= 3.
From Colin Barker, Jan 29 2018: (Start)
G.f.: x*(2 + x - 4*x^3 + 2*x^4) / ((1 - x)^2*(1 + x)).
a(n) = n/2 for n>2 and even.
a(n) = (n+7)/2 for n>2 and odd.
a(n) = a(n-1) + a(n-2) - a(n-3) for n>5.
(End)
MATHEMATICA
Nest[Append[#, Total[#]/Last[#]] &, Prime@ Range@ 3, 67] (* Michael De Vlieger, Jan 10 2018 *)
LinearRecurrence[{1, 1, -1}, {2, 3, 5, 2, 6}, 70] (* Harvey P. Dale, Dec 31 2021 *)
PROG
(PARI) lista(nn) = {va = vector(nn); for (n=1, 3, va[n] = prime(n)); for (n=4, nn, va[n] = sum(k=1, n-1, va[k])/va[n-1]; ); va; } \\ Michel Marcus, Jan 10 2018
(PARI) Vec(x*(2 + x - 4*x^3 + 2*x^4) / ((1 - x)^2*(1 + x)) + O(x^100)) \\ Colin Barker, Jan 29 2018
CROSSREFS
KEYWORD
nonn,easy,less
AUTHOR
Mateusz Pasternak, Jan 10 2018
EXTENSIONS
More terms from Michel Marcus, Jan 10 2018
STATUS
approved