Re^2: practical numbers
Richard Mathar
mathar at strw.leidenuniv.nl
Mon Nov 27 21:46:49 CET 2006
> From seqfan-owner at ext.jussieu.fr Mon Nov 27 18:44:49 2006
> From: "David Wilson" <davidwwilson at comcast.net>
> To: "Sequence Fans" <seqfan at ext.jussieu.fr>
> Subject: Re: practical numbers
> ...
> Anyway, another question: What is the smallest number a(n) that is a sum of
> its distinct divisors in n ways?
For each n we get the "trivial" solution where the sum consists of n itself
as the only term. Further solutions, where the sum contains more than one term
(all of which are distinct divisors), are listed below in the format
n [list of terms that sum to n]:
6 [1, 2, 3]
12 [1, 2, 3, 6]
12 [2, 4, 6]
18 [1, 2, 6, 9]
18 [3, 6, 9]
20 [1, 4, 5, 10]
24 [1, 2, 3, 4, 6, 8]
24 [1, 2, 3, 6, 12]
24 [2, 4, 6, 12]
24 [1, 3, 8, 12]
24 [4, 8, 12]
28 [1, 2, 4, 7, 14]
30 [1, 3, 5, 6, 15]
30 [2, 3, 10, 15]
30 [5, 10, 15]
36 [2, 3, 4, 6, 9, 12]
36 [2, 3, 4, 9, 18]
36 [1, 2, 6, 9, 18]
36 [3, 6, 9, 18]
36 [1, 2, 3, 12, 18]
36 [2, 4, 12, 18]
36 [6, 12, 18]
40 [1, 2, 4, 5, 8, 20]
40 [1, 4, 5, 10, 20]
40 [2, 8, 10, 20]
42 [1, 6, 14, 21]
42 [7, 14, 21]
n=6 has 1 extra solution, n=12 or 18 have 2 extra solutions, n=20 has one,
n=24 has five etc.
Maple program to create that one (not checked!):
a := proc(n)
local findx,d,f,found,i,count ;
count :=0 :
# decompose n into all sums that are candidates for the decomposition
d := combinat[partition](n) ;
# take each sum indivdually
for findx from 1 to nops(d) do
f := op(findx,d) ;
# start with the assumption that it works
found := true ;
for i from 2 to nops(f) do
# if two terms are equal in the Maple list,
# we flag this case as "not admitted"
if op(i,f) = op(i-1,f) then
found := false ;
break ;
fi ;
od ;
for i from 1 to nops(f) do
# if any term is not a divisor,
# we flag this case as "not admitted"
if n mod op(i,f) <> 0 then
found := false ;
break ;
fi ;
od ;
# If this sum seems to work and has more than one term, we list it
if found and nops(f) > 1 then
printf("%a %a\n",n,f) ;
count := count+1 ;
fi ;
od ;
RETURN(count) ;
end:
# loop over the most fundamental cases..
for n from 1 to 47 do
a(n) ;
od ;
# Richard Mathar
More information about the SeqFan
mailing list