10 lines
220 B
Text
10 lines
220 B
Text
attractivenumbers := proc(n::posint)
|
|
local an, i;
|
|
an :=[]:
|
|
for i from 1 to n do
|
|
if isprime(NumberTheory:-NumberOfPrimeFactors(i)) then
|
|
an := [op(an), i]:
|
|
end if:
|
|
end do:
|
|
end proc:
|
|
attractivenumbers(120);
|