Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
15
Task/Blum-integer/Maxima/blum-integer.maxima
Normal file
15
Task/Blum-integer/Maxima/blum-integer.maxima
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* Predicate functions that checks wether an integer is a Blum integer or not */
|
||||
blum_p(n):=lambda([x],length(ifactors(x))=2 and unique(map(second,ifactors(x)))=[1] and mod(ifactors(x)[1][1],4)=3 and mod(ifactors(x)[2][1],4)=3)(n)$
|
||||
|
||||
/* Function that returns a list of the first len Blum integers */
|
||||
blum_count(len):=block(
|
||||
[i:1,count:0,result:[]],
|
||||
while count<len do (if blum_p(i) then (result:endcons(i,result),count:count+1),i:i+1),
|
||||
result)$
|
||||
|
||||
/* Test cases */
|
||||
/* First 50 Blum integers */
|
||||
blum_count(50);
|
||||
|
||||
/* Blum integer number 26828 */
|
||||
last(blum_count(26828));
|
||||
Loading…
Add table
Add a link
Reference in a new issue