YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
16
Task/Almost-prime/Maple/almost-prime.maple
Normal file
16
Task/Almost-prime/Maple/almost-prime.maple
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
AlmostPrimes:=proc(k, numvalues::posint:=10)
|
||||
local aprimes, i, intfactors;
|
||||
aprimes := Array([]);
|
||||
i := 0;
|
||||
|
||||
do
|
||||
i := i + 1;
|
||||
intfactors := ifactors(i)[2];
|
||||
intfactors := [seq(seq(intfactors[i][1], j=1..intfactors[i][2]),i = 1..numelems(intfactors))];
|
||||
if numelems(intfactors) = k then
|
||||
ArrayTools:-Append(aprimes,i);
|
||||
end if;
|
||||
until numelems(aprimes) = 10:
|
||||
aprimes;
|
||||
end proc:
|
||||
<seq( AlmostPrimes(i), i = 1..5 )>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue