login
A297996
a(1)=2, a(2)=3, a(3)=5 and a(n) = (a(1) + a(2) + a(3) + ... + a(n-1))/a(n-1).
1
2, 3, 5, 2, 6, 3, 7, 4, 8, 5, 9, 6, 10, 7, 11, 8, 12, 9, 13, 10, 14, 11, 15, 12, 16, 13, 17, 14, 18, 15, 19, 16, 20, 17, 21, 18, 22, 19, 23, 20, 24, 21, 25, 22, 26, 23, 27, 24, 28, 25, 29, 26, 30, 27, 31, 28, 32, 29, 33, 30, 34, 31, 35, 32, 36, 33, 37, 34, 38, 35
OFFSET
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
Cf. A168230.
Sequence in context: A125766 A093870 A250445 * A239692 A126833 A138512
KEYWORD
nonn,easy,less
AUTHOR
Mateusz Pasternak, Jan 10 2018
EXTENSIONS
More terms from Michel Marcus, Jan 10 2018
STATUS
approved