OFFSET
0,1
COMMENTS
If a given prime p is less than a(n) then the numbers of distinct prime factors of p+1 and p-1 have a difference less than n.
From Daniel Suteu, May 11 2022: (Start)
a(13) <= 693386350578511591,
a(14) <= 42296567385289206991,
a(15) <= 3291505006196194517729,
a(16) <= 222099275340153625904489,
a(17) <= 12592092354842984193179971,
a(18) <= 873339227295479848905071071,
a(19) <= 54536351988824964540662450069,
a(20) <= 5513390541916364286137713664909. (End)
From Jon E. Schoenfield, May 11 2022: (Start)
For n > 1, if there exists any prime p < 2*prime(n+2)# such that the absolute difference of the numbers of distinct prime factors of p+1 and p-1 is exactly n, then (since a(n) <= p) it follows that a(n)+1 and a(n)-1, in some order, are either (1) a power of 2, and 2 times an odd number with n distinct prime factors, or (2) an odd prime times a power of 2, and the product of n+2 distinct primes. (In the first case, the numbers of distinct prime factors are 1 and n+1; in the second, they are 2 and n+2.)
E.g., for n = 6, given that p = 18888871 is a prime < 19399380 = 2*(2*3*5*7*11*13*17*19) and the prime factorizations of p+1 and p-1 are 2^3 * 2361109 and 2*3*5*7*11*13*17*37, then a(6)+1 must be too small to have more than 8 distinct prime factors, and also too small to have exactly 8 distinct prime factors with any factor having a multiplicity greater than 1. Thus, a(6) is the smallest prime p such that p+1 and p-1, in some order, are either (1) a power of 2, and 2 times an odd number with 6 distinct prime factors, or (2) a prime times a power of 2, and the product of 8 distinct primes. (As it turns out, a(6) = 16546531, so a(6) + 1 = 2^2 * 4136633 (2 distinct prime factors) and a(6) - 1 = 2*3*5*7*11*13*19*29 (8 distinct prime factors).)
For each n in 2..100, there exists such a prime p < 2*prime(n+2)#, so the numbers of distinct prime factors of a(n)+1 and a(n)-1 are, in some order, 1 and n+1 or 2 and n+2.
For n <= 100, the maximum value of a(n)/prime(n+2)# is a(16)/prime(18)# = 1.893617....
(End)
EXAMPLE
a(2) = 31 because the number of distinct prime factors of 32 is 1 and the number of distinct prime factors of 30 is 3, giving a difference of 2. No prime less than 31 has this property.
PROG
(PARI) isok(p, n) = abs(omega(p-1)-omega(p+1)) == n;
a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, May 09 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Yusuf Gurtas, May 08 2022
EXTENSIONS
a(7)-a(8) from Amiram Eldar, May 08 2022
a(9)-a(10) from Yusuf Gurtas, May 08 2022
a(11) from Yusuf Gurtas, May 09 2022
a(9) corrected by Yusuf Gurtas, May 09 2022
a(12) from Yusuf Gurtas, May 09 2022
STATUS
approved