%I #51 Dec 11 2017 05:09:39
%S 1,3,2,6,-7,-5,0,8,10,12,14,4,-9,-11,-13,-15,17,19,21,23,25,27,29,31,
%T 33,35,37,39,41,43,45,47,16,-18,-20,-22,-24,-26,-28,-30,-32,-34,-36,
%U -38,-40,-42,-44,-46,-48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78
%N 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).
%C For n=1: 1/1 is an integer, and so is -1/1, but preference is given to positive values of a(n).
%C 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.
%C 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
%H Enrique Navarrete, <a href="/A293835/b293835.txt">Table of n, a(n) for n = 1..64</a>
%e For n=7: (1 + 3 + 2 + 6 - 7 - 5 + 0)/7 is an integer.
%t 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]]]];
%t Array[a, 100] (* _Jean-François Alcover_, Dec 09 2017 *)
%Y Cf. A001057, A002251, A019444.
%K sign,easy
%O 1,2
%A _Enrique Navarrete_, Oct 16 2017
|