Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
17
Task/Additive-primes/Maxima/additive-primes.maxima
Normal file
17
Task/Additive-primes/Maxima/additive-primes.maxima
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* Function that returns a list of digits given a nonnegative integer */
|
||||
decompose(num) := block([digits, remainder],
|
||||
digits: [],
|
||||
while num > 0 do
|
||||
(remainder: mod(num, 10),
|
||||
digits: cons(remainder, digits),
|
||||
num: floor(num/10)),
|
||||
digits
|
||||
)$
|
||||
|
||||
/* Routine that extracts from primes between 2 and 500, inclusive, the additive primes */
|
||||
block(
|
||||
primes(2,500),
|
||||
sublist(%%,lambda([x],primep(apply("+",decompose(x))))));
|
||||
|
||||
/* Number of additive primes in the rank */
|
||||
length(%);
|
||||
Loading…
Add table
Add a link
Reference in a new issue