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-6 of 6 results.

A072667 Consider m such that prime(m) + prime(m+1) = prime(k) + 1 for some k; sequence gives values of prime(m).

Original entry on oeis.org

3, 5, 7, 11, 13, 19, 29, 31, 41, 43, 61, 67, 73, 97, 113, 127, 151, 179, 191, 193, 199, 211, 223, 229, 239, 241, 271, 277, 281, 293, 307, 317, 337, 349, 367, 373, 379, 397, 401, 409, 419, 431, 439, 463, 487, 523, 541, 547, 577, 613, 619, 641, 643, 659, 683, 701, 709, 727
Offset: 1

Views

Author

Herman H. Rosenfeld (herm3(AT)pacbell.net), Aug 12 2002

Keywords

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [1..200] | IsPrime(NthPrime(n) + NthPrime(n+1)-1)] // Vincenzo Librandi, Aug 26 2012
  • Mathematica
    Transpose[Select[Partition[Prime[Range[130]], 2, 1], PrimeQ[Total[#]-1]&]] [[1]] (* Harvey P. Dale, Feb 29 2012 *)
    Select[Prime[Range[200]],PrimeQ[#+NextPrime[#]-1]&] (* Vincenzo Librandi, Aug 26 2012 *)

Formula

a(n) = prime(A072666(n)) = A000040(A072666(n)). - Zak Seidov, Dec 08 2014

A072666 Numbers n such that prime(n) + prime(n+1) - 1 is prime.

Original entry on oeis.org

2, 3, 4, 5, 6, 8, 10, 11, 13, 14, 18, 19, 21, 25, 30, 31, 36, 41, 43, 44, 46, 47, 48, 50, 52, 53, 58, 59, 60, 62, 63, 66, 68, 70, 73, 74, 75, 78, 79, 80, 81, 83, 85, 90, 93, 99, 100, 101, 106, 112, 114, 116, 117, 120, 124, 126, 127, 129, 130, 131, 132, 137, 138, 140, 145, 147, 149
Offset: 1

Views

Author

Herman H. Rosenfeld (herm3(AT)pacbell.net), Aug 12 2002

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [1..200] | IsPrime(NthPrime(n) + NthPrime(n+1)-1)] // Vincenzo Librandi, Aug 26 2012
  • Maple
    N:= 10^4: # to get all terms n such that prime(n+1) <= N
    Primes:= select(isprime,[2,seq(2*i+1,i=1..floor(N/2))]):
    PP:= Primes[1..-2]+Primes[2..-1]:
    select(t -> isprime(PP[t]-1), [$1..nops(PP)]); # Robert Israel, Dec 11 2014
  • Mathematica
    Select[Range[200], PrimeQ[Prime[#]+Prime[#+1]-1] &] (* Harvey P. Dale, Dec 16 2010 *)

Formula

a(n) = pi(A072667(n)) = A000720(A072667(n)). - Zak Seidov, Dec 08 2014

Extensions

Definition clarified by Robert Israel, Dec 11 2014

A098084 a(n) satisfies P(n) + P(n+1) + a(n) = least prime >= P(n) + P(n+1), where P(i)=i-th prime.

Original entry on oeis.org

0, 3, 1, 1, 5, 1, 1, 1, 1, 1, 3, 1, 5, 7, 1, 1, 7, 3, 1, 5, 5, 1, 1, 5, 1, 7, 1, 7, 1, 1, 5, 1, 1, 5, 7, 3, 11, 1, 7, 1, 7, 1, 5, 7, 1, 9, 5, 7, 1, 1, 7, 7, 7, 1, 1, 9, 1, 9, 5, 5, 1, 1, 1, 7, 1, 5, 5, 7, 5, 7, 7, 1, 3, 5, 7, 1, 1, 11, 1, 1, 13, 1, 13, 5, 1, 15, 1, 1, 5, 7, 1, 1, 5, 1, 7, 1, 1, 5, 5, 3, 5, 3, 19
Offset: 1

Views

Author

Pierre CAMI, Sep 13 2004

Keywords

Comments

a(n) = 1 iff prime(n) is in A177017. - Robert Israel, Feb 04 2020

Examples

			P(1) + P(2) = 2 + 3 = 5; least prime >= 5 = 5, so a(1)=0.
P(2) + P(3) = 3 + 5 = 8; least prime > 8 = 11, so a(2) = 11 - 8 = 3.
P(3) + P(4) = 5 + 7 = 12; least prime > 12 = 13, so a(3) = 13 - 12 = 1.
		

Crossrefs

The primes are in A098085.
Cf. A177017.

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..200)]:
    map(t -> nextprime(t-1)-t,P[1..-2]+P[2..-1]); # Robert Israel, Feb 04 2020
  • Mathematica
    f[n_] := Block[{k = 0, p = Prime[n] + Prime[n + 1]}, While[ !PrimeQ[p + k], k++ ]; k]; Table[ f[n], {n, 103}] (* Robert G. Wilson v, Sep 24 2004 *)

Extensions

More terms from Robert G. Wilson v, Sep 25 2004

A224789 Primes p such that both p + nextprime(p) + 1 and p*nextprime(p) + 2 are primes.

Original entry on oeis.org

5, 7, 13, 19, 67, 229, 269, 307, 313, 401, 439, 613, 643, 863, 1051, 1693, 1783, 1999, 2143, 2239, 2309, 2423, 2549, 2753, 2819, 3037, 3079, 3089, 3361, 3373, 3389, 3677, 3863, 3877, 4139, 4259, 4519, 4663, 4909, 4933, 5323, 5527, 5581, 5849, 6359, 6577
Offset: 1

Views

Author

Jayanta Basu, Apr 17 2013

Keywords

Comments

Intersection of A051507 and A177017.

Examples

			5 is a member since 5 + 7 + 1 = 13 and 5 * 7 + 2 = 37 are both primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[900]], PrimeQ[# + NextPrime[#] + 1] && PrimeQ[#*NextPrime[#] + 2] &]
    npQ[n_]:=Module[{np=NextPrime[n]},AllTrue[{n+np+1,n*np+2},PrimeQ]]; Select[ Prime[ Range[900]],npQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 04 2017 *)

A244095 Primes of the form (p + q)^2 + 1, where p and q are consecutive primes.

Original entry on oeis.org

577, 1297, 7057, 8101, 14401, 41617, 44101, 57601, 90001, 115601, 147457, 156817, 331777, 484417, 547601, 746497, 820837, 864901, 894917, 933157, 1299601, 1664101, 1742401, 1822501, 1887877, 1988101, 2131601, 2232037, 2702737, 2944657, 3218437
Offset: 1

Views

Author

K. D. Bajpai, Jun 20 2014

Keywords

Comments

Subsequence of A002496.
Also, primes of form p^2 + 2pq + q^2 + 1; p and q are consecutive primes.

Examples

			577 is in the sequence because (11 + 13)^2 + 1 = 577, which is prime.
1297 is in the sequence because (17 + 19)^2 + 1 = 1297, which is prime.
		

Crossrefs

Programs

  • Magma
    [t: p in PrimesUpTo(1000) | IsPrime(t) where t is (p+NextPrime(p))^2+1]; // Bruno Berselli, Jun 24 2014
  • Maple
    with(numtheory):A244095:= proc() local k,p,q; p:=ithprime(n); q:=ithprime(n+1); k:=(p+q)^2 + 1; if isprime(k) then RETURN (k); fi; end: seq(A244095 (), n=1..300);
  • Mathematica
    A244095 = {}; Do[k = (Prime[n] + Prime[n + 1])^2 + 1; If[PrimeQ[k], AppendTo[A244095, k]], {n, 2, 300}]; A244095

A356745 a(n) is the first prime that starts a string of exactly n consecutive primes where the prime + the next prime + 1 is prime.

Original entry on oeis.org

37, 5, 283, 929, 13, 696607, 531901, 408079937, 17028422981
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Sep 17 2022

Keywords

Comments

a(n) is the first prime p(k) such that p(k+i)+p(k+i+1)+1 is prime for i from 0 to n-1, but not for i=-1 or n.

Examples

			a(5) = 13 because 13+17+1 = 31, 17+19+1 = 37, 19+23+1 = 43, 23+29+1 = 53, and 29+31+1 = 61 are prime, but 11+13+1 = 25 and 31+37+1 = 69 are not, and 13 is the first prime that works.
		

Crossrefs

Cf. A177017.

Programs

  • Maple
    P:= select(isprime, [seq(i,i=3..10^6,2)]):
    V:= Vector(7):
    state:= 0:
    for i from 1 to nops(P)-1 do
    if isprime(P[i]+P[i+1]+1) then
      state:= state+1
    else
      if state > 0 and V[state] = 0 then V[state]:= P[i-state] fi;
      state:= 0
    fi
    od:
    convert(V,list);
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def f(p):
        c, p0, p1 = 0, p, nextprime(p)
        while isprime(p0+p1+1):
            c, p0, p1 = c+1, p1, nextprime(p1)
        return c, p1
    def agen():
        n, adict, pk = 1, dict(), 2
        for k in count(1):
            fk, pk2 = f(pk)
            if fk not in adict: adict[fk] = pk
            while n in adict: yield adict[n]; n += 1
            pk = pk2
    print(list(islice(agen(), 7))) # Michael S. Branicky, Sep 18 2022

Extensions

a(8)-a(9) from Michael S. Branicky, Sep 18 2022
Showing 1-6 of 6 results.