login
A296065
Partial sums of A296064.
3
0, 2, 3, 0, 5, 0, 7, 0, 9, 0, 11, 0, 13, 0, 15, 0, 17, 0, 19, 0, 21, 0, 23, 0, 25, 0, 27, 0, 29, 0, 31, 0, 33, 0, 35, 0, 37, 0, 39, 0, 41, 0, 43, 0, 45, 0, 47, 0, 49, 0, 51, 0, 53, 0, 55, 0, 57, 0, 59, 0, 61, 0, 63, 0, 65, 0, 67, 0, 69, 0, 71, 0, 73, 0, 75
OFFSET
1,2
COMMENTS
Essentially the same as A193356. - R. J. Mathar, Jan 02 2018
FORMULA
G.f.: x^2*(2 + 3*x - 4*x^2 - x^3 + 2*x^4)/((1 - x)^2*(1 + x)^2). - Andrew Howroyd, Nov 08 2025
MATHEMATICA
Accumulate@ Nest[Append[#, Block[{k = 1, s = 1}, While[Nand[FreeQ[#, s k], IntegerQ@ Mean[Append[#, s k]]], If[s == 1, s = -1, k++; s = 1]]; s k]] &, {0}, 54] (* Michael De Vlieger, Dec 12 2017 *)
LinearRecurrence[{0, 2, 0, -1}, {0, 2, 3, 0, 5, 0}, 60] (* or *) Join[{0, 2}, Riffle[ 2*Range[ 30]+1, 0]] (* Harvey P. Dale, Oct 21 2021 *)
PROG
(PARI) a(n) = if(n==2 || (n > 2 && n%2), n, 0) \\ Andrew Howroyd, Nov 08 2025
CROSSREFS
Cf. A296064.
Sequence in context: A047814 A365276 A101991 * A174900 A344369 A175880
KEYWORD
nonn,easy
AUTHOR
Enrique Navarrete, Dec 04 2017
EXTENSIONS
More terms from Andrew Howroyd, Nov 08 2025
STATUS
approved