Data update

This commit is contained in:
Ingy döt Net 2023-09-16 17:28:03 -07:00
parent 5af6d93694
commit 796d366b97
455 changed files with 7413 additions and 1900 deletions

View file

@ -1,23 +1,20 @@
proc giuga m . r .
func giuga m .
n = m
r = 0
for f = 2 to sqrt n
while n mod f = 0
if (m div f - 1) mod f <> 0
break 2
return 0
.
n = n div f
if f > n
r = 1
break 2
return 1
.
.
.
.
n = 3
while cnt < 4
call giuga n r
if r = 1
if giuga n = 1
cnt += 1
print n
.

View file

@ -0,0 +1,12 @@
/* Predicate function that checks wether an integer is a Giuga number or not */
giugap(n):=if not primep(n) then block(ifactors(n),map(lambda([x],mod((n/x)-1,x)=0),map(first,%%)),
if length(unique(%%))=1 and apply(lhs,unique(%%))=0 then true)$
/* Function that returns a list of the first len Giuga integers */
giuga_count(len):=block(
[i:1,count:0,result:[]],
while count<len do (if giugap(i) then (result:endcons(i,result),count:count+1),i:i+1),
result)$
/* Test case */
giuga_count(4);