OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..500
PROG
(Python)
from sympy import divisors
import numpy as np
A243104 = []
for n in range(3, 10**4, 2):
....d = divisors(n)
....s = sum(d)
....if not s % 2 and 2*n <= s:
........d.remove(n)
........s2, ld = int(s/2-n), len(d)
........z = np.zeros((ld+1, s2+1), dtype=int)
........for i in range(1, ld+1):
............y = min(d[i-1], s2+1)
............z[i, range(y)] = z[i-1, range(y)]
............z[i, range(y, s2+1)] = np.maximum(z[i-1, range(y, s2+1)], z[i-1, range(0, s2+1-y)]+y)
............if z[i, s2] == s2:
................d2 = [2*x for x in d if n > 2*x and n % (2*x)] + \
................[x for x in divisors(2*n-1) if n > x >=2 and n % x] + \
................[x for x in divisors(2*n+1) if n > x >=2 and n % x]
................s, dmax = sum(d2), max(d2)
................if not s % 2 and 2*dmax <= s:
....................d2.remove(dmax)
....................s2, ld = int(s/2-dmax), len(d2)
....................z = np.zeros((ld+1, s2+1), dtype=int)
....................for i in range(1, ld+1):
........................y = min(d2[i-1], s2+1)
........................z[i, range(y)] = z[i-1, range(y)]
........................z[i, range(y, s2+1)] = np.maximum(z[i-1, range(y, s2+1)], z[i-1, range(0, s2+1-y)]+y)
........................if z[i, s2] == s2:
............................A243104.append(n)
............................break
................break
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Aug 19 2014
STATUS
approved