OFFSET
0,4
COMMENTS
For n > 2842, sum0 > sum1.
For all n > 54388, a(n) = 9514.
Indices of zeros: 0, 30, 36, 39, 3552, 8526, 9156, 11143, 12775, 36077, 38141.
LINKS
Robert Israel, Table of n, a(n) for n = 0..54388
EXAMPLE
a(10) = max(2+2+4+2+2, 1+1+3+3) mod 10 = 12 mod 10 = 2.
MAPLE
R:= 0, 1: s0:= 0: s1:= 1:
for n from 2 to 100 do
v:= max(s0, s1) mod n;
R:= R, v;
if v::odd then s1:= s1+v else s0:= s0+v fi
od:
R; # Robert Israel, Feb 16 2024
PROG
(Python)
a = [0, 1]
s0, s1 = 0, 1
for n in range(2, 1000):
v = max(s0, s1) % n
a.append(v)
if (v & 1): s1 += v
else: s0 += v
print(a)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Feb 16 2020
STATUS
approved