Original entry on oeis.org
945, 1575, 2205, 2835, 3465, 4095, 4725, 6435, 6615, 6825, 7245, 7425, 7875, 8085, 8505, 8925, 9135, 9555, 9765, 10395, 11655, 12285, 12915, 13545, 14805, 15015, 16065, 16695, 17955, 18585, 19215, 19635, 19845, 20475, 21105, 21735, 22275, 22365, 22995, 23205
Offset: 1
-
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
A192273
Zumkeller numbers using anti-divisors (or anti-Zumkeller numbers).
Original entry on oeis.org
7, 10, 17, 22, 23, 31, 32, 33, 35, 37, 38, 39, 42, 45, 49, 50, 52, 53, 55, 58, 63, 67, 68, 70, 72, 73, 77, 78, 82, 83, 87, 88, 93, 94, 95, 98, 103, 105, 115, 116, 117, 123, 126, 127, 128, 130, 137, 142, 143, 148, 149, 157, 158, 160, 162, 163, 165, 171, 175
Offset: 1
7 -> anti-divisors: 2,3,5; sigma*(7)/2 = 5; 2+3 = 5.
77-> anti-divisors: 2,3,5,9,14,17,22,31,51; sigma*(77)/2=77; 2+3+5+14+22+31=9+17+51=77.
143->anti-divisors: 2,3,5,7,15,19,22,26,41,57,95; sigma*(143)/2=146; 2+5+15+19+22+26+57=3+7+41+95=146.
-
with(combstruct);
P:=proc(i)
local S,R,Stop,Comb,a,b,c,d,k,m,n,s;
for n from 3 to i do
a:={};
for k from 2 to n-1 do if abs((n mod k)- k/2) < 1 then a:=a union {k}; fi; od;
b:=nops(a); c:=op(a); s:=0;
if b>1 then for k from 1 to b do s:=s+c[k]; od;
else s:=c;
fi;
if (modp(s,2)=0 and 2*n<=s) then
S:=1/2*s-n; R:=select(m->m<=S,[c]); Stop:=false; Comb:=iterstructs(Combination(R));
while not (finished(Comb) or Stop) do Stop:=add(d,d=nextstruct(Comb))=S; od;
if Stop then print(n); fi;
fi;
od;
end:
P(3000);
-
from sympy import divisors
from sympy.combinatorics.subsets import Subset
def antidivisors(n):
return [2*d for d in divisors(n) if n > 2*d and n % (2*d)] + \
[d for d in divisors(2*n-1) if n > d >=2 and n % d] + \
[d for d in divisors(2*n+1) if n > d >=2 and n % d]
for n in range(3,10**3):
d = antidivisors(n)
s = sum(d)
if not s % 2 and max(d) <= s//2:
for x in range(1,2**len(d)):
if sum(Subset.unrank_binary(x,d).subset) == s//2:
print(n,end=', ')
break
# Chai Wah Wu, Aug 13 2014
-
from sympy import divisors
import numpy as np
A192273 = []
for n in range(3,10**3):
d = [2*x for x in divisors(n) 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(d), max(d)
if not s % 2 and 2*dmax <= s:
d.remove(dmax)
s2, ld = int(s/2-dmax), 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:
A192273.append(n)
break
# Chai Wah Wu, Aug 19 2014
Showing 1-2 of 2 results.
Comments