The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A293835 a(n) = 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; a(1)=1. No two numbers with the same absolute value may appear. Preference is given to positive values of a(n). 2
1, 3, 2, 6, -7, -5, 0, 8, 10, 12, 14, 4, -9, -11, -13, -15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 16, -18, -20, -22, -24, -26, -28, -30, -32, -34, -36, -38, -40, -42, -44, -46, -48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
For n=1: 1/1 is an integer, and so is -1/1, but preference is given to positive values of a(n).
Fixed points so far: 1,8,17,50; i.e., aside from 1, these fixed points occur when sequence changes from 0 to positive or from negative to positive.
One could check the integers in order of appearance in A001057 to see if they are the next term. - David A. Corneth, Nov 13 2017
LINKS
EXAMPLE
For n=7: (1 + 3 + 2 + 6 - 7 - 5 + 0)/7 is an integer.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = For[k = 0, True, k++, aa = Array[a, n - 1]; If[FreeQ[aa, k | -k], If[IntegerQ[Mean[Append[aa, k]]], Return[k]]; If[IntegerQ[Mean[Append[aa, -k]]], Return[-k]]]];
Array[a, 100] (* Jean-François Alcover, Dec 09 2017 *)
CROSSREFS
Sequence in context: A182869 A335409 A236341 * A258145 A175930 A369272
KEYWORD
sign,easy
AUTHOR
Enrique Navarrete, Oct 16 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 May 13 09:49 EDT 2024. Contains 372504 sequences. (Running on oeis4.)