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
Enrique Navarrete, Table of n, a(n) for n = 1..64
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
KEYWORD
sign,easy
AUTHOR
Enrique Navarrete, Oct 16 2017
STATUS
approved