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

A029710 Primes such that next prime is 4 greater.

Original entry on oeis.org

7, 13, 19, 37, 43, 67, 79, 97, 103, 109, 127, 163, 193, 223, 229, 277, 307, 313, 349, 379, 397, 439, 457, 463, 487, 499, 613, 643, 673, 739, 757, 769, 823, 853, 859, 877, 883, 907, 937, 967, 1009, 1087, 1093, 1213, 1279, 1297, 1303, 1423, 1429
Offset: 1

Views

Author

Keywords

Comments

Union with A124588 gives A124589. - Reinhard Zumkeller, Dec 23 2006
For any prime p > 3, if p + 4 is prime then necessarily it is the next prime. But there cannot be three consecutive primes with mutual distance 4: If p and p + 4 are prime, then p+8 is an odd multiple of 3 (cf. formula). - M. F. Hasler, Jan 15 2013
The smaller members p of cousin prime pairs (p,p+4) excluding p=3. - Marc Morgenegg, Apr 19 2016

Examples

			79 is a term as the next prime is 79 + 4 = 83. 3 is not a term even though 3 + 4 = 7 is prime, since it is not the next one.
		

Crossrefs

Essentially the same as A023200.

Programs

  • MATLAB
    p=primes(1700);m=1;
    for u=1:length(p)-4
       if and(isprime(p(u)+4)==1,p(u+1)==p(u)+4);sol(m)=p(u);m=m+1;end
    end
    sol % Marius A. Burtea, Jan 24 2019
  • Magma
    [p:p in PrimesUpTo(1700)| IsPrime(p+4) and NextPrime(p) eq p+4] // Marius A. Burtea, Jan 24 2019
    
  • Maple
    for i from 1 to 226 do if ithprime(i+1) = ithprime(i) + 4 then print({ithprime(i)}); fi; od; # Zerinvary Lajos, Mar 19 2007
  • Mathematica
    Select[Prime[Range[225]], NextPrime[#] == # + 4 &] (* Alonso del Arte, Jan 17 2013 *)
    Transpose[Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==4&]] [[1]] (* Harvey P. Dale, Mar 28 2016 *)
  • PARI
    forprime(p=1, 1e4, if(nextprime(p+1)-p==4, print1(p, ", "))) \\ Felix Fröhlich, Aug 16 2014
    

Formula

a(n) = A031505(n + 1) - 4 = A029708(n) - 2.
a(n) = 1 (mod 6) for all n; (a(n) + 2)/3 = A157834(n), i.e., a(n) = 3*A157834(n) - 2. - M. F. Hasler, Jan 15 2013

A124589 Primes p such that q-p <= 4, where q is the next prime after p.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 29, 37, 41, 43, 59, 67, 71, 79, 97, 101, 103, 107, 109, 127, 137, 149, 163, 179, 191, 193, 197, 223, 227, 229, 239, 269, 277, 281, 307, 311, 313, 347, 349, 379, 397, 419, 431, 439, 457, 461, 463, 487, 499, 521, 569, 599, 613, 617, 641, 643, 659
Offset: 1

Views

Author

N. J. A. Sloane, Dec 19 2006

Keywords

Comments

Union of A124588 and A029710; complement of A124582. - Reinhard Zumkeller, Dec 23 2006

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[200]],2,1],Last[#]-First[#]<5&]][[1]] (* Harvey P. Dale, Apr 22 2013 *)
  • PARI
    is(n)=isprime(n) && (isprime(n+2) || isprime(n+4) || n==2) \\ Charles R Greathouse IV, Jun 01 2016

Formula

a(n) >> n log^2 n. Infinite under standard conjectures. - Charles R Greathouse IV, Jun 01 2016

A192175 Array of primes determined by distance to next prime, by antidiagonals.

Original entry on oeis.org

2, 3, 7, 5, 13, 23, 11, 19, 31, 89, 17, 37, 47, 359, 139, 29, 43, 53, 389, 181, 199, 41, 67, 61, 401, 241, 211, 113, 59, 79, 73, 449, 283, 467, 293, 1831, 71, 97, 83, 479, 337, 509, 317, 1933, 523, 101, 103, 131, 491, 409, 619, 773, 2113, 1069, 887, 107
Offset: 1

Views

Author

Clark Kimberling, Jun 24 2011

Keywords

Comments

Row 1: primes p such that p+1 or p+2 is a prime.
Row r>1: primes p such that the least h for which p+2h is prime is r.

Examples

			Northwest corner:
  2.....3.....5.....11....17....29....41
  7.....13....19....37....43....67....79
  23....31....47....53....61....73....83
  89....359...389...401...449...479...491
  139...181...241...283...337...409...421
For example, 31 is in row 3 because 31+2*3 is a prime, unlike 31+2*1 and 31+2*2.  Every prime occurs exactly once.  For each row, it is not known whether it is finite.
		

Crossrefs

Programs

  • Mathematica
    z = 5000; (* z=number of primes used *)
    row[1] = (#1[[1]] &) /@ Cases[Array[{#1,
          PrimeQ[1 + Prime[#1]] || PrimeQ[2 + Prime[#1]]} &, {z}], {_, True}];
    Do[row[x] = Complement[(#1[[1]] &) /@ Cases[Array[{#1, PrimeQ[2 x + Prime[#1]]} &, {z}], {_, True}], Flatten[Array[row, {x - 1}]]], {x, 2, 16}]; TableForm[Array[Prime[row[#]] &, {10}]] (* A192175 array *)
    Flatten[Table[ Prime[row[k][[n - k + 1]]], {n, 1, 11}, {k, 1, n}]] (* A192175 sequence *)
    (* Peter J. C. Moses, Jun 20 2011 *)

A238691 a(n) = A190339(n)/A224911(n).

Original entry on oeis.org

1, 2, 3, 15, 15, 21, 1155, 165, 2145, 51051, 255255, 440895, 440895, 969, 111435, 248834355, 248834355, 2927463, 5898837945, 44352165, 1641030105, 8563193457, 42815967285, 80047243185, 1360803134145, 32898537309, 7731156267615, 1028243783592795, 1028243783592795, 375840831244263
Offset: 0

Views

Author

Paul Curtz, Mar 03 2014

Keywords

Comments

Are non-repeated terms of A224911(n) (2,3,5,11,17,...) A124588(n+1)?
Are repeated terms of A224911(n) (7,13,19,23,31,37,...) A049591(n+1)? At that sequence, Benoit Cloitre mentions a link to the Bernoulli numbers.
Greatest primes dividing a(n): 1, 2, 3, 5, 5, 7, 11, 11, 13, 17, 17, 19, 19, 19, 23, 29, 29, 29, ... = b(n). It appears that b(n) is A224911(n) with A008578(n), ancient primes, instead of A000040(n).
Hence c(n) = 2, 6, 15, 35, ... = 2, followed by A006094(n+1).

Examples

			a(0)=2/2=1, a(1)=6/3=2, a(2)=15/5=3, a(3)=a(4)=105/7=15, ... .
		

Crossrefs

Cf. A060308.

Programs

  • Mathematica
    nmax = 40; b[n_] := BernoulliB[n]; b[1] = 1/2; bb = Table[b[n], {n, 0, 2*nmax-1}]; diff = Table[Differences[bb, n], {n, 1, nmax}]; (#/FactorInteger[#][[-1, 1]])& /@ Denominator[Diagonal[diff]]

Extensions

a(16)-a(25) from Jean-François Alcover, Mar 03 2014

A152916 Tetrahedral numbers k*(k+1)*(k+2)/6 such that exactly two of k, k+1, and k+2 are prime.

Original entry on oeis.org

1, 4, 10, 35, 286, 969, 4495, 12341, 35990, 62196, 176851, 209934, 437989, 562475, 971970, 1179616, 1293699, 1975354, 2303960, 3280455, 3737581, 5061836, 7023974, 12347930, 13436856, 16435111, 23706021, 30865405, 35999900, 39338069
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 15 2008

Keywords

Examples

			k=1: Of the three numbers (1,2,3), exactly two are prime, so 1*2*3/6 = 1 is in the sequence.
k=2: Of the three numbers (2,3,4), exactly two are prime, so 2*3*4/6 = 4 is in the sequence.
k=4: Of the three numbers (4,5,6), exactly one is prime, so 4*5*6/6 = 20 is not in the sequence.
		

Crossrefs

Programs

  • Maple
    A000292 := proc(n) n*(n+1)*(n+2)/6; end: for n from 1 to 800 do ps := 0 ; if isprime(n) then ps := ps+1 ; fi; if isprime(n+1) then ps := ps+1 ; fi; if isprime(n+2) then ps := ps+1 ; fi; if ps = 2 then printf("%d,", A000292(n)) ; fi; od: # R. J. Mathar, Aug 14 2009

Formula

a(n) = A000292(A124588(n-1)), n > 1. - R. J. Mathar, Aug 14 2009

Extensions

Name and Example section clarified by Jon E. Schoenfield, Aug 06 2017

A178378 Products of 2 primes that are the difference of 2 primes.

Original entry on oeis.org

4, 6, 9, 10, 15, 22, 25, 33, 34, 51, 55, 58, 82, 85, 87, 118, 121, 123, 142, 145, 177, 187, 202, 205, 213, 214, 274, 289, 295, 298, 303, 319, 321, 355, 358, 382, 394, 411, 447, 451, 454, 478, 493, 505, 535, 537, 538, 562, 573, 591, 622, 649, 681, 685, 694, 697
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 26 2010

Keywords

Examples

			a(1)=4 because 4=2*2=(5-3)*(5-3) where 2,3,5 and 5-3 are all prime, a(2)=6 because 6=2*3=(5-3)*(5-2) where 2,3,5,5-3 and 5-2 are all prime.
		

Crossrefs

Formula

a(n)=A124588(m)*A124588(k).

Extensions

Extended beyond 478 by R. J. Mathar, May 28 2010

A178656 The positions of products of 2 primes that are the differences of 2 primes in A002808.

Original entry on oeis.org

1, 2, 4, 5, 8, 13, 15, 21, 22, 35, 38, 41, 59, 61, 63, 87, 90, 92, 107, 110, 136, 144, 155, 158, 165, 166, 215, 227, 232, 235, 240, 252, 254, 283, 286, 306, 316, 330, 360, 363, 366, 386, 398, 408, 435, 437, 438, 459, 467, 483, 507, 530, 557, 560, 568, 571, 589
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 01 2010

Keywords

Comments

The positions of A124588(m)*A124588(k) in A002808.

Formula

A002808(a(n))=A124588(m)*A124588(k).

Extensions

Corrected (254 inserted) by R. J. Mathar, Jun 04 2010
Showing 1-7 of 7 results.