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

A275785 Primes such that the ratio between the distance to the next prime and from the previous prime appears for the first time.

Original entry on oeis.org

3, 5, 11, 23, 29, 31, 37, 89, 113, 127, 139, 149, 199, 251, 293, 331, 337, 367, 409, 521, 523, 631, 701, 787, 797, 953, 1087, 1129, 1151, 1259, 1277, 1327, 1361, 1381, 1399, 1657, 1669, 1847, 1933, 1949, 1951, 1973, 2477, 2503, 2579, 2633, 2861, 2879, 2971, 2999, 3089, 3137, 3163, 3229, 3407
Offset: 1

Views

Author

Andres Cicuttin, Nov 14 2016

Keywords

Comments

Number of terms less than 10^n: 2, 8, 26, 85, 224, 511, 1035, 1905, 3338, ..., . - Robert G. Wilson v, Nov 30 2016

Examples

			a(1) = 3 because this is the first prime for which it is possible to determine the ratio between the distance to the next prime (5) and from the previous prime (2). This first ratio is 2.
a(2) = 5 because the ratio between the distance to the next prime (7) and from the previous prime (3) is 1 and this ratio has not appeared before.
The third element a(3) is not 7 because (11-7)/(7-5) = 2, a ratio that appeared before with a(1), so a(3) = 11 because (13-11)/(11-7) = 1/2, a ratio that did not appear before.
		

Crossrefs

Programs

  • Mathematica
    nmax = 720;
    a = Prime[Range[nmax]];
    gaps = Rest[a] - Most[a];
    gapsratio = Rest[gaps]/Most[gaps];
    newpindex = {}; newgratios = {}; i = 1;
    While[i < Length[gapsratio] + 1,
    If[Cases[newgratios, gapsratio[[i]]] == {},
      AppendTo[newpindex, i + 1];
      AppendTo[newgratios, gapsratio[[i]]] ];
      i++];
    Prime[newpindex]
    p = 2; q = 3; r = 5; rtlst = qlst = {}; While[q < 10000, rt = (r - q)/(q - p); If[ !MemberQ[rtlst, rt], AppendTo[rtlst, rt]; AppendTo[qlst, q]]; p = q; q = r; r = NextPrime@ r]; qlst (* Robert G. Wilson v, Nov 30 2016 *)

A289777 Frequency of the largest spectral component of the prime characteristic function of the first n numbers, for n>3, excluding the smallest and largest frequencies. In case of a tie, use the smallest frequency.

Original entry on oeis.org

2, 2, 3, 3, 4, 3, 5, 5, 4, 6, 6, 4, 7, 7, 7, 8, 8, 5, 9, 9, 9, 6, 6, 6, 6, 11, 11, 7, 12, 12, 7, 13, 13, 14, 14, 14, 15, 15, 15, 8, 16, 16, 17, 17, 17, 11, 18, 18, 10, 10, 19, 12, 20, 20, 11, 11, 21, 21, 22, 22, 12, 23, 23, 12, 24, 24, 13, 25, 25, 13, 26, 26, 14, 27, 27, 14, 28, 28, 29, 29, 29, 15, 30, 30, 16, 16
Offset: 4

Views

Author

Andres Cicuttin, Jul 12 2017

Keywords

Comments

The Discrete Fourier transform is applied to the list of the prime characteristic function (A010051) of the first n numbers; then the position of the largest absolute value of the components of the transformed list, disregarding the first and last components, is selected. If there are several identical maxima then the lowest position of them is taken.
The scatter plot of these maximum spectral components exhibits a curious pattern in which these components are essentially aligned along two convergent directions (see link).
It seems that the Fourier spectrum of the prime characteristic function is remarkably symmetric when obtained from a list with an even numer of elements (see link) and it could be related to the symmetry found in the distribution of consecutive and alternate primes gap ratios (see comments and plots in A274263 and A276309).
Conjecture: lim_{n->inf} abs(4a(n)/n - 1) = 1/3.

Examples

			For the first 43 terms of the characteristic function of primes (A010051), the absolute values of its discrete Fourier transform have a maximum at position 8 after excluding the smallest frequency (first position) and the largest frequency (last position), then a(43) = 8.
		

Crossrefs

Programs

  • Mathematica
    PrimeChar[n_] := If[PrimeQ[n] == True, 1, 0];
    Table[Position[b = Abs@Fourier@Table[PrimeChar[j], {j, 1, n}],
       Max[b[[2 ;; Floor[n/2]]]]][[1, 1]], {n, 4, 160}]

A285851 Denominator of the ratio of alternate consecutive prime gaps: Denominator((prime(n + 3) - prime(n + 2))/(prime(n + 1) - prime(n))).

Original entry on oeis.org

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

Views

Author

Andres Cicuttin, Apr 27 2017

Keywords

Crossrefs

Cf. A286634 (numerators), A001223, A000040, A274225, A276309.

Programs

  • Mathematica
    Table[Denominator[(Prime[k+3]-Prime[k+2])/(Prime[k+1]-Prime[k])],{k,100}]

Formula

a(n) = denominator((prime(n + 3) - prime(n + 2))/(prime(n + 1) - prime(n))).
A000040(n+3) = 5 + Sum_{k=1..n} ((1+(-1)^k)*Product_{j=1..k}(A286634(j)/a(j))^((1+(-1)^j)/2) + ((1-(-1)^k)/2)*Product_{j=1..k}(A286634(j)/a(j))^((1-(-1)^j)/2)), for n>0.
A001223(n+2) = (1+(-1)^n)*Product_{j=1..n}(A286634(j)/a(j))^((1+(-1)^j)/2) - ((-1+(-1)^n)/2)*Product_{j=1..n}(A286634(j)/a(j))^((1-(-1)^j)/2), for n>0.

A286634 Numerator of the ratio of alternate consecutive prime gaps: Numerator ((prime(n + 3) - prime(n + 2))/(prime(n + 1) - prime(n))).

Original entry on oeis.org

2, 2, 1, 1, 1, 1, 3, 1, 1, 2, 1, 1, 3, 3, 1, 1, 2, 1, 3, 2, 1, 2, 2, 1, 1, 1, 1, 7, 1, 3, 1, 5, 1, 3, 3, 2, 1, 3, 1, 5, 1, 2, 1, 3, 6, 1, 1, 1, 3, 1, 5, 3, 3, 1, 1, 1, 2, 1, 5, 7, 2, 1, 1, 7, 3, 5, 1, 2, 3, 2, 1, 3, 2, 1, 2, 2, 1, 5, 1, 1, 1, 3, 2, 1, 2, 2, 1, 1, 6, 2, 1, 1, 1, 3, 3, 1, 3, 3, 5, 1
Offset: 1

Views

Author

Andres Cicuttin, May 11 2017

Keywords

Crossrefs

Cf. A285851 (denominators), A001223, A000040, A272863, A276309.

Programs

  • Mathematica
    Table[Numerator[(Prime[k+3]-Prime[k+2])/(Prime[k+1]-Prime[k])], {k, 100}]

Formula

a(n) = numerator((prime(n + 3) - prime(n + 2))/(prime(n + 1) - prime(n))).
A000040(n+3) = 5 + Sum_{k=1..n} ((1+(-1)^k)*Product_{j=1..k}(a(j)/A285851(j))^((1+(-1)^j)/2) + ((1-(-1)^k)/2)*Product_{j=1..k}(a(j)/A285851(j))^((1-(-1)^j)/2)), for n>0.
A001223(n+2) = (1+(-1)^n)*Product_{j=1..n}(a(j)/A285851(j))^((1+(-1)^j)/2) - ((-1+(-1)^n)/2)*Product_{j=1..n}(a(j)/A285851(j))^((1-(-1)^j)/2), for n>0

A303112 Primes p such that (r-q)/(q-p) = 2 or 1/2, and p < q < r are three consecutive primes.

Original entry on oeis.org

2, 5, 7, 11, 13, 17, 37, 41, 67, 89, 97, 101, 103, 107, 191, 193, 223, 227, 277, 307, 311, 347, 389, 397, 449, 457, 461, 479, 487, 491, 503, 613, 641, 739, 757, 761, 821, 823, 853, 857, 877, 881, 907, 929, 991, 1087, 1091, 1231, 1277, 1297, 1301, 1423, 1427, 1439, 1447, 1453
Offset: 1

Views

Author

Andres Cicuttin, Apr 18 2018

Keywords

Comments

Conjecture: The two most frequent ratios between consecutive prime gaps are 2 and 1/2, and both ratios occur with about the same frequency.

Examples

			The first three consecutive primes are 2, 3 and 5, and (5-3)/(3-2)=2, so the first term is a(1)=2, that is, the first prime of (2,3,5).
The next three consecutive primes are 3, 5 and 7, and (7-5)/(5-3)=1, so the first prime of (3,5,7) is not in the list.
The next three consecutive primes are 5, 7 and 11, and (11-7)/(7-5)=2, so the second term is a(2)=5, that is, the first prime of (5,7,11).
The prime 13 is also in the list because (19-17)/(17-13)=1/2.
		

Crossrefs

Cf. A257762 (indices of primes with above ratio = 2).

Programs

  • Mathematica
    b={};
    Do[If[Abs[Log[2,(Prime[j+2]-Prime[j+1])/(Prime[j+1]-Prime[j])]]==1,AppendTo[b,Prime[j]]],{j,1,200}];
    Print@b
    Select[Partition[Prime[Range[250]],3,1],(#[[3]]-#[[2]])/(#[[2]]-#[[1]]) == 2||(#[[3]]-#[[2]])/(#[[2]]-#[[1]])==1/2&][[All,1]] (* Harvey P. Dale, Mar 14 2022 *)
  • PARI
    isok(p) = my(q = nextprime(p+1), r = nextprime(q+1), f = (r-q)/(q-p)); (f == 2) || (f == 1/2);
    forprime(p=2, 1000, if (isok(p), print1(p, ", "))); \\ Michel Marcus, Apr 23 2018

Formula

Conjecture: lim_{n->inf} n/primepi(a(n)) > k > 0 for some k.

A320146 a(n) = 2*prime(n) modulo (prime(n-1) + prime(n+1)).

Original entry on oeis.org

6, 0, 14, 2, 26, 2, 38, 46, 4, 62, 2, 2, 86, 94, 0, 4, 122, 2, 2, 146, 2, 166, 178, 4, 2, 206, 2, 218, 226, 10, 262, 4, 278, 8, 302, 0, 2, 334, 0, 4, 362, 8, 386, 2, 398, 0, 8, 2, 458, 466, 4, 482, 4, 0, 0, 4, 542, 2, 2, 566, 586, 10, 2, 626, 634, 8, 674, 8, 698, 706, 718, 2, 0, 2, 766, 778, 4, 802, 818, 8, 842
Offset: 2

Views

Author

Andres Cicuttin, Oct 06 2018

Keywords

Comments

This sequence has to do with the relative position of primes with respect to their adjacent primes:
(i) if prime(n) is closer to its predecessor than to its successor, then a(n) = 2*prime(n);
(ii) if prime(n) is closer to its successor than to its predecessor, then a(n) = 2*prime(n) - prime(n-1) - prime(n+1); and
(iii) if prime(n) is equidistant from its predecessor and its successor, then a(n) = 0.
Is lim_{n -> infinity} (Sum_{i=1..n} a(i))/(Sum_{i=1..n} prime(i)) finite? If so, what is its value?

Crossrefs

Programs

  • Maple
    seq(modp(2*ithprime(n),(ithprime(n-1)+ithprime(n+1))),n=2..90); # Muniru A Asiru, Oct 07 2018
  • Mathematica
    Table[Mod[2*Prime[n], Prime[n-1] + Prime[n+1]], {n, 2, 120}]
    Mod[2#[[2]],#[[1]]+#[[3]]]&/@Partition[Prime[Range[90]],3,1] (* Harvey P. Dale, Jan 03 2019 *)
  • PARI
    a(n) = 2*prime(n) % (prime(n-1) + prime(n+1)); \\ Michel Marcus, Oct 18 2018
Showing 1-6 of 6 results.