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.

A079416 a(n) = round(prime(n)/n).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 07 2003

Keywords

Comments

The sequence is not monotone, see example and A079417.

Examples

			a(20) = round(prime(20)/20) = round(71/20) = round(3.55) = 4;
a(21) = round(prime(21)/21) = round(73/21) = round(3.476190...) = 3;
a(22) = round(prime(22)/22) = round(79/22) = round(3.590909...) = 4.
		

Crossrefs

Programs

  • Magma
    [Round(NthPrime(n)/n): n in [1..100]]; // G. C. Greubel, Jan 18 2019
    
  • Mathematica
    f[n_] := Round[ Prime[n]/n]; Array[f, 105] (* Robert G. Wilson v, Oct 23 2015 *)
  • PARI
    vector(100, n, round(prime(n)/n)) \\ G. C. Greubel, Jan 18 2019
    
  • Sage
    [round(nth_prime(n)/n) for n in (1..100)] # G. C. Greubel, Jan 18 2019

A079417 Numbers n such that round(prime(n)/n) < round(prime(n-1)/(n-1)).

Original entry on oeis.org

21, 117, 4117, 4137, 4139, 4142, 4144, 4152, 63326, 63416, 63424, 399872, 399918, 399930, 399944, 399949, 399955, 1014615, 1014635, 1014648, 2582130, 2582200, 2582205, 2582242, 2582374, 2582437, 2582460, 2582483, 2582486, 6592657
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 07 2003

Keywords

Comments

A079416(a(n)) < A079416(a(n-1)).

Crossrefs

A subsequence of A079418.

Programs

  • Mathematica
    Reap[For[n = 2, n <= 7*10^6, n++, If[Round[Prime[n]/n] < Round[Prime[n-1]/(n-1)], Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Jun 10 2017 *)

Extensions

More terms from Sascha Kurz, Jan 09 2003 and from Dean Hickerson, Jan 17 2003

A079419 Primes p such that p/i(p) < prime(i(p)-1)/(i(p)-1), where i(p) = A049084(p).

Original entry on oeis.org

3, 13, 19, 31, 43, 61, 73, 103, 109, 131, 139, 151, 167, 181, 193, 197, 199, 227, 229, 233, 241, 271, 281, 283, 311, 313, 317, 349, 353, 383, 401, 421, 433, 443, 461, 463, 467, 491, 503, 523, 571, 601, 617, 619, 643, 647, 661, 677, 743, 761, 773, 811, 823
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 07 2003

Keywords

Crossrefs

Programs

Formula

a(n) = A000040(A079418(n)).

A342877 a(n) = 1 if the average distance between consecutive first n primes is greater than that of the first n-1 primes, otherwise a(n) = 0, for n > 2.

Original entry on oeis.org

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

Views

Author

Andres Cicuttin, Mar 28 2021

Keywords

Comments

The average distance between consecutive primes among the first n primes tends to increase with n. This average distance always changes when n is increased to n + 1, but it seems that most of the times this distance decreases. See a log-linear scatter plot of (1/n) Sum_{i=1..n} a(i) in Links.
Conjecture: lim_{n->infinity} (1/n) Sum_{i=1..n} a(i) < 1/2.
In support of the conjecture: If it is assumed, as an approximation, that position of primes follows a Poisson point process then the distance between consecutive primes is a stochastic variable with exponential probability distribution function. The probability that an exponentially distributed stochastic variable takes a value larger than the mean value is about 0.367879.

Examples

			a(3) = 1 because the average distance between consecutive first three primes {2,3,5} is (5 - 2)/2 = 3/2 which is greater than the average distance between consecutive first two primes {2,3} which is (3-2)/1 = 1.
a(6)=0 because the average distance between consecutive first six primes {2,3,5,7,11,13} is (13 - 2)/5 = 11/5 which is smaller than the average distance between consecutive first five primes {2,3,5,7,11} which is (11 - 2)/4 = 9/4.
		

Crossrefs

Programs

  • Mathematica
    a={}; nmax=128;
    Do[If[(Prime[n]-2)/(n-1)>(Prime[n-1]-2)/(n-2),AppendTo[a,1],AppendTo[a,0]],{n,3,nmax}];
    a
    (* Uncomment and run next lines to produce the log-linear plot available in Links *)
    (* a={};
    nmax=2^18;
    Do[If[(Prime[n]-2)/(n-1)>(Prime[n-1]-2)/(n-2),AppendTo[a,{n,1}],AppendTo[a,{n,0}]],{n,3,nmax}];
    ListLogLinearPlot[Transpose[{Range[3,nmax],Accumulate[Transpose[a][[2]]]/Range[3,nmax]}],Frame->True,PlotRange->{All,{0.25,0.75}},PlotLabel->Text[Style["Sum_{i=1..n} a(i)/n",FontSize->16]],
    FrameLabel->{Text[Style["n",FontSize->16]],},PlotStyle->{PointSize->Small,Red},GridLines->Automatic] *)
  • PARI
    A342877(n) = (((prime(n)-2)/(n-1)) > ((prime(n-1)-2)/(n-2))); \\ Antti Karttunen, Mar 28 2021
Showing 1-4 of 4 results.