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.

A096482 a(n) = prime(prime(A096480(n))).

Original entry on oeis.org

3, 67, 31, 401, 241, 211, 773, 2221, 1913, 7649, 3229, 1669, 2477, 10009, 5749, 33647, 9973, 14107, 60821, 130729, 16141, 15683, 113233, 86629, 95651, 74959, 35617, 388403, 214993, 557093, 248909, 637003, 296843, 448451, 186481, 1145899, 1283603, 1845637, 795349, 542603
Offset: 1

Views

Author

Labos Elemer, Jun 23 2004

Keywords

Comments

a(n) = prime(p) where p is the smallest prime such that prime(p+1) - prime(p) = 2*n.
Both a(n) and a(n) + 2*n are primes while pi(a(n)) = A096481(n) and pi(pi(a(n))) = A096480(n).

Examples

			a(2) = 67 = prime(19) since prime(19+1) - prime(19) = 71 - 67 = 2*2 and 19 is the smallest prime with this property.
		

Crossrefs

Programs

  • Mathematica
    Prime[Prime[Table[Min[Flatten[Position[Table[Prime[Prime[n]+1]- Prime[Prime[n]], {n, 1, 5000}], 2*j]]], {j, 1, 100}]]]
  • PARI
    a(n) = {my(p=2); while((prime(p+1)-prime(p))!=2*n, p=nextprime(p+1)); prime(p)} \\ Klaus Brockhaus, Jun 27 2004
    
  • PARI
    a(n) = {my(p=2,k=1); forprime(q=3, oo, if(q==p+2*n && isprime(k), return(p)); p=q; k++)} \\ Andrew Howroyd, Dec 16 2024

Formula

a(n) = A006450(A096480(n)) = prime(A096481(n)).
a(n) + 2*n = prime(1 + prime(A096480(n))).

Extensions

a(31)-a(36) from Klaus Brockhaus, Jun 27 2004
a(37) onwards from Andrew Howroyd, Dec 16 2024