-
Notifications
You must be signed in to change notification settings - Fork 0
/
prog.sf
21 lines (14 loc) · 849 Bytes
/
prog.sf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/ruby
# Least number k > primorial(n) such that omega(k) = n-1.
# https://oeis.org/A292427
# Known terms:
# 7, 33, 220, 2340, 30090, 511290, 9708270, 223136760, 6470164470, 200575098570
# New terms:
# 7, 33, 220, 2340, 30090, 511290, 9708270, 223136760, 6470164470, 200575098570, 7420875422730, 304251077160030, 13082794956764610, 614890302617971380, 32589185235841244010, 1922761748060828845170, 117288389032450202376810, 7858321607905303633368270, 557940834161276557969147170
# PARI/GP program:
#`(
a(n) = my(A=vecprod(primes(n)), B=2*A); (f(m, p, j) = my(r=oo); forprime(q=p, sqrtnint(B\m, j), my(v=m*q); while(v <= B, if(j==1, if(v>=A && v < r, r = v; B = v-1), if(v*(q+1) <= B, r = min(r, f(v, q+1, j-1)))); v *= q)); r); f(1, 2, n-1); \\ ~~~~
)
for n in (2..100) {
print(pn_primorial(n).next_omega_prime(n-1), ", ")
}