Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Emirp-primes/Maple/emirp-primes.maple
Normal file
22
Task/Emirp-primes/Maple/emirp-primes.maple
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
EmirpPrime := proc(n)
|
||||
local eprime;
|
||||
eprime := parse(StringTools:-Reverse(convert(n,string)));
|
||||
if n <> eprime and isprime(n) and isprime(eprime) then
|
||||
return n;
|
||||
end if;
|
||||
end proc:
|
||||
EmirpsList := proc( n )
|
||||
local i, values;
|
||||
values := Array([]):
|
||||
i := 0:
|
||||
do
|
||||
i := i + 1;
|
||||
if EmirpPrime(i) <> NULL then
|
||||
ArrayTools:-Append(values, i);
|
||||
end if;
|
||||
until numelems(values) = n;
|
||||
return convert(values,list);
|
||||
end proc:
|
||||
EmirpsList(20);
|
||||
EmirpPrime~([seq(7700..8000)]);
|
||||
EmirpsList(10000)[-1];
|
||||
Loading…
Add table
Add a link
Reference in a new issue