|
|
A332581
|
|
a(0)=0, a(1)=1; for n>1, 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.
|
|
4
|
|
|
0, 1, 1, 2, 2, 4, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 5, 9, 17, 9, 16, 14, 12, 10, 16, 0, 28, 22, 8, 12, 20, 0, 32, 22, 0, 34, 22, 38, 27, 20, 33, 26, 45, 38, 20, 32, 5, 48, 35, 26, 43, 34, 2, 52, 36, 2, 54, 36, 61, 50, 24, 36, 60, 40, 67, 54, 24, 34, 54, 20, 25, 10, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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:
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|