OFFSET
0,2
COMMENTS
Sequence A019444 is a similar sequence, but it has an offset of 1 and a(1) =1 instead.
This sequence is a permutation of the positive integers. This can be proved using the theorem-prover Walnut. - Jeffrey Shallit, Aug 12 2023
LINKS
Ivan Neretin, Table of n, a(n) for n = 0..10000
J. Shallit, Proving properties of some greedily-defined integer recurrences via automata theory, arXiv:2308.06544 [cs.DM], August 12 2023.
EXAMPLE
a(5) = 9 because 9 is the smallest positive integer m which does not occur earlier in the sequence and which is such that 5 divides m + Sum_{k=0..4} a(k).
So Sum_{k=0..5} a(k) = 25, which is divisible by 5.
MATHEMATICA
f[l_List] := Block[{k = 1, n = Length[l], s = Plus @@ l}, While[MemberQ[l, k] || Mod[s + k, n] > 0, k++ ]; Append[l, k]]; Nest[f, {1}, 70] (* Ray Chandler, Jan 23 2007 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 11 2007
EXTENSIONS
Extended by Ray Chandler, Jan 23 2007
STATUS
approved