A332057 Partial sums (and absolute value of first differences) of A332056: if odd (resp. even) add (resp. subtract) the partial sum to get the next term.
1, 3, 2, 3, 7, 4, 5, 11, 6, 7, 15, 8, 9, 19, 10, 11, 23, 12, 13, 27, 14, 15, 31, 16, 17, 35, 18, 19, 39, 20, 21, 43, 22, 23, 47, 24, 25, 51, 26, 27, 55, 28, 29, 59, 30, 31, 63, 32, 33, 67, 34, 35, 71, 36, 37, 75, 38, 39, 79, 40
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..19683
- Eric Angelini, Re: Add or subtract my cumulative sum of terms, SeqFan list, Feb 24 2020.
- Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
Crossrefs
Cf. A332056.
Programs
-
PARI
apply( {A332057(n)=n<
-
PARI
Vec(x*(1 + x)*(1 + 2*x + x^3) / ((1 - x)^2*(1 + x + x^2)^2) + O(x^60)) \\ Colin Barker, Feb 26 2020
Formula
a(3k-2) = 2k - 1, a(3k-1) = 4k - 1, a(3k) = 2k, for all k >= 1.
From Colin Barker, Feb 25 2020: (Start)
G.f.: x*(1 + x)*(1 + 2*x + x^3) / ((1 - x)^2*(1 + x + x^2)^2).
a(n) = 2*a(n-3) - a(n-6) for n>6.
(End)
Comments