Chai Wah Wu, <a href="/A361015/b361015_1.txt">Table of n, a(n) for n = 2..10000</a>
Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
Chai Wah Wu, <a href="/A361015/b361015_1.txt">Table of n, a(n) for n = 2..10000</a>
reviewed
approved
proposed
reviewed
editing
proposed
from sympy import divisors, divisor_count
c, s = -divisor_countlen(nds)<<1, [-d for d in ds[::-1]]+ds
proposed
editing
editing
proposed
Chai Wah Wu, <a href="/A361015/b361015_1.txt">Table of n, a(n) for n = 2..10000</a>
return c # Chai Wah Wu, May 11 2023
(Python)
from sympy import divisors, divisor_count
def A361015(n):
ds = divisors(n)
c, s = -divisor_count(n)<<1, [-d for d in ds[::-1]]+ds
for x in s:
d2 = [d//x for d in ds if d%x==0]
for y in (f-x for f in [-d for d in d2[::-1]]+d2):
m, k = x*(z:=x+y), 1
while n >= abs(m) and k<=n:
if n == m:
c += 1
z += y
m *= z
k += 1
return c # Chai Wah Wu, May 11 2023
approved
editing
proposed
approved