cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A296065 Partial sums of A296064.

Original entry on oeis.org

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
Offset: 1

Views

Author

Enrique Navarrete, Dec 04 2017

Keywords

Comments

Essentially the same as A193356. - R. J. Mathar, Jan 02 2018

Crossrefs

Cf. A296064.

Programs

  • 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 *)

A296069 a(1)=0; thereafter a(n) is the smallest number (in absolute value) not yet in the sequence such that the arithmetic mean of the first n terms a(1), a(2), ..., a(n) is a nonzero integer. Preference is given to positive values of a(n).

Original entry on oeis.org

0, 2, 1, 5, -3, 7, -5, 9, -7, 11, -9, 13, -11, 15, -13, 17, -15, 19, -17, 21, -19, 23, -21, 25, -23, 27, -25, 29, -27, 31, -29, 33, -31, 35, -33, 37, -35, 39, -37, 41, -39, 43, -41, 45, -43, 47, -45, 49, -47, 51, -49, 53, -51
Offset: 1

Views

Author

Enrique Navarrete, Dec 04 2017

Keywords

Crossrefs

Cf. A296063, A296064, A296070 (partial sums).

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 1, s = 1}, While[Nand[FreeQ[#, s k], And[IntegerQ@ Mean@ #, Total@ # != 0] &@ Append[#, s k]], If[s == 1, s = -1, k++; s = 1]]; s k]] &, {0}, 52] (* Michael De Vlieger, Dec 12 2017 *)
  • PARI
    concat(0, Vec(x^2*(2 + 3*x + 4*x^2 - x^3 - 2*x^4) / ((1 - x)*(1 + x)^2) + O(x^65))) \\ Colin Barker, Mar 14 2020

Formula

From Colin Barker, Mar 14 2020: (Start)
G.f.: x^2*(2 + 3*x + 4*x^2 - x^3 - 2*x^4) / ((1 - x)*(1 + x)^2).
a(n) = -a(n-1) + a(n-2) + a(n-3) for n>6.
(End)
Showing 1-2 of 2 results.