login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A296064 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 an integer. Preference is given to positive values of a(n). 3
0, 2, 1, -3, 5, -5, 7, -7, 9, -9, 11, -11, 13, -13, 15, -15, 17, -17, 19, -19, 21, -21, 23, -23, 25, -25, 27, -27, 29, -29, 31, -31, 33, -33, 35, -35, 37, -37, 39, -39, 41, -41, 43, -43, 45, -45, 47, -47, 49, -49, 51, -51 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
From Robert Israel, Dec 26 2017: (Start)
a(n) = a(n-3)+a(n-2)-a(n-1) for n >= 7.
G.f.: (2+3*x-4*x^2-x^3+2*x^4)*x^2/((x-1)*(x+1)^2). (End)
MAPLE
0, 2, 1, -3, seq(seq(s*i, s=[1, -1]), i=5..100, 2); # Robert Israel, Dec 26 2017
MATHEMATICA
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}, 51] (* Michael De Vlieger, Dec 12 2017 *)
CROSSREFS
Cf. A296065 (partial sums), A127630.
Essentially the same as A296063.
Sequence in context: A306977 A137655 A355621 * A167595 A328600 A179382
KEYWORD
sign,easy
AUTHOR
Enrique Navarrete, Dec 04 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)