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.

A281889 a(n) is the least integer k such that more than half of all integers are divisible by a product of n integers chosen from 2..k.

Original entry on oeis.org

3, 7, 433, 9257821
Offset: 1

Views

Author

Peter Munn, Feb 01 2017

Keywords

Comments

The n chosen integers need not be distinct.
By "more than half of all integers" we mean more precisely "more than half of the integers in -m..m, for all sufficiently large m (depending on n)", and similarly with 1..m for "more than half of all positive integers".
Equivalently, a(n) is the least prime p such that more than half of all positive integers can be written as a product of primes of which n or more are not greater than p. (In this sense, a(n) might be called the median n-th least prime factor of the integers.)
The number of integers that satisfy the "product of primes" criterion for p = prime(m) is the same in every interval of primorial(m)^n integers and is A281891(m,n). Primorial(m) = A002110(m), product of the first m primes.
a(n) is the least k = prime(m) such that 2 * A281891(m,n) > A002110(m)^n.
a(n) is the least k such that more than half of all positive integers equate to the volume of an orthotope with integral sides at least n of which are orthogonal with length between 2 and k inclusive.
The next term is estimated to be a(5) ~ 3*10^18.

Examples

			For n=1, we have a(1) = 3 since for all m > 1, more than half of the integers in -m..m are divisible by an integer chosen from 2..3, i.e., either 2 or 3. We must have a(1) > 2, because the only integer in 2..2 is 2, but in each interval -2m-1..2m+1, only 2m+1 integers are even, so 2 is not a divisor of more than half of all integers in the precise sense given above.
		

Crossrefs

Other sequences about medians of prime factors: A126282, A126283, A284411, A290154.

A290154 Smallest number k such that exactly half the numbers in [1..k] are prime(n)-smooth.

Original entry on oeis.org

6, 20, 42, 78, 118, 184, 248, 332, 428, 534, 654, 772, 906, 1052, 1208, 1388, 1562, 1754, 1958, 2164, 2396, 2638, 2896, 3144, 3424, 3682, 3986, 4304, 4622, 4976, 5286, 5652, 6002, 6374, 6748, 7148, 7532, 7934, 8356, 8786, 9224, 9684, 10158, 10618, 11114, 11604
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 21 2017

Keywords

Comments

All terms are even numbers (because of the "exactly half the numbers in [1..k]" part of the definition).

Examples

			The 2-smooth numbers are 1, 2, 4, 8, 16, 32, ... (A000079, the powers of 2), so the numbers of 2-smooth numbers in the interval [1..k] for k = 2, 4, and 6 are 2, 3, and 3, respectively; thus, the smallest k at which the number of 2-smooth numbers in [1..k] is exactly k/2 is k=6, so a(1)=6.
The 3-smooth numbers are 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, ... (A003586), so there are more than k/2 3-smooth numbers in [1..k] for every positive k < 20, but exactly k/2 3-smooth numbers in [1..20], so a(2) = 20.
		

Crossrefs

Programs

  • Maple
    N:= 100:
    mypi:= proc(n) option remember; global pmax; local k;
      k:= procname(pmax);
      while pmax < n do pmax:= nextprime(pmax); k:= k+1 od;
      k
    end proc:
    pmax:= 2: mypi(2):= 1:
    V:= Vector(N):
    count:= 0:
    loheap:=heap[new](`<`,0): nlo:= 1:
    hiheap:= heap[new](`>`,1): nhi:= 1:
    for k from 4 by 2 while count < N do
       for v in [mypi(max(numtheory:-factorset(k-1))), mypi(max(numtheory:-factorset(k)))] do
         if v <= heap[max](loheap) then heap[insert](v,loheap); nlo:= nlo+1;
         elif v >= heap[max](hiheap) then heap[insert](v,hiheap); nhi:= nhi+1;
         elif nlo <= nhi then heap[insert](v,loheap); nlo:= nlo+1;
         else heap[insert](v,hiheap); nhi:= nhi+1;
         fi;
       od;
       if nlo < nhi-1 then
            t:= heap[extract](hiheap);
            heap[insert](t,loheap);
            nlo:= nlo+1; nhi:= nhi-1;
       elif nhi < nlo-1 then
            t:= heap[extract](loheap);
            heap[insert](t,hiheap);
            nhi:= nhi+1; nlo:= nlo-1;
       fi;
       for n from heap[max](loheap) to min(heap[max](hiheap)-1, N) do
         if V[n] = 0 then count:= count+1; V[n]:= k;
         fi
       od;
    od:
    convert(V,list); # Robert Israel, Mar 28 2019
  • Mathematica
    smoothQ[k_, p_] := k <= p || Max[FactorInteger[k][[All, 1]]] <= p; a[n_] := For[p = Prime[n]; cnt = 0; k = 1, True, k++, If[smoothQ[k, p], cnt++]; If[cnt == k/2, Return[k]]]; Array[a, 46] (* Jean-François Alcover, Jul 22 2017 *)
  • PARI
    is(k,n) = {m=k; forprime(p=2, prime(n), while(m%p==0, m=m/p)); return(m==1); }
    a(n) = {j=2; x=2; y=0; while(x!=y, j+=2; s=is(j,n)+is(j-1,n); x+=s; y+=2-s); j; } \\ Jinyuan Wang, Aug 03 2019
    
  • Python
    # see link for a faster version producing bfile
    from sympy import factorint, prevprime, primerange, prod
    def aupto(limit):
        adict, pN = dict(), prevprime(limit+1)
        pi = {p: i for i, p in enumerate(primerange(1, pN+1), start=1)}
        smooth = {i: 0 for i in pi.values()}
        watching = smooth[0] = 1  # 1 is prime(n) smooth for all n
        for n in range(2, limit+1):
            f = factorint(n, limit=pN)
            nt = prod(p**f[p] for p in f if p <= pN)
            if nt == n: smooth[pi[max(f)]] += 1
            if 2*sum(smooth[i] for i in range(watching+1)) == n:
                adict[watching] = n
                watching += 1
        return sorted(adict.values())
    print(aupto(12000)) # Michael S. Branicky, Jun 20 2021

A126282 Median of the largest prime dividing the first 10^n numbers greater than 1.

Original entry on oeis.org

3, 11, 43, 191, 797, 3259, 13267, 54049, 219277, 887707
Offset: 1

Views

Author

Mark Thornquist (mthornqu(AT)fhcrc.org) and Robert G. Wilson v, Dec 15 2006

Keywords

Comments

A randomly selected number <= 10^n (uniform distribution from 2 to 10^n) has a 50% probability of having a prime factor at least as large as a(n).

Examples

			The largest prime divisors of the nonunit 1-digit numbers are 2, 3, 2, 5, 3, 7, 2 and 3 respectively, with median 3.
		

Crossrefs

Programs

  • Mathematica
    f[n_Integer(* n must be even so as to find a true median, not an average, and n must be greater than *)] := Block[{cnt, lmt = n/2, p = PrimePi[n/2], q = PrimePi[n]}, cnt = q - p; p--; While[cnt < lmt, cnt = cnt + Floor[n/Prime@ p]; p-- ]; p++; Prime@ p]; MapAt[# + 1 &, Reap[Do[Sow@ f[10^n], {n, 6}]][[-1, -1]], 1]

A309366 When the positive integers are written as products of primes in nondecreasing order, a(n) is the least prime to occur more frequently in n-th position than in any other position.

Original entry on oeis.org

2, 5, 71, 43103
Offset: 1

Views

Author

Peter Munn, Jul 25 2019

Keywords

Comments

In such products of primes, prime(m) occurs in n-th position A281890(m,n) times in every interval of A002110(m)^n positive integers, as explained in A281890. A002110(m) = primorial(m), product of first m primes.
For n >= 2, a(n) is the least prime to occur more frequently in n-th position than (n-1)-th position.
Primes p satisfying a(n) <= p < a(n+1) appear to occur more frequently in n-th position than in any other position.
The next term, a(5), is estimated to be ~ 6*10^11.

Examples

			a(1) = prime(1) = 2, since 2 occurs in n-th position when an integer divisible by 2^n is written as a product of primes in nondecreasing order, thus more frequently in 1st position than in other positions.
Prime(2) = 3 occurs more often in 1st position than 2nd position, specifically once for every 6 consecutive integers (since A281890(2,1) = 1 and primorial(2) = 6) compared with 5 times for every 36 consecutive integers (since A281890(2,2) = 5 and primorial(2)^2 = 36). As 2 and 3 each occur more frequently in 1st position than 2nd position, a(2) > 3.
Prime(3) = 5 occurs in 1st position A281890(3,1) = 2 times in primorial(3) = 30, in 2nd position A281890(3,2) = 62 times in 30^2, in 3rd position A281890(3,3) = 1322 times in 30^3, and decreasingly frequently in subsequent positions. 2/30 < 62/30^2 and 62/30^2 > 1322/30^3. Thus 5 occurs most frequently in 2nd position and is the first prime to do so, so a(2) = 5.
		

Crossrefs

Formula

a(1) = prime(1) = 2.
For n >= 2, a(n) = min{ k : k = prime(m), A281890(m,n) > A002110(m) * A281890(m,n-1) }.
Showing 1-4 of 4 results.