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

A095924 a(n) is the smallest prime of earliest set of at least n consecutive good primes version 1 (see A046869).

Original entry on oeis.org

5, 37, 211, 251, 32467, 96377, 96377, 5647409, 12285587, 202924901, 3916407479, 108233238469, 1279155333257
Offset: 1

Views

Author

Enoch Haga and Farideh Firoozbakht, Jul 12 2004

Keywords

Examples

			A good prime (version 1) is a prime p = prime(n) such that prime(n)^2 > prime(n-1)*prime(n+1), so 5 is a good prime because 5 = prime(3); prime(2) = 3; prime(4) = 7 and 5^2 > 3*7.
a(11) = 3916407479 because the 11 consecutive primes 3916407479, 3916407527, 3916407569, 3916407611, 3916407653, 3916407679, 3916407697, 3916407713, 3916407727, 3916407739 and 3916407751 are good primes and 3916407479 is the smallest prime with this property.
		

Crossrefs

Programs

  • PARI
    lista(pmax) = {my(c = 0, cmax = 0, p1 = 2, p2 = 3, p); forprime(p3 = 5, pmax, if(p2^2 > p1*p3, c++, if(c > cmax, p = p1; for(i = 1, c-1, p = precprime(p-1)); for(i = 1, c-cmax, print1(p, ", ")); cmax = c); c = 0); p1 = p2; p2 = p3);} \\ Amiram Eldar, Apr 29 2024

Extensions

Name clarified and a(12)-a(13) added by Amiram Eldar, Apr 29 2024

A068829 Erroneous version of A046869.

Original entry on oeis.org

5, 17, 29, 37, 41, 53, 59, 67, 71, 79, 97, 101, 107, 127, 137, 149, 157, 163, 173, 179
Offset: 1

Views

Author

Keywords

A006562 Balanced primes (of order one): primes which are the average of the previous prime and the following prime.

Original entry on oeis.org

5, 53, 157, 173, 211, 257, 263, 373, 563, 593, 607, 653, 733, 947, 977, 1103, 1123, 1187, 1223, 1367, 1511, 1747, 1753, 1907, 2287, 2417, 2677, 2903, 2963, 3307, 3313, 3637, 3733, 4013, 4409, 4457, 4597, 4657, 4691, 4993, 5107, 5113, 5303, 5387, 5393
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A075540. - Franklin T. Adams-Watters, Jan 11 2006
This subsequence of A125830 and of A162174 gives primes of level (1,1): More generally, the i-th prime p(i) is of level (1,k) if and only if it has level 1 in A117563 and 2 p(i) - p(i+1) = p(i-k). - Rémi Eismann, Feb 15 2007
Note the similarity between plots of A006562 and A013916. - Bill McEachen, Sep 07 2009
Balanced primes U strong primes = good primes. Or, A006562 U A051634 = A046869. - Juri-Stepan Gerasimov, Mar 01 2010
Primes prime(n) such that A001223(n-1) = A001223(n). - Irina Gerasimova, Jul 11 2013
Numbers m such that A346399(m) is odd and >= 3. - Ya-Ping Lu, Dec 26 2021 and May 07 2024
"Balanced" means that the next and preceding gap are of the same size, i.e., the second difference A036263 vanishes; so these are the primes whose indices are 1 more than indices of zeros in A036263, listed in A064113. - M. F. Hasler, Oct 15 2024
Primes which are the average of three consecutive primes. - Peter Schorn, Apr 30 2025

Examples

			5 belongs to the sequence because 5 = (3 + 7)/2. Likewise 53 = (47 + 59)/2.
5 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (3, 5, 7).
53 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (47, 53, 59).
257 and 263 belong to the sequence because they are terms, but not first or last, of the AP of consecutive primes (251, 257, 263, 269).
		

References

  • A. Murthy, Smarandache Notions Journal, Vol. 11 N. 1-2-3 Spring 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.

Crossrefs

Primes A000040 whose indices are 1 more than A064113, indices of zeros in A036263 (second differences of the primes).
Cf. A225494 (multiplicative closure); complement of A178943 with respect to A000040.
Cf. A055380, A051795, A081415, A096710 for other balanced prime sequences.

Programs

  • Haskell
    a006562 n = a006562_list !! (n-1)
    a006562_list = filter ((== 1) . a010051) a075540_list
    -- Reinhard Zumkeller, Jan 20 2012
    
  • Haskell
    a006562 n = a006562_list !! (n-1)
    a006562_list = h a000040_list where
       h (p:qs@(q:r:ps)) = if 2 * q == (p + r) then q : h qs else h qs
    -- Reinhard Zumkeller, May 09 2013
    
  • Magma
    [a: n in [1..1000] | IsPrime(a) where a is NthPrime(n)-NthPrime(n+1)+NthPrime(n+2)]; // Vincenzo Librandi, Jun 23 2016
    
  • Mathematica
    Transpose[ Select[ Partition[ Prime[ Range[1000]], 3, 1], #[[2]] ==(#[[1]] + #[[3]])/2 &]][[2]]
    p=Prime[Range[1000]]; p[[Flatten[1+Position[Differences[p, 2], 0]]]]
    Prime[#]&/@SequencePosition[Differences[Prime[Range[800]]],{x_,x_}][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 31 2019 *)
  • PARI
    betwixtpr(n) = { local(c1,c2,x,y); for(x=2,n, c1=c2=0; for(y=prime(x-1)+1,prime(x)-1, if(!isprime(y),c1++); ); for(y=prime(x)+1,prime(x+1)-1, if(!isprime(y),c2++); ); if(c1==c2,print1(prime(x)",")) ) } \\ Cino Hilliard, Jan 25 2005
    
  • PARI
    forprime(p=1,999, p-precprime(n-1)==nextprime(p+1)-p && print1(p",")) \\ M. F. Hasler, Jun 01 2013
    
  • PARI
    is(n)=n-precprime(n-1)==nextprime(n+1)-n && isprime(n) \\ Charles R Greathouse IV, Apr 07 2016
    
  • Python
    from sympy import nextprime; p, q, r = 2, 3, 5
    while q < 6000:
        if 2*q == p + r: print(q, end = ", ")
        p, q, r = q, r, nextprime(r) # Ya-Ping Lu, Dec 23 2021

Formula

2*p_n = p_(n-1) + p_(n+1).
Equals { p = prime(k) | A118534(k) = prime(k-1) }. - Rémi Eismann, Nov 30 2009
a(n) = A000040(A064113(n) + 1) = (A122535(n) + A181424(n)) / 2. - Reinhard Zumkeller, Jan 20 2012
a(n) = A122535(n) + A117217(n). - Zak Seidov, Feb 14 2013
Equals A145025 intersect A000040 = A145025 \ A024675. - M. F. Hasler, Jun 01 2013
Conjecture: Limit_{n->oo} n*(log(a(n)))^2 / a(n) = 1/2. - Alain Rocchelli, Mar 21 2024
Conjecture: The asymptotic limit of the average of a(n+1)-a(n) is equivalent to 2*(log(a(n)))^2. Otherwise formulated: 2 * Sum_{n=1..N} (log(a(n)))^2 ~ a(N). - Alain Rocchelli, Mar 23 2024

Extensions

Reworded comment and added formula from R. Eismann. - M. F. Hasler, Nov 30 2009
Edited by Daniel Forgues, Jan 15 2011

A028388 Good primes (version 2): prime(n) such that prime(n)^2 > prime(n-i)*prime(n+i) for all 1 <= i <= n-1.

Original entry on oeis.org

5, 11, 17, 29, 37, 41, 53, 59, 67, 71, 97, 101, 127, 149, 179, 191, 223, 227, 251, 257, 269, 307, 311, 331, 347, 419, 431, 541, 557, 563, 569, 587, 593, 599, 641, 727, 733, 739, 809, 821, 853, 929, 937, 967, 1009, 1031, 1087, 1151, 1213, 1277
Offset: 1

Views

Author

Keywords

Comments

Selfridge conjectured, and Pomerance proved, that there are infinitely many numbers in this sequence. Pomerance asks if the sequence has density 0. - Charles R Greathouse IV, Apr 14 2011

References

  • Guy, R. K. `Good' Primes and the Prime Number Graph. A14 in Unsolved Problems in Number Theory, 2nd ed. Springer-Verlag, pp. 32-33, 1994.

Crossrefs

Cf. A046869.

Programs

  • Magma
    [NthPrime(n): n in [2..220] | forall{i: i in [1..n-1] | NthPrime(n)^2 gt NthPrime(n-i)*NthPrime(n+i)}]; // Bruno Berselli, Oct 23 2012
    
  • Mathematica
    Module[{nn=300,prs},prs=Prime[Range[2nn]];qprQ[n_]:=Module[{pi= PrimePi[n]}, n^2>Max[Times@@@Thread[{Take[prs,pi-1],Reverse[Take[ prs,{pi+1,2 pi-1}]]}]]];Select[Take[prs,nn],qprQ]] (* Harvey P. Dale, May 13 2012 *)
  • PARI
    is(n)=if(!isprime(n),return(0));my(p=n,q=n,n2=n^2);while(p>2, p=precprime(p-1); q=nextprime(q+1); if(n22 \\ Charles R Greathouse IV, Jul 02 2013

A046868 Numbers n such that prime(n)^2 > prime(n-1)*prime(n+1).

Original entry on oeis.org

3, 5, 7, 10, 12, 13, 16, 17, 19, 20, 22, 25, 26, 28, 31, 33, 35, 37, 38, 40, 41, 43, 45, 47, 48, 49, 52, 54, 55, 56, 57, 59, 60, 63, 64, 67, 69, 73, 74, 75, 78, 81, 83, 85, 88, 89, 92, 93, 95, 98, 100, 102, 103, 104, 107, 108, 109, 111, 112, 113, 115, 116, 119, 120, 122
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A046869.

Programs

  • Mathematica
    Select[Range[2, 122], Prime[#]^2 > Prime[# - 1]*Prime[# + 1] &] (* Jayanta Basu, Jun 29 2013 *)

Extensions

Extended by Don Reble, Nov 19 2006

A068828 Geometrically weak primes: primes that are smaller than the geometric mean of their neighbors (2 is included by convention).

Original entry on oeis.org

2, 3, 7, 13, 19, 23, 31, 43, 47, 61, 73, 83, 89, 103, 109, 113, 131, 139, 151, 167, 181, 193, 199, 229, 233, 241, 271, 283, 293, 313, 317, 337, 349, 353, 359, 383, 389, 401, 409, 421, 433, 443, 449, 463, 467, 491, 503, 509, 523, 547, 571, 577, 601, 619, 643
Offset: 1

Views

Author

Amarnath Murthy, Mar 08 2002

Keywords

Comments

Or, bad primes (version 1): primes not in A046869. - Jonathan Vos Post, Aug 20 2007
The idea can be extended by defining a geometrically weak prime of order k to be a prime which is less than the geometric mean of r neighbors on both sides for all r = 1 to k and not true for r = k+1. A similar extension could be defined for the sequence A051635.
It is easy to show that, except for the twin prime pair (3,5), the larger prime of every twin prime pair is in this sequence. The smaller prime of the pair is always in A046869. - T. D. Noe, Feb 19 2008

Examples

			23 belongs to this sequence as 23^2 = 529 < 19*29 = 551.
		

Crossrefs

Programs

  • Mathematica
    Join[{2}, Prime[Select[Range[2, 120], Prime[ # ]^2 <= Prime[ # - 1]*Prime[ # + 1]&]]] (* Stefan Steinerberger, Aug 21 2007 *)
    Join[{2},Transpose[Select[Partition[Prime[Range[500]],3,1],#[[2]]< GeometricMean[ {#[[1]],#[[3]]}]&]][[2]]] (* Harvey P. Dale, Apr 05 2014 *)

Formula

prime(k)^2 <= prime(k-1)*prime(k+1).

Extensions

Corrected and extended by Stefan Steinerberger, Aug 21 2007
Edited by N. J. A. Sloane, Feb 19 2008

A130903 Bad primes (version 2). Primes not in A028388.

Original entry on oeis.org

2, 3, 7, 13, 19, 23, 31, 43, 47, 61, 73, 79, 83, 89, 103, 107, 109, 113, 131, 137, 139, 151, 157, 163, 167, 173, 181, 193, 197, 199, 211, 229, 233, 239, 241, 263, 271, 277, 281, 283, 293, 313, 317, 337, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 421
Offset: 1

Views

Author

Jonathan Vos Post, Aug 22 2007

Keywords

Crossrefs

Programs

  • Maple
    isA028388 := proc(p) local a,n,pmin,pplu; if isprime(p) then a := true ; if p < 5 then RETURN(false) ; fi ; pmin := p ; pplu := p ; while pmin > 2 do pmin := prevprime(pmin) ; pplu := nextprime(pplu) ; if p^2 <= pmin*pplu then a := false ; break ; fi ; od: RETURN(a) ; else RETURN(false) ; fi ; end: isA130903 := proc(p) if not isprime(p) then RETURN(false) ; else RETURN(not isA028388(p)) ; fi ; end: for i from 1 to 100 do p := ithprime(i) ; if isA130903(p) then printf("%d,",p) ; fi ; od: # R. J. Mathar, Sep 02 2007

Formula

{p in A000040 and p not in A028388}.

Extensions

Corrected and extended by R. J. Mathar, Sep 02 2007

A349793 Primes which are the nearest integer to the harmonic mean of the previous prime and the following prime.

Original entry on oeis.org

3, 7, 13, 23, 47, 89, 157, 173, 257, 263, 373, 563, 593, 607, 653, 733, 947, 977, 1103, 1123, 1187, 1223, 1367, 1511, 1747, 1753, 1907, 2287, 2417, 2677, 2903, 2963, 3307, 3313, 3637, 3733, 4013, 4409, 4457, 4597, 4657, 4691, 4993, 5107, 5113, 5303, 5387, 5393
Offset: 1

Views

Author

Hugo Pfoertner, Nov 30 2021

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[750]],3,1],Round[HarmonicMean[{#[[1]],#[[3]]}]]==#[[2]]&][[;;,2]] (* Harvey P. Dale, Dec 29 2024 *)
  • PARI
    a349793(limit) = {my(p1=2,p2=3); forprime(p3=5, limit, my(hm=round((2*p1*p3)/(p1+p3))); if(p2==hm, print1(p2,", ")); p1=p2;p2=p3)};
    a349793(5500)

A095957 a(n) is the smallest prime of earlier set of n consecutive good primes version 2 (see A028388).

Original entry on oeis.org

5, 37, 557, 1847, 216703, 6929381, 134193727, 15118087477
Offset: 1

Views

Author

Keywords

References

  • Puzzle 273 of The Prime Puzzles & Problem Connection (www.primepuzzles.net).

Crossrefs

Extensions

a(7) found by Jim Fougeron (jfoug(AT)kdsi.net), Aug 25 2004

A139312 Characteristic function of the good primes (version 1).

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, Jun 07 2008

Keywords

Comments

a(n)=1 if prime(n)^2 - prime(n-1)*prime(n+1) >=0, else a(n)=0.

Crossrefs

Programs

  • Mathematica
    f[n_] := If[ Prime[n]^2 - Prime[n - 1]*Prime[n + 1] > 0, 1, 0]; Array[f, 105, 2] (*alternative formula: derived*) Solve[x^2 - (x - a)*(x + b) == 0, x]; a = -Prime[n - 1] + Prime[n]; b = -Prime[n] + Prime[n + 1]; f[n_] = If[-Prime[-1 + n] + 2 Prime[n] - Prime[1 + n] == 0, 0, a*b/(b - a)]; Table[ If[ f[n] > 0, 0, 1], {n, 2, 106}]
    If[#[[2]]^2-(#[[1]]#[[3]])>=0,1,0]&/@Partition[Prime[Range[110]],3,1] (* Harvey P. Dale, Jan 25 2015 *)
  • PARI
    a(n)=my(p=prime(n));p^2>=precprime(p-1)*nextprime(p+1) \\ Charles R Greathouse IV, Jun 24 2011

Formula

a(n) = 1 if A056221(n-1)<=0, else a(n)=0.

Extensions

All entries corrected. - R. J. Mathar, Charles R Greathouse IV Robert G. Wilson v, Jun 16 2011
Showing 1-10 of 11 results. Next