|
|
A067603
|
|
Least k such that gcd(prime(k)+1, prime(k+1)+1) = 2n.
|
|
7
|
|
|
2, 4, 9, 72, 34, 91, 62, 478, 205, 2016, 522, 909, 1440, 5375, 2149, 6610, 7604, 2976, 5229, 7488, 11251, 7499, 8805, 20179, 18526, 70885, 28193, 40985, 33847, 17625, 27069, 77199, 66156, 90764, 26186, 141235, 70317, 856719, 110769, 50523, 217229
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Since all consecutive primes, 2 < p < q, are odd, therefore gcd(p+1, q+1) must be even.
|
|
LINKS
|
Zak Seidov, Robert G. Wilson v, and Charles R Greathouse IV, Table of n, a(n) for n = 1..200 (1..100 terms from Seidov, 101..140 from Wilson, 141..200 from Greathouse)
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1) = 2, the first entry in A066940,
a(2) = 4, the first entry in A066941,
a(3) = 9, the first entry in A066942,
a(4) = 72, the first entry in A066943,
a(5) = 34, the first entry in A066944.
That is to say that the first k-th prime that has gcd(prime(k+1)+1, prime(k)+1)) of 2, 4, 6, 8, 10, ..., are k = 2, 4, 9, 72, 34, ..., and the prime_k = 3, 7, 23, 359, 139, 467, 293, ... (A067604).
If the floor of GCD is used, then a(0) equals 1.
|
|
MATHEMATICA
|
t = 0*Range@ 70; p = 3; q = 5; While[p < 15*10^6, d = GCD[p + 1, q + 1]/2; If[ t[[d]] == 0, t[[d]] = PrimePi@ p]; p = q; q = NextPrime@ q]; t
|
|
PROG
|
(PARI) a(n) = p=2; q=3; k=1; while(gcd(p+1, q+1) != 2*n, k++; p=q; q = nextprime(p+1); ); k; \\ Michel Marcus, Aug 16 2015
(PARI) a(n)=my(p=2, k=2*n, t); forprime(q=3, , t++; if((q-p)%k==0 && (p+1)%k==0, return(t)); p=q) \\ Charles R Greathouse IV, Aug 17 2015
(PARI) a(n)=my(k=2*n); forstep(p=k-1, oo, k, if(isprime(p) && (nextprime(p+1)-p)%k==0, return(primepi(p)))) \\ Charles R Greathouse IV, Aug 17 2015
(MATLAB)
P = primes(10^8);
G = gcd(P(1:end-1)+1, P(2:end)+1);
A = zeros(1, 66);
for n = 1:66
A(n) = find(G == 2*n, 1, 'first');
end
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|