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

A125830 Primes for which the level is equal to 1 in A117563.

Original entry on oeis.org

5, 13, 23, 31, 47, 53, 73, 157, 173, 211, 233, 257, 263, 353, 373, 563, 593, 607, 619, 647, 653, 733, 947, 977, 1069, 1097, 1103, 1123, 1187, 1223, 1283, 1367, 1433, 1453, 1459, 1493, 1499, 1511, 1613, 1709, 1747, 1753, 1759, 1789, 1889, 1907, 2099, 2161
Offset: 1

Views

Author

Rémi Eismann, Feb 03 2007

Keywords

Comments

This sequence is equal to 13, 31, A006562, A117876, A118467, ..., A125623, ... Let p(n) denote the n-th prime. If 2 p(n) - p(n+1) is a prime, say p(n-i) and if p(n) has a level 1 in A117563, then we say that p(n) has level(1,i). Primes of level (1,1) form the sequence A006562. 13 and 31 have a level 1 but not sublevel i.

Crossrefs

A117873 Primes for which the level as defined in A117563 is 3.

Original entry on oeis.org

11, 19, 37, 43, 97, 113, 127, 139, 163, 223, 307, 313, 317, 337, 389, 397, 401, 421, 457, 479, 547, 673, 691, 709, 757, 761, 853, 863, 883, 929, 937, 953, 1021, 1051, 1109, 1297, 1303, 1327, 1399, 1471, 1567, 1571, 1583, 1693, 1699, 1723, 1783, 1951, 2029
Offset: 1

Views

Author

Rémi Eismann, May 02 2006

Keywords

Examples

			13 = 11 + 11 mod 3 = 11 + 11 mod 9, level = 3
701 = 691 + 691 mod 227 = 691 + 691 mod 681, level = 3
6907 = 6899 + 6899 mod 2297 = 6899 + 6899 mod 6891, level = 3
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{d, j = 2, p = Prime@n}, d = Prime[n + 1] - p; While[j < p && Mod[p, j] != d, j++ ]; If[j == p, 0, j]]; g[n_] := Block[{d, k = p = Prime@n}, d = Prime[n + 1] - p; While[k > 0 && Mod[p, k] != d, k-- ]; If[k == 0, 0, k]]; h[n_] := Block[{a = f@n, b = g@n}, If[a == 0, 0, b/a]]; Prime@Select[ Range@327, h@# == 3 &] (* Robert G. Wilson v *)

Extensions

More terms from Robert G. Wilson v, May 06 2006

A117874 Primes for which the level is equal to 5 in A117563.

Original entry on oeis.org

17, 61, 131, 151, 271, 523, 541, 571, 751, 797, 971, 991, 997, 1291, 1321, 1361, 1741, 1901, 1913, 2011, 2179, 2297, 2341, 2441, 2447, 2551, 2791, 2851, 3301, 3511, 3761, 3803, 4051, 4391, 4397, 4423, 4441, 4561, 4651, 4703, 4759, 5101, 5471, 5483, 5521
Offset: 1

Views

Author

Rémi Eismann, May 02 2006

Keywords

Examples

			19=17+17 mod(3)=17+17 mod(15), level=5
157=151+151 mod(29)=151+151 mod(145) level=5
2203=2179+2179 mod(431)=2179+2179 mod(2155), level=5
		

Crossrefs

Cf. A117078.

Programs

  • Mathematica
    f[n_] := Block[{d, j = 2, p = Prime@n}, d = Prime[n + 1] - p; While[j < p && Mod[p, j] != d, j++ ]; If[j == p, 0, j]]; g[n_] := Block[{d, k = p = Prime@n}, d = Prime[n + 1] - p; While[k > 0 && Mod[p, k] != d, k-- ]; If[k == 0, 0, k]]; h[n_] := Block[{a = f@n, b = g@n}, If[a == 0, 0, b/a]]; Prime@Select[ Range@763, h@# == 5 &] (* Robert G. Wilson v *)

Extensions

More terms from Robert G. Wilson v, May 06 2006
Edited by N. J. A. Sloane, May 14 2006

A118481 Primes for which the level is equal to 9 in A117563.

Original entry on oeis.org

29, 67, 89, 181, 293, 811, 919, 1153, 1801, 2017, 2053, 2113, 2647, 3373, 3469, 3583, 4057, 5153, 5581, 6481, 6553, 7727, 8209, 8447, 8467, 8543, 8867, 9887, 10009, 10477, 11027, 11743, 12601, 13249, 13421, 13729, 13789, 15017, 15391, 17011, 17123, 18919
Offset: 1

Views

Author

Rémi Eismann, May 05 2006

Keywords

Examples

			Prime(310) has level 9: prime(311) = prime(310)+prime(310) mod(227) = prime(310)+prime(310) mod(2043) = 2063
		

Crossrefs

Extensions

Edited by N. J. A. Sloane, May 14 2006
Term a(19) and beyond from b-file by Andrew Howroyd, Feb 05 2018

A121155 Primes for which A117078(n) is equal to A117563(n) and A117563(n) is different from 0.

Original entry on oeis.org

11, 89, 367, 3727, 5059, 7927, 38821, 94261, 160807, 727621, 908221, 942847, 1274671, 1985287, 2042059, 2105407, 2411821, 4068301, 4464781, 4748077, 5004193, 5331511, 5678713, 5755219, 7349527, 8288647, 9138541, 9369727
Offset: 1

Views

Author

Rémi Eismann, Aug 13 2006; corrected Oct 11 2006, Sep 16 2008

Keywords

Comments

A118534(n) = A117078(n) * A117563(n) = A117078(n)^2 = A117563(n)^2.

Examples

			Prime(6) = prime (5) + mod(prime(5);3) = prime (5) + mod(prime(5);9), level(5)=9/3=3, A117078(5) = A117563(5) = 3.
Prime(369935) = prime (369934) + mod(prime(369934); 2309) = prime (369934) + mod(prime(369934); 5331481), level(369934)=5331481/2309=2309, A117078(369934) = A117563(369934) = 2309.
		

Crossrefs

Extensions

More terms from Fabien Sibenaler, Oct 20 2006

A118122 Least prime of level 2n-1 (cf. A117563).

Original entry on oeis.org

5, 11, 17, 509, 29, 83, 41, 79, 887, 59, 109, 71, 331, 193, 383, 190717, 101, 107, 787, 277, 1129, 911, 137, 1181, 149, 463, 1013, 839, 1087, 179, 433, 191, 197, 4093, 349, 503, 2423, 227, 701, 239, 5378731, 587, 601, 439, 269, 6491, 281, 1621, 877, 499
Offset: 1

Views

Author

Keywords

Examples

			The first occurrence of 1 in A117563 is a(3) which implies the third prime which is 5.
The first occurrence of 3 in A117562 is a(5) which implies the fifth prime which is 11.
The first occurrence of 5 in A117562 is a(7) which implies the seventh prime which is 17, etc.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := If[n == 1, 0, Block[{p = Prime@n, np = Prime[n + 1]}, (2p - np)/Min@Select[Divisors[2p - np], # >= np - p &]]]; t = Table[0, {100}]; Do[a = (f@n + 1)/2; If[a < 101 && t[[a]] == 0, t[[a]] = Prime@n; Print[{a, n, Prime@n}]], {n, 10^6}]

Formula

Levels of primes are defined in A117563. Conjecture: there are an infinite number of prime members at each level.

A118574 Primes for which the level is equal to 79 in A117563.

Original entry on oeis.org

239, 719, 1033, 1193, 2143, 2777, 3889, 5953, 15917879, 16427897, 16754483, 24597451, 24612613, 27756503, 28261307, 28863287, 30493373, 30953633, 33444023, 34346203, 41488301, 44980259, 45796943, 50146069, 50682479
Offset: 1

Views

Author

Rémi Eismann and Fabien Sibenaler, May 07 2006

Keywords

Examples

			1039 = 1033 + 1033 mod(13) = 1033 + 1033 mod(1027), 1033 has level 1027/13 = 79.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Block[{p = Prime@n, np = Prime[n + 1]}, (2p - np)/Min@Select[Divisors[2p - np], # >= np - p &] == 79]; lst = {}; Do[ If[fQ@n, AppendTo[lst, Prime@n]], {n, 10^7}]; lst (* Robert G. Wilson v, May 09 2006 *)

Extensions

More terms from Robert G. Wilson v, May 09 2006

A001223 Prime gaps: differences between consecutive primes.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4, 2, 4, 12, 8, 4, 8, 4, 6, 12
Offset: 1

Views

Author

Keywords

Comments

There is a unique decomposition of the primes: provided the weight A117078(n) is > 0, we have prime(n) = weight * level + gap, or A000040(n) = A117078(n) * A117563(n) + a(n). - Rémi Eismann, Feb 14 2008
Let rho(m) = A179196(m), for any n, let m be an integer such that p_(rho(m)) <= p_n and p_(n+1) <= p_(rho(m+1)), then rho(m) <= n < n + 1 <= rho(m + 1), therefore a(n) = p_(n+1) - p_n <= p_rho(m+1) - p_rho(m) = A182873(m). For all rho(m) = A179196(m), a(rho(m)) < A165959(m). - John W. Nicholson, Dec 14 2011
A solution (modular square root) of x^2 == A001248(n) (mod A000040(n+1)). - L. Edson Jeffery, Oct 01 2014
There exists a constant C such that for n -> infinity, Cramer conjecture a(n) < C log^2 prime(n) is equivalent to (log prime(n+1)/log prime(n))^n < e^C. - Thomas Ordowski, Oct 11 2014
a(n) = A008347(n+1) - A008347(n-1). - Reinhard Zumkeller, Feb 09 2015
Yitang Zhang proved lim inf_{n -> infinity} a(n) is finite. - Robert Israel, Feb 12 2015
lim sup_{n -> infinity} a(n)/log^2 prime(n) = C <==> lim sup_{n -> infinity}(log prime(n+1)/log prime(n))^n = e^C. - Thomas Ordowski, Mar 09 2015
a(A038664(n)) = 2*n and a(m) != 2*n for m < A038664(n). - Reinhard Zumkeller, Aug 23 2015
If j and k are positive integers then there are no two consecutive primes gaps of the form 2+6j and 2+6k (A016933) or 4+6j and 4+6k (A016957). - Andres Cicuttin, Jul 14 2016
Conjecture: For any positive numbers x and y, there is an index k such that x/y = a(k)/a(k+1). - Andres Cicuttin, Sep 23 2018
Conjecture: For any three positive numbers x, y and j, there is an index k such that x/y = a(k)/a(k+j). - Andres Cicuttin, Sep 29 2018
Conjecture: For any three positive numbers x, y and j, there are infinitely many indices k such that x/y = a(k)/a(k+j). - Andres Cicuttin, Sep 29 2018
Row m of A174349 lists all indices n for which a(n) = 2m. - M. F. Hasler, Oct 26 2018
Since (6a, 6b) is an admissible pattern of gaps for any integers a, b > 0 (and also if other multiples of 6 are inserted in between), the above conjecture follows from the prime k-tuple conjecture which states that any admissible pattern occurs infinitely often (see, e.g., the Caldwell link). This also means that any subsequence a(n .. n+m) with n > 2 (as to exclude the untypical primes 2 and 3) should occur infinitely many times at other starting points n'. - M. F. Hasler, Oct 26 2018
Conjecture: Defining b(n,j,k) as the number of pairs of prime gaps {a(i),a(i+j)} such that i < n, j > 0, and a(i)/a(i+j) = k with k > 0, then
lim_{n -> oo} b(n,j,k)/b(n,j,1/k) = 1, for any j > 0 and k > 0, and
lim_{n -> oo} b(n,j,k1)/b(n,j,k2) = C with C = C(j,k1,k2) > 0. - Andres Cicuttin, Sep 01 2019

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 92.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 186-192.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000040 (primes), A001248 (primes squared), A000720, A037201, A007921, A030173, A036263-A036274, A167770, A008347.
Second difference is A036263, first occurrence is A000230.
For records see A005250, A005669.
Sequences related to the differences between successive primes: A001223 (Delta(p)), A028334, A080378, A104120, A330556-A330561.

Programs

  • Haskell
    a001223 n = a001223_list !! (n-1)
    a001223_list = zipWith (-) (tail a000040_list) a000040_list
    -- Reinhard Zumkeller, Oct 29 2011
    
  • Magma
    [(NthPrime(n+1) - NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    with(numtheory): for n from 1 to 500 do printf(`%d,`,ithprime(n+1) - ithprime(n)) od:
  • Mathematica
    Differences[Prime[Range[100]]] (* Harvey P. Dale, May 15 2011 *)
  • PARI
    diff(v)=vector(#v-1,i,v[i+1]-v[i]);
    diff(primes(100)) \\ Charles R Greathouse IV, Feb 11 2011
    
  • PARI
    forprime(p=1, 1e3, print1(nextprime(p+1)-p, ", ")) \\ Felix Fröhlich, Sep 06 2014
    
  • Python
    from sympy import prime
    def A001223(n): return prime(n+1)-prime(n) # Chai Wah Wu, Jul 07 2022
  • Sage
    differences(prime_range(1000)) # Joerg Arndt, May 15 2011
    

Formula

G.f.: b(x)*(1-x), where b(x) is the g.f. for the primes. - Franklin T. Adams-Watters, Jun 15 2006
a(n) = prime(n+1) - prime(n). - Franklin T. Adams-Watters, Mar 31 2010
Conjectures: (i) a(n) = ceiling(prime(n)*log(prime(n+1)/prime(n))). (ii) a(n) = floor(prime(n+1)*log(prime(n+1)/prime(n))). (iii) a(n) = floor((prime(n)+prime(n+1))*log(prime(n+1)/prime(n))/2). - Thomas Ordowski, Mar 21 2013
A167770(n) == a(n)^2 (mod A000040(n+1)). - L. Edson Jeffery, Oct 01 2014
a(n) = Sum_{k=1..2^(n+1)-1} (floor(cos^2(Pi*(n+1)^(1/(n+1))/(1+primepi(k))^(1/(n+1))))). - Anthony Browne, May 11 2016
G.f.: (Sum_{k>=1} x^pi(k)) - 1, where pi(k) is the prime counting function. - Benedict W. J. Irwin, Jun 13 2016
Conjecture: Limit_{N->oo} (Sum_{n=2..N} log(a(n))) / (Sum_{n=2..N} log(log(prime(n)))) = 1. - Alain Rocchelli, Dec 16 2022
Conjecture: The asymptotic limit of the average of log(a(n)) ~ log(log(prime(n))) - gamma (where gamma is Euler's constant). Also, for n tending to infinity, the geometric mean of a(n) is equivalent to log(prime(n)) / e^gamma. - Alain Rocchelli, Jan 23 2023
It has been conjectured that primes are distributed around their average spacing in a Poisson distribution (cf. D. A. Goldston in above links). This is the basis of the last two conjectures above. - Alain Rocchelli, Feb 10 2023

Extensions

More terms from James Sellers, Feb 19 2001

A001359 Lesser of twin primes.

Original entry on oeis.org

3, 5, 11, 17, 29, 41, 59, 71, 101, 107, 137, 149, 179, 191, 197, 227, 239, 269, 281, 311, 347, 419, 431, 461, 521, 569, 599, 617, 641, 659, 809, 821, 827, 857, 881, 1019, 1031, 1049, 1061, 1091, 1151, 1229, 1277, 1289, 1301, 1319, 1427, 1451, 1481, 1487, 1607
Offset: 1

Views

Author

Keywords

Comments

Also, solutions to phi(n + 2) = sigma(n). - Conjectured by Jud McCranie, Jan 03 2001; proved by Reinhard Zumkeller, Dec 05 2002
The set of primes for which the weight as defined in A117078 is 3 gives this sequence except for the initial 3. - Rémi Eismann, Feb 15 2007
The set of lesser of twin primes larger than three is a proper subset of the set of primes of the form 3n - 1 (A003627). - Paul Muljadi, Jun 05 2008
It is conjectured that A113910(n+4) = a(n+2) for all n. - Creighton Dement, Jan 15 2009
I would like to conjecture that if f(x) is a series whose terms are x^n, where n represents the terms of sequence A001359, and if we inspect {f(x)}^5, the conjecture is that every term of the expansion, say a_n * x^n, where n is odd and at least equal to 15, has a_n >= 1. This is not true for {f(x)}^k, k = 1, 2, 3 or 4, but appears to be true for k >= 5. - Paul Bruckman (pbruckman(AT)hotmail.com), Feb 03 2009
A164292(a(n)) = 1; A010051(a(n) - 2) = 0 for n > 1. - Reinhard Zumkeller, Mar 29 2010
From Jonathan Sondow, May 22 2010: (Start)
About 15% of primes < 19000 are the lesser of twin primes. About 26% of Ramanujan primes A104272 < 19000 are the lesser of twin primes.
About 46% of primes < 19000 are Ramanujan primes. About 78% of the lesser of twin primes < 19000 are Ramanujan primes.
A reason for the jumps is in Section 7 of "Ramanujan primes and Bertrand's postulate" and in Section 4 of "Ramanujan Primes: Bounds, Runs, Twins, and Gaps". (End)
Primes generated by sequence A040976. - Odimar Fabeny, Jul 12 2010
Primes of the form 2*n - 3 with 2*n - 1 prime n > 2. Primes of the form (n^2 - (n-2)^2)/2 - 1 with (n^2 - (n-2)^2)/2 + 1 prime so sum of two consecutive odd numbers/2 - 1. - Pierre CAMI, Jan 02 2012
Conjecture: For any integers n >= m > 0, there are infinitely many integers b > a(n) such that the number Sum_{k=m..n} a(k)*b^(n-k) (i.e., (a(m), ..., a(n)) in base b) is prime; moreover, when m = 1 there is such an integer b < (n+6)^2. - Zhi-Wei Sun, Mar 26 2013
Except for the initial 3, all terms are congruent to 5 mod 6. One consequence of this is that no term of this sequence appears in A030459. - Alonso del Arte, May 11 2013
Aside from the first term, all terms have digital root 2, 5, or 8. - J. W. Helkenberg, Jul 24 2013
The sequence provides all solutions to the generalized Winkler conjecture (A051451) aside from all multiples of 6. Specifically, these solutions start from n = 3 as a(n) - 3. This gives 8, 14, 26, 38, 56, ... An example from the conjecture is solution 38 from twin prime pairs (3, 5), (41, 43). - Bill McEachen, May 16 2014
Conjecture: a(n)^(1/n) is a strictly decreasing function of n. Namely a(n+1)^(1/(n+1)) < a(n)^(1/n) for all n. This conjecture is true for all a(n) <= 1121784847637957. - Jahangeer Kholdi and Farideh Firoozbakht, Nov 21 2014
a(n) are the only primes, p(j), such that (p(j+m) - p(j)) divides (p(j+m) + p(j)) for some m > 0, where p(j) = A000040(j). For all such cases m=1. It is easy to prove, for j > 1, the only common factor of (p(j+m) - p(j)) and (p(j+m) + p(j)) is 2, and there are no common factors if j = 1. Thus, p(j) and p(j+m) are twin primes. Also see A067829 which includes the prime 3. - Richard R. Forberg, Mar 25 2015
Primes prime(k) such that prime(k)! == 1 (mod prime(k+1)) with the exception of prime(991) = 7841 and other unknown primes prime(k) for which (prime(k)+1)*(prime(k)+2)*...*(prime(k+1)-2) == 1 (mod prime(k+1)) where prime(k+1) - prime(k) > 2. - Thomas Ordowski and Robert Israel, Jul 16 2016
For the twin prime criterion of Clement see the link. In Ribenboim, pp. 259-260 a more detailed proof is given. - Wolfdieter Lang, Oct 11 2017
Conjecture: Half of the twin prime pairs can be expressed as 8n + M where M > 8n and each value of M is a distinct composite integer with no more than two prime factors. For example, when n=1, M=21 as 8 + 21 = 29, the lesser of a twin prime pair. - Martin Michael Musatov, Dec 14 2017
For a discussion of bias in the distribution of twin primes, see my article on the Vixra web site. - Waldemar Puszkarz, May 08 2018
Since 2^p == 2 (mod p) (Fermat's little theorem), these are primes p such that 2^p == q (mod p), where q is the next prime after p. - Thomas Ordowski, Oct 29 2019, edited by M. F. Hasler, Nov 14 2019
The yet unproved "Twin Prime Conjecture" states that this sequence is infinite. - M. F. Hasler, Nov 14 2019
Lesser of the twin primes are the set of elements that occur in both A162566, A275697. Proof: A prime p will only have integer solutions to both (p+1)/g(p) and (p-1)/g(p) when p is the lesser of a twin prime, where g(p) is the gap between p and the next prime, because gcd(p+1,p-1) = 2. - Ryan Bresler, Feb 14 2021
From Lorenzo Sauras Altuzarra, Dec 21 2021: (Start)
J. A. Hervás Contreras observed the subsequence 11, 311, 18311, 1518311, 421518311... (see the links), which led me to conjecture the following statements.
I. If i is an integer greater than 2, then there exist positive integers j and k such that a(j) equals the concatenation of 3k and a(i).
II. If k is a positive integer, then there exist positive integers i and j such that a(j) equals the concatenation of 3k and a(i).
III. If i, j, and r are positive integers such that i > 2 and a(j) equals the concatenation of r and a(i), then 3 divides r. (End)

References

  • Milton Abramowitz and Irene A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 6.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.2 Prime Numbers, p. 81.
  • Paulo Ribenboim, The New Book of Prime Number Records, Springer-Verlag NY 1996, pp. 259-260.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 192-197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 111-112.

Crossrefs

Subsequence of A003627.
Cf. A104272 (Ramanujan primes), A178127 (lesser of twin Ramanujan primes), A178128 (lesser of twin primes if it is a Ramanujan prime).

Programs

  • Haskell
    a001359 n = a001359_list !! (n-1)
    a001359_list = filter ((== 1) . a010051' . (+ 2)) a000040_list
    -- Reinhard Zumkeller, Feb 10 2015
    
  • Magma
    [n: n in PrimesUpTo(1610) | IsPrime(n+2)];  // Bruno Berselli, Feb 28 2011
    
  • Maple
    select(k->isprime(k+2),select(isprime,[$1..1616])); # Peter Luschny, Jul 21 2009
    A001359 := proc(n)
       option remember;
       if n = 1
          then 3;
       else
          p := nextprime(procname(n-1)) ;
          while not isprime(p+2) do
             p := nextprime(p) ;
          end do:
          p ;
       end if;
    end proc: # R. J. Mathar, Sep 03 2011
  • Mathematica
    Select[Prime[Range[253]], PrimeQ[# + 2] &] (* Robert G. Wilson v, Jun 09 2005 *)
    a[n_] := a[n] = (p = NextPrime[a[n - 1]]; While[!PrimeQ[p + 2], p = NextPrime[p]]; p); a[1] = 3; Table[a[n], {n, 51}]  (* Jean-François Alcover, Dec 13 2011, after R. J. Mathar *)
    nextLesserTwinPrime[p_Integer] := Block[{q = p + 2}, While[NextPrime@ q - q > 2, q = NextPrime@ q]; q]; NestList[nextLesserTwinPrime@# &, 3, 50] (* Robert G. Wilson v, May 20 2014 *)
    Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==2&][[All,1]] (* Harvey P. Dale, Jan 04 2021 *)
    q = Drop[Prepend[p = Prime[Range[100]], 2], -1];
    Flatten[q[[#]] & /@ Position[p - q, 2]] (* Horst H. Manninger, Mar 28 2021 *)
  • PARI
    A001359(n,p=3) = { while( p+2 < (p=nextprime( p+1 )) || n-->0,); p-2}
    /* The following gives a reasonably good estimate for any value of n from 1 to infinity; compare to A146214. */
    A001359est(n) = solve( x=1,5*n^2/log(n+1), 1.320323631693739*intnum(t=2.02,x+1/x,1/log(t)^2)-log(x) +.5 - n)
    /* The constant is A114907; the expression in front of +.5 is an estimate for A071538(x) */ \\  M. F. Hasler, Dec 10 2008
    
  • Python
    from sympy import primerange, isprime
    print([n for n in primerange(1, 2001) if isprime(n + 2)]) # Indranil Ghosh, Jul 20 2017

Formula

a(n) = A077800(2n-1).
A001359 = { n | A071538(n-1) = A071538(n)-1 }; A071538(A001359(n)) = n. - M. F. Hasler, Dec 10 2008
A001359 = { prime(n) : A069830(n) = A087454(n) }. - Juri-Stepan Gerasimov, Aug 23 2011
a(n) = prime(A029707(n)). - R. J. Mathar, Feb 19 2017

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
Showing 1-10 of 77 results. Next