login
A329681
a(1)=1, a(2)=2; for n > 2, a(n) = max(sum0, sum1) mod n, where sum0 is the sum of all previous even terms, sum1 is the sum of all previous odd terms.
1
1, 2, 2, 0, 4, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 5, 9, 17, 7, 12, 10, 8, 6, 4, 2, 0, 32, 28, 18, 33, 30, 18, 32, 19, 14, 23, 18, 31, 26, 0, 42, 30, 4, 1, 46, 33, 26, 45, 38, 12, 16, 24, 40, 11, 2, 58, 44, 14, 18, 26, 42, 5, 64, 47, 36, 61, 50, 14
OFFSET
1,2
COMMENTS
For n > 34, sum0 > sum1.
For all n > 140, a(n) = 24.
Indices of zeros: 4, 33, 47, 93.
MATHEMATICA
f[s_] := Join[s, {Mod[Max[Total@Select[s, EvenQ], Total@Select[s, OddQ]], Length[s] + 1]}]; Nest[f, {1, 2}, 100] (* Amiram Eldar, Mar 01 2020 *)
CROSSREFS
Cf. A332581.
Sequence in context: A144458 A098268 A330347 * A276275 A128585 A217840
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Feb 29 2020
STATUS
approved