OFFSET
1,2
COMMENTS
A179529(a(n)) = 0. [Reinhard Zumkeller, Jul 19 2010]
LINKS
Reinhard Zumkeller, Illustration of initial terms
PROG
(Python)
from itertools import count, islice
from sympy import divisors
def A083210_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue, 1)):
d = divisors(n)
s = sum(d)
if s&1^1 and n<<1<=s:
d = d[:-1]
s2, ld = (s>>1)-n, len(d)
z = [[0 for _ in range(s2+1)] for _ in range(ld+1)]
for i in range(1, ld+1):
y = min(d[i-1], s2+1)
z[i][:y] = z[i-1][:y]
for j in range(y, s2+1):
z[i][j] = max(z[i-1][j], z[i-1][j-y]+y)
if z[i][s2] == s2:
break
else:
yield n
else:
yield n
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Apr 22 2003
STATUS
approved