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.

Previous Showing 61-67 of 67 results.

A270711 Half of increasing gaps between primes.

Original entry on oeis.org

1, 2, 3, 4, 7, 9, 10, 11, 17, 18, 22, 26, 36, 43, 48, 56, 57, 59, 66, 74, 77, 90, 105, 110, 111, 117, 124, 125, 141, 144, 146, 160, 168, 177, 191, 192, 197, 228, 232, 234, 237, 243, 245, 250, 257, 258, 266, 267, 270, 291, 294, 301, 326, 337, 358, 383, 389, 402, 403, 453, 458, 462, 566, 592, 599, 610, 612, 624, 636, 664, 678, 685, 721, 738, 744, 755, 763, 765, 775
Offset: 2

Views

Author

Michel Lagneau, Mar 22 2016

Keywords

Comments

The primes in this sequence are 2, 3, 7, 11, 17, 43, 59, 191, 197, 257, ...
The squares are 1, 4, 9, 36, 144,...

Crossrefs

Cf. A005250.

Programs

  • Mathematica
    max = 10^7; Module[{d = Differences[Prime[Range[max]]], ls = {2}}, Table[If[d[[n]] > Last[ls], AppendTo[ls, d[[n]]]], {n, max - 1}]; ls/2]

Formula

a(n) = A005250(n)/2 for n>1.

Extensions

a(55)-a(80) using b-file of A005250 by Hugo Pfoertner, Oct 30 2021

A270878 Record differences between record prime gaps, that is, terms of A053695 that set a record.

Original entry on oeis.org

1, 2, 6, 12, 20, 26, 30, 32, 62, 100, 208
Offset: 1

Views

Author

Marc Morgenegg, Apr 05 2016

Keywords

Crossrefs

Extensions

Edited by N. J. A. Sloane, May 23 2016 at the suggestion of R. J. Mathar and Giovanni Resta.

A271383 a(n) is the smallest k such that there are exactly n primes between k*(k-1) and k^2 and exactly n primes between k^2 and k*(k+1), or 0 if no such k exists.

Original entry on oeis.org

2, 8, 13, 21, 32, 38, 46, 60, 85, 74, 102, 111
Offset: 1

Views

Author

Felix Fröhlich, Apr 07 2016

Keywords

Comments

Does k exist for every n?
a(15)=135, a(17)=154. - Chai Wah Wu, Apr 16 2021
If they are nonzero, a(13)-a(14), a(16), a(18)-a(19), a(22), a(25)-a(26), a(33)-a(35) > 710000; a(20) = 200, a(21) = 192, a(23) = 258, a(24) = 277, a(27) = 317, a(28) = 283, a(29) = 314, a(30) = 352, a(31) = 365, a(32) = 461. - J.W.L. (Jan) Eerland, Dec 21 2022
A stronger statement can be made regarding the terms listed above that are either 0 or > 710000: No two primes < A002386(80) = 18361375334787046697 differ by more than A005250(80) = 1550, and sqrt(18361375334787046697) = 4285017541.946..., so for every k in the interval [710000, 4285017541] there are more than 458 primes in each of the two intervals [k*(k-1), k^2] and [k^2, k*(k+1)], so every term a(n) with n <= 35 that is either 0 or > 710000 is necessarily either 0 or > 4285017541 (with a(n) = 0 looking nearly certain). - Jon E. Schoenfield, Dec 23 2022

Examples

			For n = 6: 38*(38-1) = 1406, 38^2 = 1444 and 38*(38+1) = 1482. A000720(1444) - A000720(1406) = 6 and A000720(1482) - A000720(1444) = 6. Since 38 is the smallest k where the number of primes in both intervals is 6, a(6) = 38.
		

Programs

  • Mathematica
    Table[SelectFirst[Range[10^3], And[PrimePi[#^2] - PrimePi[# (# - 1)] == n, PrimePi[# (# + 1)] - PrimePi[#^2] == n] &], {n, 30}] /. k_ /; MissingQ@ k -> 0 (* Michael De Vlieger, Apr 09 2016, Version 10.2 *)
  • PARI
    a(n) = my(k=1); while((primepi(k^2)-primepi(k*(k-1)))!=n || (primepi(k*(k+1))-primepi(k^2))!=n, k++); k

Extensions

Escape clause added to definition by Chai Wah Wu, Apr 17 2021

A307325 a(n) is the smallest number k for which prime(k+1) - prime(k) is greater than n.

Original entry on oeis.org

2, 4, 4, 9, 9, 24, 24, 30, 30, 30, 30, 30, 30, 99, 99, 99, 99, 154, 154, 189, 189, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 1183, 1183, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 1831, 2225, 2225, 2225, 2225, 2225, 2225, 2225, 2225, 3385, 3385, 3385, 3385
Offset: 1

Views

Author

Marius A. Burtea, Apr 02 2019

Keywords

Comments

For any n there is an infinity of numbers m for which prime(m+1) - prime(m) is greater than n.
It appears that the sequence of lengths of successive runs is equal to A053695. - Marc Bofill Janer, May 21 2019

Examples

			For n = 2, prime(2) - prime(1) = 3 - 2 = 1, prime(3) - prime(2) = 5 - 3 = 2, prime(5) - prime(4) = 11 - 7 = 4, so a(2) = 4.
		

References

  • Laurențiu Panaitopol, Dinu Șerbănescu, Number theory and combinatorial problems for juniors, Ed.Gil, Zalău, (2003), ch. 1, p.7, pr. 25. (in Romanian).

Crossrefs

Programs

  • MATLAB
    v=primes(1000000);
    for u=1:100; ss=1;
        while and(v(ss+1)-v(ss)<=u,ss
    				
  • Magma
    v:=PrimesUpTo(10000000);
    sol:=[];
    for u in [1..60] do
       for ss in [1..#v-1] do
        if v[ss+1]-v[ss] gt u then
             sol[u]:=ss;
             break;
         end if;
       end for;
    end for;
       sol;
    
  • PARI
    a(n) = my(k=1); while(prime(k+1) - prime(k) <= n, k++); k; \\ Michel Marcus, Apr 03 2019

Formula

a(2*n) = a(2*n+1) = A144309(n+1) for n>=1. - Georg Fischer, Dec 05 2022

A316917 Let g(n) be the n-th maximal prime gap; a(n) = 1 if g(n) has record merit, 0 if it does not.

Original entry on oeis.org

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

Views

Author

Rodolfo Ruiz-Huidobro, Jul 16 2018

Keywords

Comments

a(n) = 1 if A002386(n) is in A111870, a(n) = 0 if A002386(n) is not in A111870.
The merit M of a prime gap of measure g following the prime p_1 is defined as M=g/ln(p_1). It is the ratio of the measure of the gap to the "average" measure of gaps near that point. As an example, the merit of the sixth maximal gap, of size 14, after prime 113 is 2.96.
a(81) = 0 because there are previous maximal gaps with higher merits. - Rodolfo Ruiz-Huidobro, Jan 23 2024
a(82) = 1 as the merit of the gap is 1572/log(18571673432051830099)=1572/44.37=35.43 (which is a record merit). - Rodolfo Ruiz-Huidobro, May 10 2024
a(83) =1 as the merit for the gap is 1676/log(20733746510561444539) =1676/44.48=37.681 (which is a record merit). - Rodolfo Ruiz-Huidobro, Dec 20 2024

Examples

			The 5th record prime gap from 89 to 97 does not have record merit, so a(5) = 0.
The 10th record prime gap from 1327 to 1361 has record merit, so a(10) = 1.
		

Crossrefs

Programs

  • Mathematica
    Block[{nn = 10^6, s, t, u, v}, s = Prime@ Range[nn]; t = Differences@ s; u = Map[(#2 - #1)/Log[#1] & @@ # &, Partition[Prime@ Range[nn], 2, 1]]; v = Map[Prime@ FirstPosition[u, #][[1]] &, Union@ FoldList[Max, u]]; Boole[! FreeQ[v, s[[FirstPosition[t, #][[1]] ]] ] ] & /@ Union@ FoldList[Max, t]] (* Michael De Vlieger, Jul 19 2018 *)

Extensions

a(81) from Rodolfo Ruiz-Huidobro, Jan 23 2024
a(82) from Rodolfo Ruiz-Huidobro, May 10 2024
a(83) from Rodolfo Ruiz-Huidobro, Dec 09 2024

A326915 Number of terms of A002386 (primes preceding record prime gaps) in the interval (2^n, 2^(n+1)].

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 1, 3, 0, 3, 0, 1, 0, 2, 1, 1, 2, 2, 0, 2, 2, 1, 1, 3, 1, 1, 2, 5, 2, 3, 1, 1, 1, 1, 1, 1, 2, 0, 0, 3, 0, 0, 0, 0, 2, 1, 2, 4, 1, 1, 0, 2, 3
Offset: 0

Views

Author

John W. Nicholson, Oct 20 2019

Keywords

Comments

The record prime gaps are in A005250; the corresponding primes are in A002386.

Examples

			For n=3, there are no primes p_m in A002386 in the range 2^3 = 8 < p_m <= 16 = 2^4, so a(3)=0.
For n=6, there are 2 primes p_m in A002386 in the range 2^6 = 64 < p_m <= 128 = 2^7, namely p_m = 89, 113, so a(6)=2.
		

Crossrefs

Cf. A000101 (upper ends), A005250 (record gaps).

A327742 Triangle T(k, n) read by rows, where the entries of the triangle are lengths of longest runs of consecutive sums of k-length combinations of first n primes. Specially, T(0, n) = 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 4, 2, 1, 1, 2, 4, 4, 2, 1, 1, 2, 5, 6, 5, 2, 1, 1, 2, 5, 10, 10, 5, 2, 1, 1, 2, 5, 18, 16, 18, 5, 2, 1, 1, 2, 5, 22, 28, 28, 22, 5, 2, 1, 1, 2, 5, 22, 38, 46, 38, 22, 5, 2, 1, 1, 2, 5, 40, 46, 58, 58, 46, 40, 5, 2, 1, 1, 2, 5, 42, 64, 72, 76, 72, 64, 42, 5, 2, 1
Offset: 0

Views

Author

Matej Veselovac, Oct 07 2019

Keywords

Comments

The terms of the sequence, when observed in conjunction with prime gaps of size <= T(k, n), can be used to determine natural numbers N which are "trivially" sums of exactly k+1 distinct primes. For example, if we observe k=9, n=12, this leads to conclusion that numbers N=179,...,15683 can be "trivially" represented as sums of exactly ten (k+1=9+1=10) distinct primes. That is, firstly, we have T(9, 12)=42. The starting value of the longest 42-long run is 138, and the next distinct prime, the 13(=n+1=12+1)th prime, is 41. This gives the number 138+41=179 as the smallest such "trivially" representable number. Secondly, the first smallest prime gap larger than T(9, 12)=42 is 44, appearing after (prime) number 15683, and the prime gaps before it are at most 36 < 42. Finally, all this implies that all numbers N=179,...,15683 have a "trivial" representation as a sum of exactly ten (k+1=9+1=10) distinct primes, since (k=9)-long combinations of the first n=12 primes are enough to cover all prime gaps (2,...,36 < 42) up to number 15683, when combined with tenth (k+1=9+1=10th among the summed primes) distinct (n+1=12+1=13th or larger among primes) prime p=41,...,15683.
Note that in the previous example, the 179,15683 are not smallest,largest such numbers in general, but just smallest,largest such "trivially" representable numbers. Determining the sets (intervals) of such "trivial" numbers, reduces the set of "nontrivial" such numbers that we need to check with other means, in more general cases.
A trivial upper bound is binomial(k, n) >= T(k, n), since there are binomial(k, n) k-long combinations of a set with n elements, and not necessarily all sums of those combinations are consecutive.

Examples

			Specially, if k=0, then we do not have sums, and this is defined as 1 = T(0, n).
Trivially, if k=n, then T(n, n) = 1, since we have only one sum, the sum of first n prime numbers.
Nontrivial example: if n=4, we have first four primes {2,3,5,7}. Now, for example, if k=2, we have the following sums of 2-combinations: "5,7,8,9,10,12", since:
{2,3} -> 2+3 = 5
{2,5} -> 2+5 = 7
{3,5} -> 3+5 = 8
{2,7} -> 2+7 = 9
{3,7} -> 3+7 = 10
{5,7} -> 5+7 = 12
We now see that the triangle entry is: T(k=2, n=4)=4, since "7,8,9,10" is the longest run of consecutive sums of 2-combinations of first 4 primes.
First 16 rows of triangle T(k, n) where n=0..15, k=0..n:
1;
1, 1;
1, 2, 1;
1, 2, 2,  1;
1, 2, 4,  2,  1;
1, 2, 4,  4,  2,   1;
1, 2, 5,  6,  5,   2,   1;
1, 2, 5, 10, 10,   5,   2,   1;
1, 2, 5, 18, 16,  18,   5,   2,   1;
1, 2, 5, 22, 28,  28,  22,   5,   2,   1;
1, 2, 5, 22, 38,  46,  38,  22,   5,   2,   1;
1, 2, 5, 40, 46,  58,  58,  46,  40,   5,   2,  1;
1, 2, 5, 42, 64,  72,  76,  72,  64,  42,   5,  2,  1;
1, 2, 5, 46, 70,  94,  94,  94,  94,  70,  46,  5,  2, 1;
1, 2, 5, 60, 76, 102, 118, 114, 118, 102,  76, 60,  5, 2, 1;
1, 2, 5, 66, 94, 124, 130, 142, 142, 130, 124, 94, 66, 5, 2, 1;
		

Crossrefs

Cf. A000040 (prime numbers).
Cf. A001223 (prime gaps), A005250 (record prime gaps), A002386 (Record prime gaps primes).

Programs

  • Python
    p = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53]
    from itertools import combinations, groupby, count
    def T(k, n):
        if k==0:
            return [0]
        lst = sorted(set([sum(combo) for combo in combinations(p[:n], k)]))
        c = count()
        return max((list(g) for _, g in groupby(lst, lambda x: x-next(c))), key=len)
    for n in range(len(p)+1):
        for k in range(n+1):
            print(len(T(k,n)),end=", ")
        #print()
Previous Showing 61-67 of 67 results.