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

A261525 a(n) = smallest m such that A031131(m) = 2*n.

Original entry on oeis.org

2, 3, 9, 8, 15, 23, 47, 29, 66, 114, 46, 220, 188, 258, 640, 375, 480, 589, 216, 326, 367, 1006, 738, 1183, 1985, 1847, 1662, 2224, 3731, 3861, 3561, 2699, 3792, 4521, 2225, 12541, 3384, 12761, 3385, 4058, 10228, 15747, 15927, 14357, 18280, 19025, 14123
Offset: 2

Views

Author

Reinhard Zumkeller, Aug 23 2015

Keywords

Comments

A031131(a(n)) = 2*n and A031131(m) != 2*n for m < a(n);
A046931(n) = A000040(a(n)+1);
a(n)-th and (a(n)+2)-nd primes are the first pair that differ by 2*n;
conjecture: sequence is defined for all n > 1.

Crossrefs

Programs

  • Haskell
    a261525 = (+ 1) . fromJust . (`elemIndex` a031131_list) . (* 2)

A033957 Duplicate of A031131.

Original entry on oeis.org

3, 4, 6, 6, 6, 6, 6, 10, 8, 8, 10, 6, 6, 10, 12, 8, 8, 10, 6, 8, 10, 10, 14, 12, 6, 6, 6, 6, 18, 18
Offset: 1

Views

Author

Keywords

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

A001043 Numbers that are the sum of 2 successive primes.

Original entry on oeis.org

5, 8, 12, 18, 24, 30, 36, 42, 52, 60, 68, 78, 84, 90, 100, 112, 120, 128, 138, 144, 152, 162, 172, 186, 198, 204, 210, 216, 222, 240, 258, 268, 276, 288, 300, 308, 320, 330, 340, 352, 360, 372, 384, 390, 396, 410, 434, 450, 456, 462, 472, 480, 492, 508, 520
Offset: 1

Views

Author

Keywords

Comments

Arithmetic derivative (see A003415) of prime(n)*prime(n+1). - Giorgio Balzarotti, May 26 2011
A008472(a(n)) = A191583(n). - Reinhard Zumkeller, Jun 28 2011
With the exception of the first term, all terms are even. a(n) is divisible by 4 if the difference between prime(n) and prime(n + 1) is not divisible by 4; e.g., prime(n) = 1 mod 4 and prime(n + 1) = 3 mod 4. In general, for a(n) to be divisible by some even number m > 2 requires that prime(n + 1) - prime(n) not be a multiple of m. - Alonso del Arte, Jan 30 2012

Examples

			2 + 3 = 5.
3 + 5 = 8.
5 + 7 = 12.
7 + 11 = 18.
		

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • 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

Subsequence of A050936.
Cf. A000040 (primes), A031131 (first differences), A092163 (bisection), A100479 (bisection).

Programs

  • Haskell
    a001043 n = a001043_list !! (n-1)
    a001043_list = zipWith (+) a000040_list $ tail a000040_list
    -- Reinhard Zumkeller, Oct 19 2011
  • Magma
    [(NthPrime(n+1) + NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..1000)]):
    n:= nops(Primes):
    Primes[1..n-1] + Primes[2..n]; # Robert Israel, Aug 29 2014
  • Mathematica
    Table[Prime[n] + Prime[n + 1], {n, 55}] (* Ray Chandler, Feb 12 2005 *)
    Total/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Aug 23 2011 *)
    Abs[Differences[Table[(-1)^n Prime[n], {n, 60}]]] (* Alonso del Arte, Feb 03 2016 *)
  • PARI
    p=2;forprime(q=3,1e3,print1(p+q", ");p=q) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2 \\ Charles R Greathouse IV, Jun 21 2012
    
  • Sage
    BB = primes_first_n(56)
    L = []
    for i in range(55): L.append(BB[1 + i] + BB[i])
    L # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = prime(n) + prime(n + 1) = A000040(n) + A000040(n+1).
a(n) = A116366(n, n - 1) for n > 1. - Reinhard Zumkeller, Feb 06 2006
a(n) = 2*A024675(n-1), n>1. - R. J. Mathar, Jan 12 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 17 2000

A046931 Prime islands: for n >= 2, a(n) = least prime whose adjacent primes are exactly 2n apart; a(1) = 3 by convention.

Original entry on oeis.org

3, 5, 7, 29, 23, 53, 89, 223, 113, 331, 631, 211, 1381, 1129, 1637, 4759, 2579, 3433, 4297, 1327, 2179, 2503, 7993, 5623, 9587, 17257, 15859, 14107, 19609, 34981, 36433, 33247, 24281, 35617, 43331, 19661, 134513, 31397, 137029
Offset: 1

Views

Author

Keywords

Comments

For n > 1: (n) = A000040(A261525(n)+1) for n > 1. - Reinhard Zumkeller, Aug 23 2015

Examples

			29 is in a sea of 6 composites, namely 24, 25, 26, 27, 28 and 30 and is the smallest such number, so a(4) = 29.
		

Crossrefs

Another version: see A098968 and A098969.
Cf. A031131. - Zak Seidov, Jan 25 2015

Programs

  • Mathematica
    Join[{3},Transpose[Flatten[Table[Select[Partition[Prime[Range[ 20000]],3,1], Last[#]-First[#]==2 n&,1],{n,2,45}],1]][[2]]] (* Harvey P. Dale, May 22 2012 *)

Extensions

Typo in example fixed by Zak Seidov, Jan 25 2015

A031165 a(n) = prime(n+3) - prime(n).

Original entry on oeis.org

5, 8, 8, 10, 8, 10, 12, 12, 14, 12, 12, 10, 12, 16, 14, 14, 12, 12, 12, 12, 16, 18, 18, 14, 10, 8, 10, 20, 22, 24, 12, 18, 14, 18, 14, 16, 16, 16, 14, 18, 14, 16, 8, 18, 26, 28, 18, 10, 12, 12, 18, 18, 22, 18, 14, 14, 12, 12, 16, 26, 28, 20, 10, 20, 24, 30, 18, 16, 12
Offset: 1

Views

Author

Jeff Burch, Dec 11 1999

Keywords

Comments

Comments from Jonathan Vos Post, Jan 22 2006 (Start): This sequence is the k=3 case of the family of sequences a(k,n) = prime(n+k) - prime(n). See A001223 and A031131 for k = 1 and 2.
The records in this sequence give A115401. The minimal value, after the anomalous initial values (5, 8, 8), is 8 which occurs iff n is an element of A007530 (prime quadruples: numbers n such that n, n+2, n+6, n+8 are all prime). (End)

Examples

			a(1) = prime(4) - prime(1) = 7 - 2 = 5, which is the only odd element of this sequence.
a(2) = prime(5) - prime(2) = 11 - 3 = 8.
a(3) = prime(6) - prime(3) = 13 - 5 = 8.
a(4) = prime(7) - prime(4) = 17 - 7 = 10.
a(99) = prime(102) - prime(99) = 557 - 523 = 34. - _Jonathan Vos Post_, Jan 22 2006
		

Crossrefs

Programs

  • Haskell
    a031165 n = a031165_list !! (n-1)
    a031165_list = zipWith (-) (drop 3 a000040_list) a000040_list
    -- Reinhard Zumkeller, Aug 23 2015
  • Magma
    [NthPrime(n+3)-NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 11 2011
    
  • Maple
    a:= n-> ithprime(n+3)-ithprime(n): seq (a(n), n=1..80);
  • Mathematica
    t = Array[Prime, 75]; Drop[t, 3] - Drop[t, -3] (* Robert G. Wilson v *)
    #[[4]]-#[[1]]&/@Partition[Prime[Range[80]],4,1] (* Harvey P. Dale, Nov 07 2021 *)
  • PARI
    p=2;q=3;r=5;forprime(s=7,1e3,print1(s-p", "); p=q;q=r;r=s) \\ Charles R Greathouse IV, Nov 07 2012
    

Formula

a(n) = prime(n+3) - prime(n). a(n) = A000040(n+3) - A000040(n). - Jonathan Vos Post, Jan 22 2006
a(n) = A034961(n+1) - A034961(n). - Zak Seidov, Nov 07 2012

Extensions

Edited by R. J. Mathar and N. J. A. Sloane, Aug 11 2008

A031172 a(n) = prime(n+10) - prime(n).

Original entry on oeis.org

29, 34, 36, 36, 36, 40, 42, 42, 44, 42, 42, 42, 42, 46, 50, 48, 44, 46, 42, 42, 54, 52, 54, 50, 52, 50, 54, 56, 58, 60, 52, 50, 54, 54, 48, 48, 54, 60, 60, 56, 54, 58, 50, 58, 60, 64, 58, 48, 50, 52, 50, 54, 66, 60, 56, 54, 62, 66, 70, 68, 70, 66, 60, 62, 66, 66, 58
Offset: 1

Views

Author

Keywords

Comments

In principle, moderate values should appear infinitely many times, by analogy with twin primes hypothesis. For example, a(n) = 44 for n = 9, 17, 206, 1604467, 12905293, 18008874, 26545460, 32655424, 57848470, 58313630, 59022635, 66275281, 81581956, 123780499, 160884754, 167797255, 179786560, 181569324, 239542290, ... - Zak Seidov, Sep 14 2014, edited by M. F. Hasler, Dec 03 2018
According to the k-tuple conjecture, any admissible k-tuple of primes occurs with calculable nonzero asymptotic density, i.e., in particular, infinitely many times. For k = 11, number of primes in the interval [prime(n), prime(n+10)], the smallest possible diameter of a k-tuple is A008407(11) = 36, and there are A083409(11) = 2 such constellations: {0, 4, 6, 10, 16, 18, 24, 28, 30, 34, 36}, first occurring at A213646(1) = 1418575498573, and {0, 2, 6, 8, 12, 18, 20, 26, 30, 32, 36}, first occurring at A213647(1) = 11. The combined list { prime(n) | a(n) = 36 } is A257129. - M. F. Hasler, Dec 03 2018

Crossrefs

Programs

  • GAP
    P:=Filtered([1..400],IsPrime);; a:=List([1..Length(P)-10],n->P[n+10]-P[n]); # Muniru A Asiru, Dec 06 2018
  • Haskell
    a031172_list = zipWith (-) (drop 10 a000040_list) a000040_list
    a031172 n = a031172_list !! (n-1)  -- Reinhard Zumkeller, Aug 23 2015
    
  • Magma
    [NthPrime(n+10)-NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 23 2011
    
  • Maple
    A031172:=n->ithprime(n+10)-ithprime(n): seq(A031172(n), n=1..50);
  • Mathematica
    Table[Prime[n + 10] - Prime[n], {n, 50}] (* Wesley Ivan Hurt, Sep 14 2014 *)
  • PARI
    A031172(n)=prime(n+10)-prime(n) \\ M. F. Hasler, Dec 03 2018
    
  • Python
    from sympy import prime
    for n in range(1,100): print(prime(n+10)-prime(n)) # Stefano Spezia, Dec 06 2018
    
  • Sage
    [(nth_prime(n+10) - nth_prime(n)) for n in (1..100)] # G. C. Greubel, Dec 04 2018
    

Formula

a(n) = A000040(n+10) - A000040(n). - Wesley Ivan Hurt, Sep 14 2014

Extensions

Offset changed from 2 to 1; added a(1)=29 by Vincenzo Librandi, Apr 23 2011

A162200 Number on the positive y axis of the n-th horizontal component in the graph of the "mountain path" function for prime numbers.

Original entry on oeis.org

0, 0, 2, 2, 5, 4, 7, 6, 9, 6, 10, 8, 13, 12, 15, 12, 18, 16, 20, 17, 20, 18, 23, 20, 27, 23, 26, 25, 28, 27, 36, 29, 34, 32, 38, 34, 38, 34, 39, 36, 42, 40, 46, 42, 45, 44, 51, 41, 49, 48, 51, 48, 52, 48, 56, 52, 58, 56, 60, 57, 60, 56, 68, 61, 64, 63, 72, 64, 72, 68, 71, 68, 75
Offset: 1

Views

Author

Omar E. Pol, Jun 28 2009

Keywords

Comments

Note that the n-th horizontal component is an edge with length equal to 1 (see the link: Graph of the mountain path function).
See A162201 for the first differences.

Crossrefs

Programs

Extensions

Edited by Omar E. Pol, Jul 02 2009
More terms from R. J. Mathar, Jul 15 2009

A031166 a(n) = prime(n+4) - prime(n).

Original entry on oeis.org

9, 10, 12, 12, 12, 16, 14, 18, 18, 14, 16, 16, 18, 18, 20, 18, 14, 18, 16, 18, 24, 22, 20, 18, 12, 12, 24, 24, 28, 26, 22, 20, 20, 24, 18, 22, 22, 18, 24, 20, 18, 18, 20, 30, 30, 30, 22, 16, 14, 22, 24, 24, 28, 20, 20, 18, 14, 22, 30, 30, 30, 24, 24, 26, 34, 32, 22
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

a(n) = A031131(n) + A031131(n+2) = A001223(n) + A031165(n+1) and obvious variants. - M. F. Hasler, Dec 03 2018

Extensions

Offset changed from 2 to 1, and a(1)=9 added, by Vincenzo Librandi, Apr 23 2011

A031167 a(n) = prime(n+5) - prime(n).

Original entry on oeis.org

11, 14, 14, 16, 18, 18, 20, 22, 20, 18, 22, 22, 20, 24, 24, 20, 20, 22, 22, 26, 28, 24, 24, 20, 16, 26, 28, 30, 30, 36, 24, 26, 26, 28, 24, 28, 24, 28, 26, 24, 20, 30, 32, 34, 32, 34, 28, 18, 24, 28, 30, 30, 30, 26, 24, 20, 24, 36, 34, 32, 34, 38, 30, 36, 36, 36, 28
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a031167 n = a031167_list !! (n-1)
    a031167_list = zipWith (-) (drop 5 a000040_list) a000040_list
    -- Reinhard Zumkeller, Aug 23 2015
  • Magma
    [NthPrime(n+5)-NthPrime(n): n in [1..100] ]; // Vincenzo Librandi, Apr 23 2011
    
  • Maple
    seq(ithprime(n+5)-ithprime(n), n=1..30);
  • Mathematica
    a=5; t=Array[Prime,123]; Drop[t,a]-Drop[t,-a] (* Vladimir Joseph Stephan Orlovsky, Aug 13 2009 *)
    Last[#]-First[#]&/@Partition[Prime[Range[80]],6,1] (* Harvey P. Dale, Jul 11 2014 *)
  • PARI
    A031167(n) = prime(n+5)-prime(n)
    

Extensions

Initial term added by Michael B. Porter, Jan 27 2010
Showing 1-10 of 41 results. Next