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

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

A356224 Number of divisors of n whose prime indices cover an initial interval of positive integers.

Original entry on oeis.org

1, 2, 1, 3, 1, 3, 1, 4, 1, 2, 1, 5, 1, 2, 1, 5, 1, 4, 1, 3, 1, 2, 1, 7, 1, 2, 1, 3, 1, 4, 1, 6, 1, 2, 1, 7, 1, 2, 1, 4, 1, 3, 1, 3, 1, 2, 1, 9, 1, 2, 1, 3, 1, 5, 1, 4, 1, 2, 1, 7, 1, 2, 1, 7, 1, 3, 1, 3, 1, 2, 1, 10, 1, 2, 1, 3, 1, 3, 1, 5, 1, 2, 1, 5, 1, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Aug 04 2022

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The a(n) gapless divisors of n = 1..24:
  1  2  1  4  1  6  1  8  1  2  1  12  1  2  1  16  1  18  1  4  1  2  1  24
     1     2     2     4     1     6      1     8      6      2     1     12
           1     1     2           4            4      2      1           8
                       1           2            2      1                  6
                                   1            1                         4
                                                                          2
                                                                          1
For example, the divisors of 12 are {1,2,3,4,6,12}, of which {1,2,4,6,12} belong to A055932, so a(12) = 5.
		

Crossrefs

These divisors belong to A055932, a subset of A073491 (complement A073492).
The complement is A356225.
A001223 lists the prime gaps.
A328338 has third-largest divisor prime.
A356226 gives the lengths of maximal gapless intervals of prime indices.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
    Table[Length[Select[Divisors[n],normQ[primeMS[#]]&]],{n,100}]

A174349 Square array: row n gives the indices i for which prime(i+1) = prime(i) + 2n; read by falling antidiagonals.

Original entry on oeis.org

2, 3, 4, 5, 6, 9, 7, 8, 11, 24, 10, 12, 15, 72, 34, 13, 14, 16, 77, 42, 46, 17, 19, 18, 79, 53, 47, 30, 20, 22, 21, 87, 61, 91, 62, 282, 26, 25, 23, 92, 68, 97, 66, 295, 99, 28, 27, 32, 94, 80, 114, 137, 319, 180, 154, 33, 29, 36, 124, 82, 121, 146, 331, 205, 259, 189
Offset: 1

Views

Author

Clark Kimberling, Mar 16 2010

Keywords

Comments

It is conjectured that every positive integer except 1 occurs in the array.
From M. F. Hasler, Oct 19 2018: (Start)
The above conjecture is obviously true: the integer i appears in row (prime(i+1) - prime(i))/2.
Polignac's Conjecture states that all rows are of infinite length.
To ensure the sequence is well-defined in case the conjecture would not hold, we can use the convention that finite rows are continued by 0's. (End)

Examples

			Corner of the array:
   2    3    5    7    10    13 ...
   4    6    8   12    14    17 ...
   9   11   15   16    18    21 ...
  24   72   77   79    87    92 ...
  34   42   53   61    68    80 ...
  46   47   91   97   114   121 ...
  (...)
Row 1: p(2) = 3, p(3) = 5, p(5) = 11, p(7) = 17, ..., these being the primes for which the next prime is 2 greater, cf. A029707.
Row 2: p(4) = 7, p(6) = 13, p(8) = 19, ..., these being the primes for which the next prime is 4 greater, cf. A029709.
		

Crossrefs

Rows 1, 2, 3, ... are A029707, A029709, A320701, ..., A320720; A116493 (row 35), A116496 (row 50), A116497 (row 100), A116495 (row 105).
Column 1 is A038664.

Programs

  • Mathematica
    rows = 10; t2 = {}; Do[t = {}; p = Prime[2]; While[Length[t] < rows - off + 1, nextP = NextPrime[p]; If[nextP - p == 2*off, AppendTo[t, p]]; p = nextP]; AppendTo[t2, t], {off, rows}]; t3 = Table[t2[[b, a - b + 1]], {a, rows}, {b, a}]; PrimePi /@ t3 (* T. D. Noe, Feb 11 2014 *)

Formula

a(n) = A000720(A174350(n)). - Michel Marcus, Mar 30 2016

Extensions

Name corrected and other edits by M. F. Hasler, Oct 19 2018

A320701 Indices of primes followed by a gap (distance to next larger prime) of 6.

Original entry on oeis.org

9, 11, 15, 16, 18, 21, 23, 32, 36, 37, 39, 40, 51, 54, 55, 56, 58, 67, 71, 73, 74, 76, 84, 86, 96, 100, 102, 103, 105, 107, 108, 110, 111, 118, 119, 123, 129, 130, 133, 160, 161, 164, 165, 167, 170, 174, 179, 184, 185, 187, 188, 194, 195, 199, 200, 202, 208, 210, 216, 218, 219, 227, 231
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes given in A031924.
Subsequence of indices of sexy primes A023201.

Crossrefs

Equals A000720 o A031924.
Row 3 of A174349.
Indices of 6's in A001223.
Cf. A029707, A029709, A320702, A320703, ..., A320720 (analog for gaps 2, 4, 8, 10, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

  • Mathematica
    Position[Differences[Prime[Range[250]]],6]//Flatten (* Harvey P. Dale, Oct 13 2022 *)
  • PARI
    A(N=100,g=6,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)} \\ returns the list of first N terms of the sequence

Formula

a(n) = A000720(A031924(n)).
A320701 = { i > 0 | prime(i+1) = prime(i) + 6 } = A001223^(-1)({6}).

A320702 Indices of primes followed by a gap (distance to next larger prime) of 8.

Original entry on oeis.org

24, 72, 77, 79, 87, 92, 94, 124, 126, 128, 132, 135, 156, 158, 166, 186, 192, 196, 220, 228, 241, 246, 248, 270, 281, 299, 304, 325, 330, 334, 338, 364, 370, 379, 386, 393, 400, 413, 417, 421, 432, 436, 454, 456, 482, 488, 507, 517, 519, 538, 589, 594, 620, 640, 661, 676, 689, 691, 712, 736, 750, 759
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes given in A031926.

Crossrefs

Equals A000720 o A031926.
Row 4 of A174349.
Indices of 8's in A001223.
Cf. A029707, A029709, A320701, A320703, ..., A320720 (analog for gaps 2, 4, 6, 10, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

  • Magma
    [n: n in [1..800] | NthPrime(n+1) - NthPrime(n) eq 8]; // Vincenzo Librandi, Mar 21 2019
  • Maple
    p:= 2: Res:= NULL: count:= 0:
    for n from 1 while count < 100 do
      q:= nextprime(p);
      if q-p = 8 then count:= count+1; Res:= Res, n; fi;
      p:= q;
    od:
    Res; # Robert Israel, Oct 19 2018
  • Mathematica
    Select[Range[800], Prime[#] + 8 == Prime[# + 1] &] (* Vincenzo Librandi, Mar 21 2019 *)
  • PARI
    A_vec(N=100,g=8,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)}
    

Formula

a(n) = A000720(A031926(n)) = A174349(4,n).
A320702 = { i > 0 | prime(i+1) = prime(i) + 8 } = A001223^(-1)({8}).

A320720 Indices of primes followed by a gap (distance to next larger prime) of 44.

Original entry on oeis.org

1831, 3861, 4009, 7499, 8937, 10328, 10427, 11725, 12904, 12926, 13011, 13051, 16596, 16915, 18280, 20055, 20160, 20352, 20619, 21458, 21465, 21550, 21659, 23752, 23934, 24107, 24384, 24445, 24651, 24871, 24933, 24992, 25027, 26089, 26166, 26483, 26923, 27038, 27048, 28898, 29343
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes listed in A134121.

Crossrefs

Cf. A029707, A029709 (analog for gaps 2 and 4), A320701, A320702, ... A320719 (analog for gaps 6, 8, 10, ..., 42), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).
Equals A000720 o A134121.
Indices of 44's in A001223.
Row 22 of A174349.

Programs

  • PARI
    A(N=100,g=44,p=2,i=primepi(p)-1,L=List())={forprime(q=1+p,,i++; if(p+g==p=q, listput(L,i); N--||break));Vec(L)} \\ returns the list of first N terms of the sequence

Formula

a(n) = A000720(A134121(n)).

A356069 Number of divisors of n whose prime indices cover an interval of positive integers (A073491).

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 3, 3, 2, 6, 2, 3, 4, 5, 2, 6, 2, 4, 3, 3, 2, 8, 3, 3, 4, 4, 2, 7, 2, 6, 3, 3, 4, 9, 2, 3, 3, 5, 2, 5, 2, 4, 6, 3, 2, 10, 3, 4, 3, 4, 2, 8, 3, 5, 3, 3, 2, 10, 2, 3, 4, 7, 3, 5, 2, 4, 3, 5, 2, 12, 2, 3, 6, 4, 4, 5, 2, 6, 5, 3, 2, 7, 3, 3
Offset: 1

Views

Author

Gus Wiseman, Aug 28 2022

Keywords

Comments

First differs from A000005 at 10, 14, 20, 21, 22, ... = A307516.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.

Examples

			The a(n) counted divisors of n = 1, 2, 4, 6, 12, 16, 24, 30, 36, 48, 72, 90:
  1   2   4   6  12  16  24  30  36  48  72  90
      1   2   3   6   8  12  15  18  24  36  45
          1   2   4   4   8   6  12  16  24  30
              1   3   2   6   5   9  12  18  18
                  2   1   4   3   6   8  12  15
                  1       3   2   4   6   9   9
                          2   1   3   4   8   6
                          1       2   3   6   5
                                  1   2   4   3
                                      1   3   2
                                          2   1
                                          1
		

Crossrefs

These divisors belong to A073491, a superset of A055932, complement A073492.
The initial case is A356224.
The complement in the initial case is counted by A356225.
A000005 counts divisors.
A001223 lists the prime gaps.
A056239 adds up prime indices, row sums of A112798, lengths A001222.
A328338 has third-largest divisor prime.
A356226 gives the lengths of maximal gapless intervals of prime indices.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    nogapQ[m_]:=m=={}||Union[m]==Range[Min[m],Max[m]];
    Table[Length[Select[Divisors[n],nogapQ[primeMS[#]]&]],{n,100}]

A320703 Indices of primes followed by a gap (distance to next larger prime) of 10.

Original entry on oeis.org

34, 42, 53, 61, 68, 80, 82, 101, 106, 115, 125, 127, 138, 141, 145, 157, 172, 175, 177, 191, 193, 204, 222, 233, 258, 266, 269, 279, 289, 306, 308, 310, 316, 324, 369, 383, 397, 399, 403, 418, 422, 431, 443, 474, 491, 497, 500, 502, 518, 525, 531, 535, 575
Offset: 1

Views

Author

M. F. Hasler, Oct 19 2018

Keywords

Comments

Indices of the primes given in A031928.

Crossrefs

Equals A000720 o A031928.
Row 5 of A174349.
Indices of 10's in A001223.
Subsequence of A107730: prime(n+1) ends in same digit as prime(n).
Cf. A029707, A029709, A320701, A320702, ..., A320720 (analog for gaps 2, 4, 6, 8, ..., 44), A116493 (gap 70), A116496 (gap 100), A116497 (gap 200), A116495 (gap 210).

Programs

Formula

a(n) = A000720(A031928(n)).
A320703 = { i > 0 | prime(i+1) = prime(i) + 10 }.

A375712 Numbers k such that A013929(k+1) - A013929(k) = 4. In other words, the k-th nonsquarefree number is 4 less than the next nonsquarefree number.

Original entry on oeis.org

1, 4, 7, 11, 12, 13, 14, 22, 25, 26, 29, 32, 35, 39, 40, 41, 42, 50, 53, 54, 61, 64, 70, 71, 72, 75, 78, 81, 82, 83, 84, 87, 90, 98, 99, 102, 109, 110, 117, 120, 123, 124, 127, 135, 139, 140, 144, 151, 154, 155, 156, 157, 160, 163, 168, 169, 170, 173, 176, 179
Offset: 1

Views

Author

Gus Wiseman, Sep 09 2024

Keywords

Comments

The difference of consecutive nonsquarefree numbers is at least 1 and at most 4, so there are four disjoint sequences of this type:
- A375709 (difference 1)
- A375710 (difference 2)
- A375711 (difference 3)
- A375712 (difference 4)

Examples

			The initial nonsquarefree numbers are 4, 8, 9, 12, 16, 18, 20, 24, 25, which first increase by 4 after the first, fourth, and seventh terms.
		

Crossrefs

For prime numbers we have A029709.
Positions of 4's in A078147.
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A053797 gives lengths of runs of nonsquarefree numbers, firsts A373199.
A375707 counts squarefree numbers between consecutive nonsquarefree numbers.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],!SquareFreeQ[#]&]],4]

Formula

Complement of A375709 U A375710 U A375711.

A356223 Position of n-th appearance of 2n in the sequence of prime gaps (A001223). If 2n does not appear at least n times, set a(n) = -1.

Original entry on oeis.org

2, 6, 15, 79, 68, 121, 162, 445, 416, 971, 836, 987, 2888, 1891, 1650, 5637, 5518, 4834, 9237, 8152, 10045, 21550, 20248, 20179, 29914, 36070, 24237, 53355, 52873, 34206, 103134, 90190, 63755, 147861, 98103, 117467, 209102, 206423, 124954, 237847, 369223
Offset: 1

Views

Author

Gus Wiseman, Aug 04 2022

Keywords

Comments

Prime gaps (A001223) are the differences between consecutive prime numbers. They begin: 1, 2, 2, 4, 2, 4, 2, 4, 6, ...

Examples

			We need the first 15 prime gaps (1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6) before we reach the 3rd appearance of 6, so a(6) = 15.
		

Crossrefs

The first appearances are at A038664, seconds A356221.
Diagonal of A356222.
A001223 lists the prime gaps.
A073491 lists numbers with gapless prime indices.
A356224 counts divisors with gapless prime indices, complement A356225.
A356226 = gapless interval lengths of prime indices, run-lengths A287170.

Programs

  • Mathematica
    nn=1000;
    gaps=Differences[Array[Prime,nn]];
    Table[Position[gaps,2*n][[n,1]],{n,Select[Range[nn],Length[Position[gaps,2*#]]>=#&]}]
Showing 1-10 of 30 results. Next