-
Notifications
You must be signed in to change notification settings - Fork 0
/
from_carmichael.sf
36 lines (24 loc) · 2.02 KB
/
from_carmichael.sf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/ruby
# Carmichael numbers k where records occur for:
#
# gcd(k+1, prod({p+1}))
#
# where p are primes dividing k.
# Interesting Carmichael:
# 10087556401, 521229341501, 681518685121, 69338900836801, 161427803532841, 252854143869601, 345186571310209, 2482943986034821
var max = 0
ARGF.each {|line|
var k = line.nums.last
var g = gcd(k+1, k.factor.lcm{.inc})
if (g > max) {
max = g
print(k, ", ")
}
}
__END__
561, 1105, 2465, 1033669, 1082809, 1152271, 40917241, 6047866621, 16619839201, 681518685121, 1230592280401, 1568447022961, 5989120703281, 11786693184001, 161427803532841, 252854143869601, 1956574900114561, 2482943986034821, 2808632950020001, 124079752851264001
561, 1105, 2465, 1033669, 1082809, 1152271, 40917241, 6047866621, 10087556401, 16619839201, 521229341501, 1230592280401, 1568447022961, 5989120703281, 11786693184001, 69338900836801, 345186571310209, 1956574900114561, 2808632950020001, 124079752851264001
# Partial data from larger terms:
23456007722161, 55638590321665, 55640499181345, 186832978038001, 239012844663601, 287547991275601, 296694388317601, 761931111664801, 882456391540801, 998611252885441, 1704148043681161, 2109406097077201, 3146740690223521, 16278157594814401, 244291178667826115281, 376288282220649969431147041, 268940188387740768551767564801, 17080614844574772397594660504561, 61775306650572807348474491190988597641846846227166949905601
23456007722161, 55638590321665, 55640499181345, 186832978038001, 239012844663601, 287547991275601, 296694388317601, 761931111664801, 882456391540801, 998611252885441, 1480179978679249, 2109406097077201, 3146740690223521, 16278157594814401, 244291178667826115281, 13997532930900069558624121, 376288282220649969431147041, 268940188387740768551767564801, 17080614844574772397594660504561, 2798237358060221256512941829229121, 887109042673528617140737771024267201
1015349080168801, 1082759151539521, 1574092611675649, 2126530798396201, 2256850096074721, 5535217410019201, 868777378288485121, 887588614984559041, 352675609398337585361,