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-10 of 13 results. Next

A224908 Given n-th prime p, a(n)=number of primes of the form p+q+1 where q is any prime < p.

Original entry on oeis.org

0, 0, 0, 2, 2, 2, 3, 3, 5, 5, 3, 4, 7, 4, 7, 8, 11, 5, 6, 9, 4, 7, 12, 14, 8, 11, 7, 13, 10, 12, 9, 15, 15, 12, 19, 9, 8, 8, 20, 19, 24, 11, 16, 11, 18, 15, 9, 13, 21, 14, 24, 27, 11, 26, 24, 26, 32, 13, 12, 21, 14, 28, 19, 27, 14, 26, 14, 14, 29, 24, 26, 39
Offset: 1

Views

Author

Jayanta Basu, Apr 19 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>3. - Dmitry Kamenetsky, Feb 09 2017

Examples

			For n=5, p=11, there are a(5)=2 solutions from 11+5+1=17 and 11+7+1=19.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, If[PrimeQ[p + Prime[i] + 1], c = c + 1]; i++]; c, {n, 72}]
    Table[p = Prime[n] + 1; Sum[If[PrimeQ[p + Prime[i]], 1, 0], {i, 1, n - 1}], {n, 72}] (* Zak Seidov, Apr 19 2013 *)
    Table[Count[Prime[n]+Prime[Range[n-1]]+1,?PrimeQ],{n,80}] (* _Harvey P. Dale, Mar 03 2024 *)
  • PARI
    for(n = 1,72, q = prime (n) + 1; print1 (sum (i = 1, n - 1, isprime (q + prime (i))) ","))\\ Zak Seidov, Apr 19 2013

A210481 Given n-th prime p, a(n) = number of primes of the form p * q - 2 where q is any prime < p.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 1, 1, 4, 2, 2, 4, 3, 2, 4, 3, 4, 3, 4, 4, 6, 3, 4, 5, 3, 5, 5, 4, 3, 6, 4, 7, 5, 4, 6, 5, 7, 9, 7, 5, 6, 5, 6, 6, 8, 5, 7, 9, 5, 6, 7, 5, 7, 7, 9, 10, 3, 11, 8, 11, 6, 9, 8, 12, 8, 9, 7, 10, 9, 7, 8, 8, 6, 14, 8, 10, 11, 11, 12, 11, 7, 7
Offset: 1

Views

Author

Jayanta Basu, Apr 18 2013

Keywords

Comments

Very similar to A103960. - T. D. Noe, Apr 18 2013
a(A137291(n)) = A103960(A137291(n)) - 1. - Reinhard Zumkeller, Jul 30 2015

Crossrefs

Programs

  • Haskell
    a210481 n = sum [a010051' $ p * q - 2 |
                     let p = a000040 n, q <- takeWhile (< p) a000040_list]
    -- Reinhard Zumkeller, Jul 30 2015
  • Mathematica
    Table[p = Prime[n]; c = 0; Do[If[PrimeQ[p*Prime[i] - 2], c = c + 1], {i, n - 1}]; c, {n, 82}]
    Table[With[{pr=Prime[Range[n]]},Count[Most[pr]Last[pr]-2,?PrimeQ]],{n,90}] (* _Harvey P. Dale, Jul 19 2020 *)

A224965 Let p = prime(n). a(n) = number of primes q less than p, such that both p*q+p+q and p*q-p-q are primes.

Original entry on oeis.org

0, 0, 2, 3, 1, 2, 2, 2, 1, 2, 1, 1, 3, 2, 1, 1, 1, 3, 2, 2, 1, 3, 1, 0, 4, 0, 1, 2, 5, 0, 2, 2, 1, 2, 2, 2, 1, 2, 2, 1, 1, 4, 2, 1, 0, 2, 5, 1, 1, 3, 1, 3, 3, 3, 0, 1, 2, 4, 1, 4, 4, 2, 2, 2, 6, 2, 5, 2, 3, 3, 2, 4, 5, 3, 2, 1, 3, 1, 3, 3, 3, 2, 2, 3, 2
Offset: 1

Views

Author

Jayanta Basu, Apr 21 2013

Keywords

Examples

			For n=3, p=5, there are a(3)=2 solutions 2,3 since 5*2+5+2=17, 5*2-5-2=3 and 5*3+5+3=23, 5*3-5-3=7. Also for n=5, p=11, there is a(5)=1 solution in the form of 11*3+11+3=47, 11*3-11-3=19.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, q1 = p*Prime[i]; q2 = p + Prime[i]; If[PrimeQ[q1 + q2] && PrimeQ[q1 - q2], c = c + 1]; i++]; c, {n, 85}]

A224925 a(n) = number of primes of the form p*q-(p+q) where p = prime(n) and q is any prime < p.

Original entry on oeis.org

0, 0, 2, 3, 2, 4, 2, 4, 3, 2, 7, 4, 5, 8, 2, 4, 2, 8, 7, 6, 11, 7, 6, 5, 10, 4, 11, 4, 11, 5, 14, 6, 6, 12, 4, 17, 10, 14, 5, 4, 4, 14, 6, 12, 9, 14, 24, 14, 7, 14, 11, 6, 21, 11, 6, 7, 6, 23, 15, 13, 18, 8, 18, 11, 22, 8, 29, 16, 11, 22, 9, 7, 21, 19, 26
Offset: 1

Views

Author

Jayanta Basu, Apr 20 2013

Keywords

Examples

			a(3)=2 since for the third prime 5 we have 5*2-(5+2)=3 and 5*3-(5+3)=7. Also a(4)=3 since for the fourth prime 7 we have 7*2-(7+2)=5, 7*3-(7+3)=11 and 7*5-(7+5)=23.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, If[PrimeQ[p*Prime[i] - (p + Prime[i])], c = c + 1] i++]; c, {n, 75}]

A224962 a(n) = number of primes of the form p*q+(p+q) where p = prime(n) and q is any prime < p.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 4, 4, 7, 3, 5, 6, 4, 7, 6, 8, 4, 5, 6, 2, 6, 10, 11, 8, 8, 5, 7, 10, 8, 5, 11, 8, 9, 14, 6, 6, 7, 11, 11, 14, 9, 12, 6, 13, 9, 10, 7, 16, 11, 11, 22, 9, 16, 17, 17, 21, 9, 4, 11, 6, 21, 10, 14, 13, 22, 10, 12, 21, 15, 20, 22, 13, 11, 12
Offset: 1

Views

Author

Jayanta Basu, Apr 21 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 1. - Dmitry Kamenetsky, Jul 18 2019

Examples

			For n=3, p=5, there are a(3)=2 solutions from 5*2+(5+2)=17 and 5*3+(5+3)=23.
For n=4, p=7, there are a(4)=3 solutions in the form of 7*2+(7+2)=23, 7*3+(7+3)=31 and 7*5+(7+5)=47.
		

Crossrefs

Programs

  • Maple
    a:= n-> (p-> add((q-> `if`(isprime((p+1)*(q+1)-1),
           1, 0))(ithprime(j)), j=1..n-1))(ithprime(n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jul 18 2019
  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, If[PrimeQ[p*Prime[i] + (p + Prime[i])], c = c + 1]; i++]; c, {n, 75}]
  • PARI
    a(n) = my(p=prime(n), q); sum(k=1, n-1, q=prime(k); isprime(p*q+(p+q))); \\ Michel Marcus, Jul 18 2019

A224979 Number of primes of the form p-q+1 where q is any prime < p = prime(n).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 4, 4, 6, 6, 4, 3, 8, 6, 10, 10, 12, 5, 4, 12, 9, 8, 16, 18, 6, 16, 10, 16, 12, 20, 6, 18, 16, 14, 24, 8, 9, 10, 26, 22, 28, 12, 22, 13, 26, 16, 12, 14, 24, 18, 30, 36, 16, 32, 28, 32, 38, 14, 13, 32, 16, 38, 16, 34, 17, 30, 12, 18, 32, 26
Offset: 1

Views

Author

Jayanta Basu, Apr 22 2013

Keywords

Examples

			For n=5, p=11, there are a(5)=2 solutions: 11-5+1=7 and 11-7+1=5.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, If[PrimeQ[p - Prime[i] + 1], c = c + 1]; i++]; c, {n, 70}]
    Table[Count[Prime[n]-Prime[Range[n-1]]+1,?PrimeQ],{n,70}] (* _Harvey P. Dale, Jan 08 2015 *)
  • PARI
    a(n)=my(p=prime(n),s);forprime(q=2,p-1,s+=isprime(p-q+1));s \\ Charles R Greathouse IV, Apr 22 2013

A224934 Primes p for which there exists no prime q, different from p, such that p+q-1 is the next prime after p.

Original entry on oeis.org

2, 3, 89, 113, 293, 317, 359, 389, 401, 449, 479, 491, 683, 701, 719, 743, 761, 773, 839, 863, 887, 911, 929, 953, 983, 1109, 1163, 1193, 1327, 1373, 1409, 1439, 1523, 1559, 1571, 1583, 1637, 1669, 1733, 1823, 1847, 1979, 2003, 2039, 2153, 2179, 2213, 2243
Offset: 1

Views

Author

Jayanta Basu, Apr 20 2013

Keywords

Comments

If we relax the restriction on q, where q is different from p, 2 and 3 fail to be members of this sequence.
Primes p = prime(k) for which A076368(k+1) = p or A076368(k+1) is composite. - Robert Israel, Nov 21 2016

Examples

			89 is in the list because there exists no prime q such that 89 + q - 1 = 97.
		

Crossrefs

Programs

  • Maple
    N:= 10^4: # to get all terms p for which the next prime <= N
    P:= select(isprime, [2,seq(i,i=3..N,2)]):
    G:= P[2..-1]-P[1..-2]:
    P[select(t -> G[t]=P[t]-1 or not isprime(G[t]+1), [$1..nops(G)])]; # Robert Israel, Nov 21 2016
  • Mathematica
    t = {}; Do[p = Prime[n]; If[FreeQ[Table[k = p + Prime[i] - 1, {i, n - 1}], Prime[n + 1]], AppendTo[t, p]], {n, 335}]; t

A224963 Let p = prime(n). a(n) = number of primes q less than p, such that both p+q+1 and p+q-1 are primes.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 3, 2, 3, 1, 4, 2, 3, 5, 4, 3, 3, 5, 3, 6, 6, 4, 7, 3, 5, 5, 4, 5, 6, 4, 8, 4, 3, 4, 6, 6, 6, 3, 5, 5, 7, 6, 6, 2, 4, 6, 5, 2, 6, 5, 5, 5, 5, 3, 3, 8, 5, 4, 8, 4, 7, 4, 7, 7, 4, 7, 3, 5, 8, 9, 9, 6, 6, 7
Offset: 1

Views

Author

Jayanta Basu, Apr 21 2013

Keywords

Examples

			For n=3, p=5, there are no primes q(<5) such that both 5+q+1 and 5+q-1 are primes and hence a(3)=0. Also for n=5, p=11, there is a(5)=1 solution 7 since 11+7+1=19, 11+7-1=17.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, p1 = p + Prime[i]; If[PrimeQ[p1 + 1] && PrimeQ[p1 - 1], c = c + 1]; i++]; c, {n, 85}]
    pq1[n_]:=Module[{pr1=Prime[Range[n-1]],pr2=Prime[n]},Total[ Table[ If[ AllTrue[pr2+pr1[[k]]+{1,-1},PrimeQ],1,0],{k,Length[pr1]}]]]; Array[ pq1,100] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 20 2020 *)

A224980 Number of primes of the form p-q-1 where q is any prime < p = prime(n).

Original entry on oeis.org

0, 0, 1, 1, 3, 2, 4, 4, 5, 4, 6, 8, 6, 8, 7, 6, 7, 12, 12, 10, 12, 14, 9, 8, 14, 12, 16, 11, 16, 14, 20, 14, 10, 16, 10, 24, 22, 20, 11, 12, 13, 28, 16, 22, 18, 26, 38, 22, 13, 24, 14, 18, 36, 18, 16, 17, 18, 38, 32, 28, 32, 16, 30, 24, 34, 20, 48, 38, 17
Offset: 1

Views

Author

Jayanta Basu, Apr 22 2013

Keywords

Examples

			For n=5, p=11, there are a(5)=3 solutions: 11-3-1=7, 11-5-1=5, and 11-7-1=3.
		

Crossrefs

Programs

  • Mathematica
    Table[p = Prime[n]; c = 0; i = 1; While[i < n, If[PrimeQ[p - Prime[i] - 1], c = c + 1]; i++]; c, {n, 69}]
  • PARI
    a(n)=my(p=prime(n),s);forprime(q=2,p-1,s+=isprime(p-q-1));s \\ Charles R Greathouse IV, Apr 22 2013

A224989 Let p = prime(n). a(n) = number of primes q less than p, such that both p-q+1 and p-q-1 are primes.

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 3, 2, 4, 3, 2, 3, 4, 3, 5, 4, 5, 3, 3, 6, 5, 6, 6, 6, 3, 7, 5, 5, 6, 9, 4, 8, 3, 7, 7, 5, 6, 5, 7, 6, 8, 8, 9, 5, 10, 9, 12, 8, 6, 8, 9, 13, 10, 12, 9, 8, 12, 9, 7, 14, 9, 10, 8, 13, 9, 9, 11, 10, 6, 13, 12, 11, 8, 9, 17, 9, 12, 6, 11, 14
Offset: 1

Views

Author

Jayanta Basu, Apr 22 2013

Keywords

Examples

			For n=3, p=5, there are no primes q(<5) such that both 5-q+1 and 5-q-1 are primes and hence a(3)=0. Also for n=5, p=11, there are a(5)=2 solutions 5,7 since 11-5+1=7, 11-5-1=5 and 11-7+1=5, 11-7-1=3.
		

Crossrefs

Programs

Showing 1-10 of 13 results. Next