OFFSET
1,2
LINKS
David A. Corneth, PARI program
EXAMPLE
*----*------*---------*---------------------------------*
| n | a(n) | i | i-th | sum of n first divisors |
| | | | divisor | of a(n) |
*----*------*---------*---------------------------------*
| 2 | 6 | 3 | 3 | 1+2 = 3 |
*----*------*----*---------*----------------------------*
| 3 | 6 | 4 | 6 | 1+2+3 = 6 |
*----*------*----*---------*----------------------------*
| 4 | 28 | 5 | 14 | 1+2+4+7 = 14 |
*----*------*----*---------*----------------------------*
| 5 | 28 | 6 | 28 | 1+2+4+7+14 = 28 |
*----*------*----*---------*----------------------------*
| 6 | 24 | 8 | 24 | 1+2+3+4+6+8 = 24 |
*----*------*----*---------*----------------------------*
| 7 | 126 | 10 | 42 | 1+2+3+6+7+9+14 = 42 |
*----*------*----*---------*----------------------------*
| 8 | 234 | 10 | 78 | 1+2+3+6+9+13+18+26 = 78 |
*----*------*----*---------*----------------------------*
| 9 | 224 | 11 | 112 | 1+2+4+7+8+14+16+28+32 = 112|
|----*------*----*---------*----------------------------*
MAPLE
with(numtheory):nn:=10^6:T:=array(1..44):i:=0:
for n from 2 to 45 do:
ii:=1:
for a from 6 to nn while ii=1
do:
d:=divisors(a):n0:=nops(d):
if n0>=n
then
s:=sum('d[j]', 'j'=1..n):
for m from 1 to n0 do:
if s=d[m]
then
ii:=0:printf(`%d %d\n`, n, a):i:=i+1:T[i]:=a:
else
fi :
od :fi:
od:od:print(T):
PROG
(PARI) \\ See Corneth link
(Python)
from sympy import divisors
from itertools import count, islice
def agen(): # generator of terms
adict, n = dict(), 1
for k in count(1):
d = divisors(k)
if len(d) < n-1: continue
dset, s = set(d), 0
for i, di in enumerate(d, 1):
s += di
if i >= n and i not in adict and s in dset: adict[i] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 50))) # Michael S. Branicky, Aug 20 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 19 2024
EXTENSIONS
a(1) = 1 prepended by David A. Corneth, Aug 20 2024
STATUS
approved