greedy computation of pseudoperfect numbers?
Joerg Arndt
arndt at jjj.de
Tue Apr 8 06:14:02 CEST 2008
For both sorts of pseudoperfect numbers, allowing divisor one A005835,
and forbidding divisor one A136446, a greedy method _seems_ to always
work for deciding whther a given n in in the sequence:
greedy(n, d)= \\ d:= vector of allowed divisors, sorted
{
local(t=n,l=1);
forstep (j=#d, 1, -1,
if (t-d[j]>=0,
t-=d[j];
l = lcm(l, d[j]);
print1(" +", d[j]);
if (0==t,
print(" yes, lcm==n: ", l==n);
if ( l!=n, error(" lcm=!=n ") );
return(1);
);
)
);
print(" no ");
return( 0 );
}
The computation is obviously extremely fast.
Further, the lcm of all divisors taken for the sum has always lcm==1.
(cf. the line if ( l!=n, error(" lcm=!=n ") ); which is never executed).
Is there any information available about whether the greedy approach
always works, and whether the lcm property holds?
I do not know whether the questions are easy or very hard.
Moreover, (disallowing the divisors one,) can any odd number n be in
sequence A136446? This is of interest because all gcd computations in
a Rabin-like irreducibility test for polynomials over finite fields
(have to write it up) can be avoided for all numbers _not_ in A136446.
The "gcd-avoiding" numbers n are actually such that there is a multiset
of divisors that adds to n and has lcm==n; that's why I ask about the
lcm property.
More information about the SeqFan
mailing list