

A001223


Differences between consecutive primes.
(Formerly M0296 N0108)


487



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


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
Shinya: Let p_{k} [A000040(k)] denote the kth prime and d(p_{k}) = p_{k}  p_{k  1}, [A001223(k)] the difference between consecutive primes. We denote by N_{epsilon}(x) the number of primes <= x which satisfy the inequality d(p_{k}) <= (log p_{k})^(2 + epsilon), where epsilon > 0 is arbitrary and fixed and by pi(x) [A000720(x)] the number of primes <= x. In this paper we prove that N(x)/pi(x) ~ 1 as x approaches infinity.  Jonathan Vos Post, Sep 23 2008
Goldston et al. prove that a positive proportion of the gaps between consecutive primes are short gaps of length less than any fixed fraction of the average spacing between primes.  Jonathan Vos Post, Mar 21 2011
Goldston & Ledoan refine one aspect of a theorem of Gallagher that the prime ktuple conjecture implies that the prime numbers are distributed in a Poisson distribution around their average spacing.  Jonathan Vos Post, Nov 15 2011
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(n1).  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


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.
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).


LINKS

N. J. A. Sloane, First 10000 terms
M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series 55, Tenth Printing, 1972 [alternative scanned copy].
S. Ares & M. Castro, Hidden structure in the randomness of the prime number sequence?, arXiv:condmat/0310148 [condmat.statmech], 20032005.
József Beck, Inevitable randomness in discrete mathematics, University Lecture Series, 49. American Mathematical Society, Providence, RI, 2009. xii+250 pp. ISBN: 9780821847565; MR2543141 (2010m:60026). See page 7.
D. A. Goldston, S. W. Graham, J. Pintz and C. Y. Yildirim, Small gaps between primes and almost primes, arXiv:math/0506067 [math.NT], 2005.
D. A. Goldston, A. H. Ledoan, On the differences between consecutive prime numbers, I", arXiv:1111.3380v1 [math.NT], Nov 14, 2011.
D. A. Goldston, J. Pintz, C. Y. Yildirim, Positive Proportion of Small Gaps Between Consecutive Primes, arXiv:1103.3986 [math.NT], Mar 21, 2011.
D. R. HeathBrown and H. Iwaniec, On the difference between consecutive primes, Bull. Amer. Math. Soc. 1 (1979), 758760.
Alexei Kourbatov, Tables of record gaps between prime constellations, arXiv preprint arXiv:1309.4053 [math.NT], 2013.
Alexei Kourbatov, The distribution of maximal prime gaps in Cramer's probabilistic model of primes, arXiv preprint arXiv:1401.6959 [math.NT], 2014.
The Polymath project, Bounded gaps between primes
Hisanobu Shinya, On the density of prime differences less than a given magnitude which satisfy a certain inequality, arXiv:0809.3458 [math.GM], Sep 19, 2008.
K. Soundararajan, Small gaps between prime numbers: the work of GoldstonPintzYildirim, Bull. Amer. Math. Soc., 44 (2007), 118.
Eric Weisstein's World of Mathematics, Andrica's Conjecture
Eric Weisstein's World of Mathematics, Prime Difference Function
Yitang Zhang, Bounded gaps between primes, Annals of Mathematics 179 (2014), 11211174.
Index entries for primes, gaps between


FORMULA

G.f.: b(x)*(1x), where b(x) is the g.f. for the primes.  Franklin T. AdamsWatters, Jun 15 2006
a(n) = prime(n+1)  prime(n).  Franklin T. AdamsWatters, Mar 31 2010
Conjecture: a(n) = ceiling(prime(n)*(log(prime(n+1))log(prime(n)))).  Thomas Ordowski, Mar 19 2013
Conjecture: a(n) = floor(prime(n+1)*(log(prime(n+1))log(prime(n)))).  Thomas Ordowski, Mar 20 2013
Conjecture: a(n) = floor((prime(n)+prime(n+1))*(log(prime(n+1))log(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[(n+1)^(1/(n+1))/(1+primepi(k))^(1/(n+1))]floor[((n+1)^(1/(n+1))1)/(1+primepi(k))^(1/(n+1))]).  Anthony Browne, May 11 2016
G.f.: (Sum_{ k>=1 } x^pi(k)) 1, with pi(k) the prime counting function.  Benedict W. J. Irwin, Jun 13 2016


MAPLE

with(numtheory): for n from 1 to 500 do printf(`%d, `, ithprime(n+1)  ithprime(n)) od:


MATHEMATICA

p = Table[Prime[i], {i, 1, 100}]; Drop[p, 1]  Drop[p, 1]
Array[ Mod[ Prime[ # + 1], Prime[ # ]] &, 97] (* Robert G. Wilson v, Jul 14 2010 *)
t = Array[Prime, 98]; Rest@t  Most@t (* Robert G. Wilson v, Jul 14 2010 *)
Differences[Prime[Range[100]]] (* Harvey P. Dale, May 15 2011 *)
a[n_] := PowerMod[Prime[n]^2, 1/2, Prime[n + 1]]; Table[a[n], {n, 97}] (* L. Edson Jeffery, Oct 01 2014 *)


PROG

(Sage) differences(prime_range(1000)) # Joerg Arndt, May 15 2011
(PARI) diff(v)=vector(#v1, i, v[i+1]v[i]);
diff(primes(100)) \\ Charles R Greathouse IV, Feb 11 2011
(MAGMA) [(NthPrime(n+1)  NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
(Haskell)
a001223 n = a001223_list !! (n1)
a001223_list = zipWith () (tail a000040_list) a000040_list
 Reinhard Zumkeller, Oct 29 2011
(PARI) forprime(p=1, 1e3, print1(nextprime(p+1)p, ", ")) \\ Felix Fröhlich, Sep 06 2014


CROSSREFS

Cf. A000040 (primes), A001248 (primes squared), A037201, A007921, A030173, A036263A036274, A167770, A008347.
Second difference is A036263, first occurrence is A000230.
For records see A005250, A005669.
Cf. A038664, A031131, A031165, A031166, A031167, A031168, A031169, A031170, A031171, A031172.
Sequence in context: A249868 A255311 A075526 * A118776 A249867 A092520
Adjacent sequences: A001220 A001221 A001222 * A001224 A001225 A001226


KEYWORD

nonn,nice,easy,hear


AUTHOR

N. J. A. Sloane


EXTENSIONS

More terms from James A. Sellers, Feb 19 2001


STATUS

approved



