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.

A297408 Where the prime race among 10k+1, ..., 10k+9 changes leader.

Original entry on oeis.org

2, 13, 157, 193, 347, 383, 587, 673, 907, 1163, 1327, 1483, 1907, 1933, 2897, 4723, 5557, 5573, 6037, 6113, 6637, 6673, 7487, 8273, 8317, 8363, 8387, 8443, 8467, 8573, 8647, 8803, 8837, 8933, 9277, 9293, 10067, 10103, 11897, 11923, 12037, 12073, 12107, 12143
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Comments

A007355 appears to be an erroneous version of this sequence.

Crossrefs

Programs

  • PARI
    a297408(limit)={my(v=vector(10),vm=0,ivm=0,imv); forprime(p=2,limit,my(m=p%10);v[m]++;my(mv=vecmax(v,&imv));if(mv>vm,if(imv!=ivm,print1(p,", "); ivm=imv);vm=mv))};
    a297408(12500) \\ Hugo Pfoertner, Jul 25 2021
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen():
        c, p, leader = [0 for i in range(10)], 1, None
        while True:
            p = nextprime(p); last = p%10; c[last] += 1; m = max(c)
            if c.count(m) == 1 and c.index(m) == last and last != leader:
                yield p; leader = last
    print(list(islice(agen(), 44))) # Michael S. Branicky, Dec 20 2022

A274121 The gap prime(n+1) - prime(n) occurs for the a(n)-th time.

Original entry on oeis.org

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

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Terms of this sequence grow without bound; any even number occurs in this sequence. Zhang proved that there are infinitely many primes 4680 apart from each other (see link "Bounded gaps between primes").
For a conjectured count of gap n below x, see link Polignac's conjecture.
Polignac's conjecture states that "For any positive even number n, there are infinitely many prime gaps of size n.". By this conjecture, every positive apppears infinitely many times in this sequence (see link "Polignac's conjecture").

Examples

			(p, g) denotes a prime p and the gap up to the next prime. So p + g is the next prime after p. These pairs start (2, 1), (3, 2), (5, 2), (7, 4), (11, 2). From here we see that:
- the gap after the first prime, 1 occurs for the first time, so a(1) = 1.
- the gap after the second prime, 2, occurs for the first time, so a(2) = 1.
- the gap after the third prime, 2, occurs for the second time, so a(3) = 2.
- the gap after the fourth prime, 4, occurs for the first time, so a(4) = 1.
- the gap after the fifth prime, 2, occurs for the third time, so a(5) = 3.
		

Crossrefs

Programs

  • PARI
    \\ See link by name "PARI program" for an extended version with comments.
    upto(n) = {my(gapcount=List(), freqgap = List([1])); n = max(n, 3); forprime(i=3,n,
    g = nextprime(i+1) - i; for(i=#gapcount+1, g\2, listput(gapcount,0));  gapcount[g\2]++; listput(freqgap,gapcount[g\2]));freqgap} \\ David A. Corneth, Jun 28 2016

Formula

a(primepi(A000230(n))) = 1.
a(primepi(A001359(n))) = n.
a(primepi(A029710(n))) = n.

A274122 Let F(g,p) be the frequency of g up to prime nextprime(p+1). Primes p such that F(2,p) = F(4,p) and g = 2 or 4.

Original entry on oeis.org

97, 103, 109, 137, 163, 397, 457, 463, 569, 613, 739, 821, 827, 857, 2111, 2137, 2203, 2239, 2269, 2309, 2347, 2381, 4127, 4217, 8803, 9337, 12487, 12739, 12889, 12917, 19991, 20021, 20717, 20747, 20771, 20959, 21187, 21313, 21319, 21379, 21599, 21613, 21817, 21859, 22037, 22091, 22129, 22157, 22271, 22277, 22481, 22567
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Gaps 2 and 4 are conjectured to occur roughly equally often and each occur infinitely often (see link "Polignac's conjecture").
Conjecture: This sequence is infinite.

Examples

			Up to 89, gaps 2 and 4 occur respectively 8 and 7 times. After 97 (the next prime after 89), there is a gap of 4. So up to 97, gaps 2 and 4 occur the same number of times and the gap after 97 is 2 or 4, so 97 is in the sequence.
		

Crossrefs

Programs

  • PARI
    \\ See link by name "PARI program" for an extended version with comments.
    upto(n) = {my(gapcount=List(),is24 = List()); n=max(n,3); forprime(i=3,n, g = nextprime(i+1) - i; for(i=#gapcount+1,g\2, listput(gapcount, 0));
    gapcount[g\2]++; if(g<6&&#gapcount>1,if(gapcount[1]==gapcount[2],listput(is24,i)))); is24} \\ David A. Corneth, Jun 28 2016

A276176 Consider the race between primes, semiprimes, 3-almost primes, ... k-almost primes; sequence indicates when one overtakes another to give a new race leader.

Original entry on oeis.org

2, 26, 31, 34, 15526, 151165506068, 151165506073, 151165506089, 151165506093, 151165506295, 151165506410, 151165506518, 151165506526, 151165506658, 151165506665, 151165506711, 151165506819, 151165506970, 151165506994, 151165507256, 151165507259, 151165507265
Offset: 1

Views

Author

Keywords

Comments

A "k-almost prime" is a number which is the product of exactly k primes.
Let pi_k(n) be the number of k-almost primes less than or equal to n. In 1909, on page 211 of the Handbuch, Edmund G. H. Landau stated that pi_k(n) ~ (n/log n)*(log log n^(k-1))/(k-1)! for all k >= 0.
Because of this fact, eventually the semiprimes will outnumber the primes; they do starting at 34. Likewise the 3-almost primes will outnumber the semiprimes and they do starting at 15526.
The terms from a(6) = 151165506068 to a(170) = 151165607026 correspond to counts of 4-almost and 3-almost primes overtaking each other multiple times. - Giovanni Resta, Aug 17 2018

Examples

			a(1) = 2 since beginning with the natural numbers (A000027) the race is even with no group in the lead. But at 2, we encounter our first member (1 is unity and is not a member of any group here) which is a prime and therefore the primes take the lead with 2.
a(2) = 34 which is a semiprime. pi_1(34) = 11 and pi_2(34) = 12. This is the first time that the semiprimes overtake the primes.
		

References

  • Edmund Georg Hermann Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Band I, B. G. Teubner, Leipzig u. Berlin, or Chelsea Publishing, NY 1953, or Vol. 1, Teubner, Leipzig; third edition: Chelsea, New York 1974.

Crossrefs

Cf. A243906, A273381, A274123, A358677, A359242 (restricted to squarefree numbers).

Programs

  • Mathematica
    k = 1; lst = {}; tf = 0; p1 = 0; p2 = 0; While[k < 100001, If[PrimeOmega@k == 1, p1++]; If[PrimeOmega@k == 2, p2++]; If[p1 > p2 && tf == 0, tf++; AppendTo[lst, k]]; If[p2 > p1 && tf == 1, tf--; AppendTo[lst, k]]; k++]; lst
    (* cross check using *) AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[ Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]] ]]]; (* Eric W. Weisstein, Feb 07 2006 *)
    (* as an example *) AlmostPrimePi[2, 15526] => 3986 whereas AlmostPrimePi[3, 15526] => 3987.

Formula

It seems plausible that 0.8 * log(A284411(m) - 1) <= log(a(n)) <= log(A284411(m)) in the instances where the overtaking concerns m-almost-primes and (m-1)-almost-primes. - Peter Munn, Aug 03 2023

Extensions

a(6)-a(22) from Giovanni Resta, Aug 17 2018
Name clarified by Peter Munn, Dec 31 2022
Showing 1-4 of 4 results.