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.

Showing 1-2 of 2 results.

A087031 Numbers n such that 2p-n is prime, p is the smallest prime > n.

Original entry on oeis.org

1, 3, 9, 15, 27, 31, 33, 39, 47, 57, 61, 63, 69, 75, 91, 93, 99, 105, 115, 117, 123, 135, 141, 147, 151, 159, 167, 177, 183, 185, 189, 195, 199, 213, 217, 219, 225, 237, 245, 251, 257, 267, 271, 273, 279, 297, 301, 303, 309, 325, 341, 345, 361, 367, 375
Offset: 1

Views

Author

Zak Seidov, Jul 31 2003

Keywords

Examples

			3 is a term because smallest prime >3 is 5 and 2*5-3=7 is prime.
		

Crossrefs

Cf. A087030.

Programs

  • Mathematica
    Select[Range[400],PrimeQ[2*NextPrime[#]-#]&] (* Harvey P. Dale, Jul 02 2018 *)
  • PARI
    isok(n) = isprime(2*nextprime(n+1) - n);  \\ Michel Marcus, Oct 03 2013

Extensions

Corrected by Michel Marcus, Oct 03 2013

A087032 a(n) = 1 if 2*A151800(n) - n is prime, otherwise 0, where A151800(n) is the smallest prime > n.

Original entry on oeis.org

1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Zak Seidov, Jul 31 2003

Keywords

Comments

There is no subsequence of two ones; number of zeros in each group is odd, see A087033.

Examples

			a(1)=1 because the smallest prime > 1 is 2 and 2*2-1=3 is prime.
		

Crossrefs

Programs

  • Mathematica
    bb={}; Do[bb={bb, If[PrimeQ[2(Prime[PrimePi[n]+1])-n], 1, 0]}, {n, 1000}]; Flatten[bb]
  • PARI
    A087032(n) = isprime((2*nextprime(1+n))-n); \\ Antti Karttunen, Oct 09 2018

Formula

a(n) = 1 if A087030(n) is prime, 0 if it is composite.
a(n) = A010051((2*A151800(n))-n). - Antti Karttunen, Oct 09 2018

Extensions

Definition edited by Antti Karttunen, Oct 09 2018
Showing 1-2 of 2 results.