Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
14
Task/Babbage-problem/Maxima/babbage-problem.maxima
Normal file
14
Task/Babbage-problem/Maxima/babbage-problem.maxima
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
/* 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
|
||||
)$
|
||||
|
||||
/* Test case */
|
||||
block(babbage_param:269696,i:isqrt(babbage_param)+1,cache_babbage:decompose(babbage_param),
|
||||
while rest(decompose(i^2),(length(decompose(i^2))-6))#cache_babbage do i:i+2,
|
||||
i);
|
||||
Loading…
Add table
Add a link
Reference in a new issue