OFFSET
1,3
PROG
(Python)
from itertools import count, islice
from sympy import divisors
def A368341_gen(startvalue=0): # generator of terms >= startvalue
for n in count(max(startvalue, 0)):
c = 0
for d2 in divisors(n):
if d2**2 > n:
break
c += (d2<<2)-2 if d2**2<n else (d2<<1)-1
if c>n:
break
if c<=n:
for wx in range(1, (n>>1)+1):
for d1 in divisors(wx):
if d1**2 > wx:
break
for d2 in divisors(m:=n-wx):
if d2**2 > m:
break
if wx < d1*d2:
k = 1
if d1**2 != wx:
k <<=1
if d2**2 != m:
k <<=1
c+=k
if c>n:
break
if c==n:
yield n
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Chai Wah Wu, Dec 21 2023
EXTENSIONS
a(17)-a(19) from Chai Wah Wu, Dec 22 2023
STATUS
approved