Semiprime: Difference between revisions

Content added Content deleted
m (used a larger font to show the equation.)
m (→‎{{header|Maple}}: Update to use newer Maple package and fix typo)
Line 763: Line 763:
<lang Maple>SemiPrimes := proc( n )
<lang Maple>SemiPrimes := proc( n )
local fact;
local fact;
fact := numtheory:-divisors( n ) minus {1, n};
fact := NumberTheory:-Divisors( n ) minus {1, n};
if numelems( fact ) in {1,2} and not( member( 'false', isprime ~ ( fact ) ) ) then
if numelems( fact ) in {1,2} and not( member( 'false', isprime ~ ( fact ) ) ) then
return n;
return n;
Line 770: Line 770:
end if;
end if;
end proc:
end proc:
{ seq( SemiPrime( i ), i = 1..100 ) };</lang>
{ seq( SemiPrimes( i ), i = 1..100 ) };</lang>
Output:
Output:
<lang Maple>
<lang Maple>