cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A067603 Least k such that gcd(prime(k)+1, prime(k+1)+1) = 2n.

Original entry on oeis.org

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
Offset: 1

Views

Author

Robert G. Wilson v, Jan 31 2002

Keywords

Comments

Since all consecutive primes, 2 < p < q, are odd, therefore gcd(p+1, q+1) must be even.

Examples

			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.
		

Crossrefs

Programs

  • 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
    A   % Robert Israel, Aug 16 2015
  • 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
  • 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
    

Formula

Conjecture: a(n) = least k such that A001223(k) = 2n and A000040(k) == -1 (mod 2n). - Zak Seidov, Aug 16 2015

Extensions

Edited by Robert G. Wilson v, Aug 17 2015 at the direction of Zak Seidov