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 16 results. Next

A339415 Table read by rows. If p=A098058(n+1), q is the next prime after p, and r=(p+q)/2, row n consists of the areas (in increasing order) of triangles with vertices (p,p), (s,r-s), (q,q), where s and r-s are prime.

Original entry on oeis.org

0, 0, 2, 4, 8, 0, 36, 60, 4, 8, 16, 0, 36, 72, 84, 4, 16, 20, 32, 36, 72, 108, 132, 54, 90, 150, 2, 14, 22, 26, 34, 46, 54, 90, 126, 162, 174, 10, 14, 34, 46, 50, 62, 54, 90, 126, 198, 210, 0, 144, 180, 216, 240, 16, 20, 40, 44, 56, 64, 76, 92, 14, 26, 34, 50, 70, 86, 94, 98, 14, 98, 182, 266
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Dec 03 2020

Keywords

Comments

If p = A098058(n+1), r is an even number >=4, and Goldbach's conjecture implies that r is the sum of primes s and r-s.
By symmetry, s and r-s produce the same area; only one of these is included in the table.
The row includes 0 if and only if r/2 is prime, i.e. p is in A339414.

Examples

			With p=A098058(5)=17, q=19, r=18, the values of s are 5, 7, 11, 13, corresponding to areas 4, 8, 8, 4 respectively, so row 4 is (4,8).
The first 10 rows are
0
0
2
4, 8
0, 36, 60
4, 8, 16
0, 36, 72, 84
4, 16, 20, 32
36, 72, 108, 132
54, 90, 150
		

Crossrefs

Programs

  • Maple
    R:= 0: count:= 1: q:= 5: nrows:= 1:
    printf("0\n"):
    while nrows < 20  do
      p:= q; q:= nextprime(q);
      if p+q mod 4 <> 0 then next fi;
      nrows:= nrows+1;
      r:= (p+q)/2;
      T:= select(t -> isprime(t) and isprime(r-t), [$ceil(r/2)..r]);
      count:= count + nops(T);
      V:= map(t -> abs((p-q)*(p+q-4*t)/4), T);
      R:= R, op(V);
      printf("%a\n",V);
    od:

Formula

The area of the triangle with vertices (p,p), (s,r-s), (q,q) is (q-p)*|p+q-4*s|/4.

A259311 First differences of A098058.

Original entry on oeis.org

1, 2, 6, 6, 6, 6, 2, 10, 6, 6, 6, 2, 10, 2, 10, 18, 6, 6, 18, 6, 2, 10, 2, 6, 10, 6, 6, 2, 10, 6, 30, 6, 6, 2, 10, 6, 6, 6, 2, 10, 2, 10, 18, 6, 14, 6, 10, 6, 14, 6, 10, 26, 10, 2, 10, 2, 10, 18, 42, 18, 2, 18, 6, 10, 6, 6, 2, 6, 10, 6, 6, 2, 6, 10
Offset: 1

Views

Author

Zak Seidov, Jun 24 2015

Keywords

Comments

No term is divisible by 4, see comments in A098058.

Crossrefs

Cf. A098058.

Programs

  • PARI
    lista(n) = for(x=1, n, z=(prime(x+1)-prime(x)); if(z%4, print1(z, ", "))) \\ Michel Marcus, Jun 24 2015

Formula

a(n) = A098058(n+1)-A098058(n).

A154939 Primes p such that (p-1)*(p+1)-+p are primes.

Original entry on oeis.org

3, 5, 11, 31, 101, 131, 149, 181, 241, 331, 419, 449, 709, 1051, 1061, 1171, 1409, 1549, 1579, 1699, 1759, 1831, 2069, 3229, 3449, 3761, 3911, 4159, 4951, 5821, 6029, 6481, 6661, 6679, 6899, 7079, 7151, 7229, 7369, 8101, 8219, 8629, 8861, 9091, 9161, 9521
Offset: 1

Views

Author

Keywords

Comments

That is, primes p such that p^2+p-1 and p^2-p-1 are both primes: intersection of A053184 and A091567. - Michel Marcus, Jul 10 2016

Examples

			2*4=8-+3 -> primes, 4*6=24-+5 -> primes,...
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(10000) | IsPrime(p^2+p-1) and IsPrime(p^2-p-1)]; // Vincenzo Librandi, Jul 10 2016
  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[(p-1)*(p+1)-p]&&PrimeQ[(p-1)*(p+1)+p],AppendTo[lst,p]],{n,7!}];lst
    Select[Prime[Range[1500]], And@@PrimeQ/@{#^2 - # - 1, #^2 + # - 1} &] (* Vincenzo Librandi, Jul 10 2016 *)
    Select[Prime[Range[1500]],AllTrue[(#-1)(#+1)+{#,-#},PrimeQ]&] (* Harvey P. Dale, Sep 21 2023 *)

A098059 Primes preceding gaps divisible by 4.

Original entry on oeis.org

7, 13, 19, 37, 43, 67, 79, 89, 97, 103, 109, 127, 163, 193, 199, 211, 223, 229, 277, 307, 313, 349, 359, 379, 389, 397, 401, 439, 449, 457, 463, 467, 479, 487, 491, 499, 509, 613, 619, 643, 661, 673, 683, 701, 719, 739, 743, 757, 761, 769, 797, 823, 853, 859
Offset: 1

Views

Author

Cino Hilliard, Sep 11 2004

Keywords

Comments

Prime complement of A098058. - Robert G. Wilson v, Jul 17 2015

Examples

			7 is a term since the next prime after 7 is 11 and 11-7 is divisible by 4.
		

Crossrefs

Subsequence of A152087.

Programs

  • Maple
    N:= 1000:  # to get all terms up to the second-last prime <= N
    Primes:= select(isprime,[2, 2*i+1 $ i=1..floor((N-1)/2)]):
    Gaps:= Primes[2..-1] - Primes[1..-2]:
    Primes[select(t-> Gaps[t] mod 4 = 0, [$1..nops(Gaps)])]; # Robert Israel, Jun 24 2015
  • Mathematica
    Prime[Select[Range[150], Mod[Prime[ # + 1] - Prime[ # ], 4] == 0 &]] (* Ray Chandler, Oct 26 2006 *)
    Transpose[Select[Partition[Prime[Range[200]],2,1],Divisible[Last[#]- First[#], 4]&]][[1]] (* Harvey P. Dale, Apr 06 2013 *)
  • PARI
    f(n) = for(x=1,n,z=(prime(x+1)-prime(x));if(z%4==0,print1(prime(x)",")))
    
  • PARI
    p=2; forprime(q=3,1e4, if((q-p)%4==0, print1(p", ")); p=q) \\ Charles R Greathouse IV, Jun 29 2015

Formula

a(n) ~ 2n log n. - Charles R Greathouse IV, Jun 29 2015

Extensions

Edited by Ray Chandler, Oct 26 2006
New name from Robert Israel and Charles R Greathouse IV, Jun 29 2015

A155006 Primes p such that (p-2)*(p+2)-+2*p are primes.

Original entry on oeis.org

5, 7, 13, 23, 37, 43, 73, 167, 233, 263, 433, 557, 587, 593, 607, 727, 857, 1153, 1597, 1627, 1753, 2143, 2663, 2713, 3433, 3607, 3863, 3947, 4027, 4363, 4423, 4673, 5147, 5477, 5623, 5807, 5903, 6277, 7237, 7333, 7577, 8287, 8647, 8837, 8887, 9043, 10067
Offset: 1

Views

Author

Keywords

Comments

3*7-10=11, 3*7+10=31,...

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[(p-2)*(p+2)-2*p]&&PrimeQ[(p-2)*(p+2)+2*p],AppendTo[lst,p]],{n,7!}];lst
    Select[Prime[Range[1500]],AllTrue[(#-2)(#+2)+{2#,-2#},PrimeQ]&] (* Harvey P. Dale, Jan 01 2025 *)

A253969 Primes p such that p + nextprime(p) is divisible by 6.

Original entry on oeis.org

5, 7, 11, 13, 17, 19, 29, 37, 41, 43, 59, 67, 71, 79, 89, 97, 101, 103, 107, 109, 113, 127, 137, 139, 149, 163, 179, 181, 191, 193, 197, 223, 227, 229, 239, 241, 269, 277, 281, 283, 293, 307, 311, 313, 317, 337, 347, 349, 359, 379, 389, 397, 401, 409, 419, 421
Offset: 1

Views

Author

Vincenzo Librandi, Jan 21 2015

Keywords

Comments

Sequence provides all primes p such that p + nextprime(p) is divisible by 3 (see Crossrefs).

Examples

			p=19 is in this sequence because 19+23 = 42 is divisible by 6.
		

Crossrefs

Cf. sum of prime p and next prime after p is divisible by k: A000040 (k=2, after the first term), this sequence (k=3, k=6), A098058(k=4, after the first term), A253970 (k=5; k=10 without 2), A179849 (k=7), A253972 (k=8), A253973 (k=9).

Programs

  • Magma
    [p: p in PrimesUpTo(500) | (p+NextPrime(p)) mod 6 eq 0];
    
  • Mathematica
    Prime@Select[Range[200], Mod[Prime[#] + Prime[# + 1], 6]==0 &]
    Select[Partition[Prime[Range[100]],2,1],Divisible[Total[#],6]&][[All,1]] (* Harvey P. Dale, Jan 20 2018 *)
  • PARI
    forprime(p=1,10^3,if(!((p+nextprime(p+1))%6),print1(p,", "))) \\ Derek Orr, Jan 30 2015

A289118 Least prime beginning a string, of length at least n, of consecutive primes which alternate between types 4*k+1 and 4*k+3 or 4*k+3 and 4*k+1.

Original entry on oeis.org

3, 3, 3, 23, 47, 131, 131, 233, 233, 521, 521, 521, 521, 521, 521, 51749, 505049, 1391087, 2264839, 2556713, 2569529, 2569529, 6160043, 6160043, 6160043, 43679609, 43679609, 198572029, 701575297, 5552898499, 6639843979, 9005520203, 9005520203, 99052377023
Offset: 1

Views

Author

Jonathan Sondow, Jun 25 2017

Keywords

Comments

Conjecture: the sequence is infinite. (Motivation: the string HTHTHT. . of length n eventually occurs in any sufficiently long sequence of coin tosses.)

Examples

			{Prime[k], Mod[ Prime[k], 4]} = {{3, 3}, {5, 1}, {7, 3}, {11, 3}, {13, 1}, {17, 1}, {19, 3}, {23, 3}, {29, 1}}, {31, 3}, {37, 1}, . . for k = 2, 3, 4, . ., so a(n) = 3, 3, 3, 23 for n = 1, 2, 3, 4.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A4.

Crossrefs

For the least prime at the start of such a string of length exactly n, see A247384.

Programs

  • Mathematica
    j = 2; T = Table[ While[ Product[ Mod[ Prime[k + 1] - Prime[k], 4], {k, j, j + n}] == 0,  j++]; Prime[j], {n, 0, 15}]; Prepend[T, 3]

Formula

a(n) = A247384(n) if and only if n > 1 and a(n) < a(n+1).

Extensions

a(18)-a(27) from Alois P. Heinz, Jun 26 2017
a(28)-a(34) from Giovanni Resta, Jul 02 2017

A155007 Primes p such that (p-3)*(p+3)-+3*p are primes.

Original entry on oeis.org

7, 17, 37, 113, 157, 227, 283, 293, 313, 347, 443, 587, 787, 883, 1063, 1097, 1237, 1303, 1327, 1427, 1567, 1723, 1933, 1973, 2087, 2347, 2467, 2687, 2777, 3457, 3593, 4447, 4703, 4793, 4967, 5737, 5827, 6317, 6607, 6793, 6857, 8297, 8563, 8803, 9433
Offset: 1

Views

Author

Keywords

Comments

4*10-3*7=19, 4*10+3*7=61, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[(p-3)*(p+3)-3*p]&&PrimeQ[(p-3)*(p+3)+3*p],AppendTo[lst,p]],{n,7!}];lst

A247384 Find the first (maximal) string of consecutive primes of length exactly n which alternate between 4*k+1 and 4*k+3 or 4*k+3 and 4*k+1 as in A002144(4*n+1) and A002145(4*n+3). The first element is a(n).

Original entry on oeis.org

97, 11, 3, 23, 47, 167, 131, 2011, 233, 23633, 34499, 1013, 9341, 90659, 521, 51749, 505049, 1391087, 2264839, 2556713, 17123893, 2569529, 15090641, 18246451, 6160043, 1557431471, 43679609, 198572029, 701575297, 5552898499, 6639843979, 61233611783, 9005520203
Offset: 1

Views

Author

J. M. Bergot, Sep 15 2014

Keywords

Examples

			a(4)=23 because 23,29,31,37 alternate 4*n+3,4*n+1,4*n+3,4*n+1 for exactly four primes and 23 is the least prime for a string of exactly four.
		

Crossrefs

Programs

  • Maple
    Primes:= select(isprime,[seq(2*i+1,i=1..10^7)]):
    Pm4:= map(`modp`,[seq((-1)^j*Primes[j],j=1..nops(Primes))],4):
    Starts:= [1,op(select(t -> Pm4[t-1]<> Pm4[t], [$2..nops(Pm4)]))]:
    Lengths:= [seq(Starts[i+1]-Starts[i],i=1..nops(Starts)-1)]:
    for i from 1 to max(Lengths) do A[i]:= ListTools:-Search(i,Lengths) od:
    R:=[seq(A[i],i=1..max(Lengths))]:
    seq(`if`(a=0,0,Primes[Starts[a]]),a=R); # Robert Israel, Sep 15 2014
  • Mathematica
    i = 2; While[ Mod[ Prime[i] - Prime[i - 1], 4] != 0 || Mod[ Prime[i + 1] - Prime[i], 4] != 0, i++]; T = {Prime[i]}; Do[j = 2; While[! (Product[ Mod[ Prime[k + 1] - Prime[k], 4], {k, j, j + n}] != 0 && (Mod[Prime[j] - Prime[j - 1], 4] == 0 || j == 2) && Mod[ Prime[j + n + 2] - Prime[j + n + 1], 4] == 0), j++]; T = Append[T, Prime[j]], {n, 0, 13}]; T (* Jonathan Sondow, Jun 28 2017 *)
  • PARI
    v=vector(100);v[1]=7;cur=1;p=3;forprime(q=5, 1e10, if((q-p)%4==0,if(!v[cur],v[cur]=back(p,cur);print("a("cur") = "v[cur]));cur=1,cur++);p=q) \\ Charles R Greathouse IV, Sep 15 2014

Formula

a(n) = A289118(n) if and only if n > 1 and A289118(n) < A289118(n+1). - Jonathan Sondow, Jun 27 2017

Extensions

More terms from Jens Kruse Andersen, Oct 01 2014
Definition clarified by Jonathan Sondow, Jun 25 2017

A155008 Primes p such that (p-a)*(p+a)-+a*p are primes,a=4.

Original entry on oeis.org

3, 5, 7, 11, 19, 29, 31, 59, 101, 139, 239, 271, 829, 1031, 1201, 1439, 1511, 1531, 2251, 2609, 3929, 4349, 4969, 5449, 5639, 5711, 5801, 5881, 5981, 6521, 6569, 6701, 6949, 6959, 8221, 8831, 9001, 9181, 9209, 9419, 9511, 9929, 10139, 10711, 11839, 11981
Offset: 1

Views

Author

Keywords

Comments

3*11-28=5, 3*11+28=61, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n];If[PrimeQ[(p-4)*(p+4)-4*p]&&PrimeQ[(p-4)*(p+4)+4*p],AppendTo[lst,p]],{n,7!}];lst
    Select[Prime[Range[1500]],AllTrue[(#-4)(#+4)+{4#,-4#},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 27 2020 *)
Showing 1-10 of 16 results. Next