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-4 of 4 results.

A279067 Least prime q such that (r-q)/(q-p), where pA038566/A038567.

Original entry on oeis.org

5, 11, 29, 37, 6421, 367, 149, 14281, 251, 701, 521, 631, 84913, 127, 331, 75479, 787, 7057, 1949, 3407, 388621, 1847, 1277, 1087, 2879, 1399, 13859, 4621, 43391, 1657, 743507, 40213, 1151, 162209, 1973, 3491, 736577, 2579, 8039, 1264129, 14369, 43691, 4547, 4201, 8147, 29101
Offset: 1

Views

Author

Keywords

Comments

Almost a bisection of A275785 with only the term 5 being in both A279066 & A279067.
The union of A279066 & A279067 is A275785 with only 5 as a common term.
Records: 5, 11, 29, 37, 6421, 14281, 84913, 388621, 743507, 1264129, 1491377, 1613279, 15733451, 27196633, 106132883, 125747441, 304328911, 344278939, 756574061, 1166821769, 2691812749, ..., .
1/n = A179256(n).

Examples

			Row 1:        1/1                          5
Row 2:        1/2                         11
Row 3:     1/3  2/3                   29      37
Row 4:     1/4  3/4                 6421     367
Row 5: 1/5 2/5  3/5 4/5       149  14281     251
Row 6:     1/6  5/6                 521      631
Row 7: 1/7    ..    6/7  84913 127  331    75479   787 7057
Row 8: 1/8 3/8  5/8 7/8       1949 3407   388621  1847
etc.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 2, q = 3, r = 5}, While[(r - q) != n(q - p), p = q; q = r; r = NextPrime@ r]; q]; Farey[n_] := Union@ Flatten@ Table[a/b, {b, n}, {a, 0, b}]; ff = Rest@ Reverse@ Sort[ Farey[25], Denominator[#2] < Denominator[#1] &]; f@# & /@ ff

A279066 Least prime q such that (q-p)/(r-q), where pA038566/A038567.

Original entry on oeis.org

5, 3, 31, 23, 8123, 89, 139, 7963, 337, 409, 199, 797, 45439, 113, 953, 88547, 293, 2633, 1933, 3643, 137029, 13381, 523, 2861, 1381, 1259, 7621, 7433, 156157, 3089, 546781, 30911, 1951, 294563, 1129, 3229, 285871, 10369, 14221, 3651341, 25819, 3967, 1669, 6173, 23473, 51383
Offset: 1

Views

Author

Keywords

Comments

Almost a bisection of A275785 with only the term 5 being in both A279066 & A279067.
The union of A279066 & A279067 is A275785 with only 5 as a common term.
1/n = A179210(n).
Records: 5, 31, 8123, 45439, 88547, 137029, 156157, 546781, 3651341, 11931613, 16613347, 54636251, 72510257, 102626747, 148379059, 290018137, 847428851, 1165527283, 8232085373, 32592174133, 40113962921, ..., .

Examples

			Row 1:        1/1                                       5
Row 2:        1/2                                       3
Row 3:     1/3  2/3                                 31      23
Row 4:     1/4  3/4                               8123      89
Row 5: 1/5 2/5  3/5 4/5                      139  7963     337    409
Row 6:     1/6  5/6                                199     797
Row 7:    1/7 .. 6/7                   45439 113   953   88547    293   2633
Row 8: 1/8 3/8  5/8 7/8                     1933  3643  137029  13381
etc.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 2, q = 3, r = 5}, While[q != n(r - q) + p, p = q; q = r; r = NextPrime@ r]; q]; Farey[n_] := Union@ Flatten@ Table[a/b, {b, n}, {a, 0, b}]; ff = Rest@ Reverse@ Sort[ Farey[25], Denominator[#2] < Denominator[#1] &]; f@# & /@ ff

A358200 Frequency ranking position of the ratio r(n) between consecutive prime gaps, among all previous ratios {r(i) : 2 < i < n, r(i) = (prime(i) - prime(i-1))/(prime(i-1) - prime(i-2))}. If the ratio r(n) is not among previous ratios, then a(n)=n.

Original entry on oeis.org

4, 2, 6, 1, 2, 1, 10, 11, 12, 13, 2, 1, 6, 6, 5, 7, 7, 2, 7, 5, 7, 25, 2, 1, 2, 1, 2, 31, 32, 4, 6, 35, 36, 6, 7, 6, 4, 7, 7, 12, 9, 2, 2, 47, 6, 5, 1, 2, 5, 4, 9, 55, 5, 4, 4, 7, 7, 1, 8, 63, 10, 1, 2, 14, 68, 69, 9, 2, 5, 14, 74, 4, 6, 5, 11, 1, 2, 81, 9, 9, 9, 8, 6, 4, 10, 1, 1, 2, 7, 6, 1, 2, 1, 3, 2, 99, 100, 6, 19, 16
Offset: 4

Views

Author

Andres Cicuttin, Feb 22 2023

Keywords

Comments

Given all primes up to prime(n-1) with n > 3, if a(n) != n then a(n) is the number of attempts to find the prime(n) using to the following algorithm:
1) Calculate all previous consecutive prime-gaps ratios psr(n) = {r(i) : 2 < i < n, r(i) = (prime(i) - prime(i-1))/(prime(i-1) - prime(i-2))}.
2) Tally the elements {r(i)} and sort them according to their frequencies in descending order first, and then by their values in ascending order.
3) Check the primality of candidates q in the same order as the ratio (q - prime(n-1))/(prime(n-1) - prime(n-2)) appears in the ordered set obtained above.
In the first 2^17 primes the median of all consecutive prime-gaps ratios is 16 and there are 621 different ratios.
Conjectures:
1) a(n)=n or a(n) < x*n^y with x ~ 6 and y ~ 0.4 (verified for first 2^16 primes).
2) The sequence is unbounded. (Equivalent to conjecture in A001223 on Sep 29 2018.)
3) The relative frequencies (probabilities) of the consecutive prime-gap ratios approach constants as the length of the list of first primes approaches infinity. (Equivalent to conjecture in A001223 on Sep 01 2019.)

Examples

			In the table below for the first terms, the columns are: index n, primes(n), consecutive prime-gaps ratio r(n), previous sorted ratios psr(n), and a(n).
   n  prime(n)  r(n)  psr(n)                        a(n)
   1    2       -     {}                             -
   2    3       -     {}                             -
   3    5       2     {}                             -
   4    7       1     {2}                            4
   5   11       2     {1, 2}                         2
   6   13       1/2   {2, 1}                         6
   7   17       2     {2, 1/2, 1}                    1
   8   19       1/2   {2, 1/2, 1}                    2
   9   23       2     {2, 1/2, 1}                    1
  10   29       3/2   {2, 1/2, 1}                    10
  11   31       1/3   {2, 1/2, 1, 3/2}               11
  12   37       3     {2, 1/2, 1/3, 1, 3/2}          12
  13   41       2/3   {2, 1/2, 1/3, 1, 3/2, 3}       13
  14   43       1/2   {2, 1/2, 1/3, 2/3, 1, 3/2, 3}  2
a(4), a(6), a(10), a(11), a(12) and a(13) are respectively 4, 6, 10, 11, 12 and 13 because the corresponding ratios 1, 1/2, 3/2, 1/3, 3 and 2/3 are ratios that appear for the first time.
a(5) = 2 because the corresponding ratio r(5)=2 is at the second position in the ordered set of previous ratios psr(5)={1, 2}.
a(9) = 1 because the corresponding ratio r(9)=2 is at the first position in the ordered set of previous ratios psr(7)={2, 1/2, 1}.
		

Crossrefs

Cf. A001223 (Prime gaps), A275785, A276812, A272863, A274225.

Programs

  • Mathematica
    p[n_]:= Prime[n];
    (* consecutive prime-gaps ratio *)
    r[n_]:= (p[n] - p[n - 1])/(p[n - 1] - p[n - 2]);
    (* sorted ratios according to increasing frequency and decreasing value *)
    fracs[n_]:= Transpose[SortBy[Tally[r[Range[3, n]]], {-#[[2]] &, #[[1]] &}]][[1]];
    SetAttributes[fracs, Listable];
    (* Position of the new ratio r[j] in previous list, or j if not present *)
    a[j_] := Append[Position[fracs[j - 1], r[j]], {j}] // First // First;
    SetAttributes[a, Listable];
    (* First 100 terms starting from n=4 *)
    a[Range[4,103]]

A359357 Number of different ratios between consecutive prime gaps among the first n primes.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19
Offset: 3

Views

Author

Andres Cicuttin, Dec 27 2022

Keywords

Comments

What about the asymptotic behavior of a(n), and upper and lower bounds?

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..102)]:
    G:= P[2..-1]-P[1..-2]:
    R:= G[2..-1] /~ G[1..-2]:
    seq(nops(convert(R[1..n],set)),n=1..100); # Robert Israel, Jan 25 2023
  • Mathematica
    g[m_]:=(Prime[m+2]-Prime[m+1])/(Prime[m+1]-Prime[m]);
    Table[Tally[g[Range[j]]]//Length,{j,1,2^7}]
  • PARI
    f(n) = (prime(n+2)-prime(n+1))/(prime(n+1)-prime(n)); \\ A274263
    a(n) = #Set(vector(n, k, f(k))); \\ Michel Marcus, Dec 28 2022

Formula

a(n) = #{A001223(i+1)/A001223(i)}, i < n-1, where A001223 are prime gaps.
Showing 1-4 of 4 results.