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

A027748 Irregular triangle in which first row is 1, n-th row (n > 1) lists distinct prime factors of n.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 3, 7, 2, 3, 2, 5, 11, 2, 3, 13, 2, 7, 3, 5, 2, 17, 2, 3, 19, 2, 5, 3, 7, 2, 11, 23, 2, 3, 5, 2, 13, 3, 2, 7, 29, 2, 3, 5, 31, 2, 3, 11, 2, 17, 5, 7, 2, 3, 37, 2, 19, 3, 13, 2, 5, 41, 2, 3, 7, 43, 2, 11, 3, 5, 2, 23, 47, 2, 3, 7, 2, 5, 3, 17, 2, 13, 53, 2, 3, 5, 11, 2, 7, 3, 19, 2, 29, 59, 2, 3, 5, 61, 2, 31
Offset: 1

Views

Author

Keywords

Comments

Number of terms in n-th row is A001221(n) for n > 1.
From Reinhard Zumkeller, Aug 27 2011: (Start)
A008472(n) = Sum_{k=1..A001221(n)} T(n,k), n>1;
A007947(n) = Product_{k=1..A001221(n)} T(n,k);
A006530(n) = Max_{k=1..A001221(n)} T(n,k).
A020639(n) = Min_{k=1..A001221(n)} T(n,k).
(End)
Subsequence of A027750 that lists the divisors of n. - Michel Marcus, Oct 17 2015

Examples

			Triangle begins:
   1;
   2;
   3;
   2;
   5;
   2, 3;
   7;
   2;
   3;
   2, 5;
  11;
   2, 3;
  13;
   2, 7;
  ...
		

Crossrefs

Cf. A000027, A001221, A001222 (with repetition), A027746, A141809, A141810.
a(A013939(A000040(n))+1) = A000040(n).
A284411 gives column medians.

Programs

  • Haskell
    import Data.List (unfoldr)
    a027748 n k = a027748_tabl !! (n-1) !! (k-1)
    a027748_tabl = map a027748_row [1..]
    a027748_row 1 = [1]
    a027748_row n = unfoldr fact n where
       fact 1 = Nothing
       fact x = Just (p, until ((> 0) . (`mod` p)) (`div` p) x)
                where p = a020639 x  -- smallest prime factor of x
    -- Reinhard Zumkeller, Aug 27 2011
    
  • Maple
    with(numtheory): [ seq(factorset(n), n=1..100) ];
  • Mathematica
    Flatten[ Table[ FactorInteger[n][[All, 1]], {n, 1, 62}]](* Jean-François Alcover, Oct 10 2011 *)
  • PARI
    print1(1);for(n=2,20,f=factor(n)[,1];for(i=1,#f,print1(", "f[i]))) \\ Charles R Greathouse IV, Mar 20 2013
    
  • Python
    from sympy import primefactors
    for n in range(2, 101):
        print([i for i in primefactors(n)]) # Indranil Ghosh, Mar 31 2017

Extensions

More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

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.

A096294 Triangle T(n,k) read by rows: for n >=0 and n >= k >=0, the fraction of positive integers with exactly k of the first n primes as divisors is T(n,k)/A002110(n).

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 8, 14, 7, 1, 48, 92, 56, 13, 1, 480, 968, 652, 186, 23, 1, 5760, 12096, 8792, 2884, 462, 35, 1, 92160, 199296, 152768, 54936, 10276, 1022, 51, 1, 1658880, 3679488, 2949120, 1141616, 239904, 28672, 1940, 69, 1, 36495360, 82607616
Offset: 0

Views

Author

Matthew Vandermast, Jun 24 2004

Keywords

Comments

Sum of entries in n-th row is A002110(n), the product of the first n primes (primorial numbers, first definition).
From Peter Munn, Apr 10 2017: (Start)
T(n,k) is a count of those integers in any interval of A002110(n) integers that have exactly k of the first n primes as divisors. The count is the same for each such interval because each of the first n primes is a factor of an integer m if and only if it is a factor of m + A002110(n).
A284411(m) is least p=prime(n) such that 2*Sum_{k=0..m-1} T(n,k) < A002110(n).
(End)

Examples

			Triangle begins:
1
1 1
2 3 1
8 14 7 1
48 92 56 13 1
480 968 652 186 23 1
		

Crossrefs

First column is A005867; second column is A078456. See also A096180.

Programs

  • PARI
    primo(n) = prod(k=1, n, prime(k));
    row(n) = {v = vector(n+1); for (k=1, primo(n), f = factor(k)[,1]; v[1+sum(j=1, #f, primepi(f[j])<=n)]++;); v;} \\ Michel Marcus, Apr 29 2017

A126283 Largest number k for which the n-th prime is the median of the largest prime dividing the first k integers.

Original entry on oeis.org

4, 18, 40, 76, 116, 182, 246, 330, 426, 532, 652, 770, 904, 1058, 1210, 1386, 1560, 1752, 1956, 2162, 2394, 2640, 2894, 3150, 3422, 3680, 3984, 4302, 4628, 4974, 5294, 5650, 5914, 6006, 6372, 6746, 7146, 7536, 7938, 8386, 8794, 9222, 9702, 10156
Offset: 1

Views

Author

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

Keywords

Comments

a(14) = 1058 is the first term where a(n) exceeds A290154(n). - Peter Munn, Aug 02 2019

Examples

			a(1)=4 because the median of {2,3,2} = {2, *2*,3} is 2 (the * surrounds the median) and for any number greater than 4 the median is greater than 2.
a(1)=18 because the median of {2,3,2,5,3,7,2,3,5,11,3,13,7,5,2,17,3} = {2,2,2,2,3,3,3,3, *3*,5,5,5,7,7,11,13,17}.
		

Crossrefs

Other sequences about medians of prime factors: A124202, A126282, A281889, A284411, A290154, A308904.

Programs

  • Mathematica
    t = Table[0, {100}]; lst = {}; Do[lpf = FactorInteger[n][[ -1, 1]]; AppendTo[lst, lpf]; mdn = Median@lst; If[PrimeQ@ mdn, t[[PrimePi@mdn]] = n], {n, 2, 10^4}]; t

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

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]

A194156 Prime number that appears the most often as the n-th prime factor of an integer in a factorization given in ascending order.

Original entry on oeis.org

13, 23, 47, 113, 199, 283, 467, 887, 1627, 2803, 4297, 6397, 10343, 18461, 29453, 43067, 67993, 102679, 155893, 267961, 395323, 617819, 926707, 1513751, 2160469, 3278837, 4991687, 7115989, 11113793, 16310629, 24417233, 33888653, 52100569, 76020569
Offset: 4

Views

Author

Alonso del Arte, Aug 17 2011

Keywords

Comments

a(1) = 2 and a(2) = 3. The table in Koninck's book has 5 and 7 tied for third place.

Examples

			a(1) = 2 because, since a randomly chosen number has a 50% chance of being even, the first prime in the factorization of an integer is most likely to be 2.
a(4) = 13 because in the factorization of a number with four or more prime factors, 13 is likeliest to be fourth.
		

References

  • J.-M. De Koninck, Those Fascinating Numbers, Amer. Math. Soc., 2009, page 56.

Crossrefs

Programs

  • Magma
    // See link above.
  • Mathematica
    a[n_] := a[n] = (ClearAll[ CurrPrimes, t]; d = 1.0; For[i = 1, i <= n, i++, CurrPrimes[i] = Prime[i]; d = d*CurrPrimes[i]; t[i] = 1.0]; Freq = t[n]/d; k = n; FreqMax1 = Freq; kAtFreqMax1 = k; While[ k <= kAtFreqMax1*2 , k = k+1;  t[1] = t[1]*(CurrPrimes[1] - 1); CurrPrimes[1] = CurrPrimes[2]; For[i = 2, i <= n, i++,  t[i] = t[i]*(CurrPrimes[i] - 1) + t[i-1]; CurrPrimes[i-1] = CurrPrimes[i]]; CurrPrimes[n] = NextPrime[ CurrPrimes[n-1]]; d = d*CurrPrimes[n]; Freq = t[n]/d; If[ Freq > FreqMax1 , FreqMax1 = Freq; kAtFreqMax1 = k]; If[ Mod[k, 100] == 0 || (CurrPrimes[n] == 16111) , k,  CurrPrimes[n], Freq]; (*end while*)];  Prime[kAtFreqMax1] ); A194156 = Table[ Print["a(", n, ") = ", a[n]]; a[n], {n, 4, 30}] (* Jean-François Alcover, Dec 14 2011, translated from Jon E. Schoenfield's Magma code *)

Formula

a(n) = prime(k) k >= n, such that A096294(k-1, n-1)/A002110(k) >= A096294(i-1, n-1)/A002110(i) for i >= n, i <> k. - Peter Munn, Jul 31 2019

Extensions

Corrected and extended from a(19) onwards by Jon E. Schoenfield, who says (Start):
a(13) was given as 2083, but should be 2803 (apparent typo).
a(17) was given as 16111, which is the most-frequently-appearing 17th prime factor among any primes *up to that point*, as well as for a considerable distance beyond it ... but (after a significant gap) there are larger primes that appear as the 17th prime factor with a slightly higher frequency; beyond 16111, new record highs occur at 18257, 18311, 18313, 18457, and 18461 (the last of which is the correct value for a(17)).
a(18) was given as 24251, but a similar situation applies there; it's the most-frequently-appearing 18th prime factor among any primes up to that point, but it's beaten out by 27109, which is the best until 29443, which is the best until 29453 (which is the correct value for a(18)). (End)

A378720 a(n) is the numerator of the asymptotic density of numbers whose third smallest prime divisor is prime(n).

Original entry on oeis.org

0, 0, 1, 1, 4, 326, 628, 992, 98304, 125568, 733440, 281163264, 386427322368, 3178249003008, 12454223855616, 6450728943845376, 342348724735967232, 20218431581110665216, 39814891891080560640, 82739188294287768944640, 15336676441718784000, 61298453882755419734016000
Offset: 1

Views

Author

Robert G. Wilson v and Amiram Eldar, Dec 05 2024

Keywords

Comments

The third smallest prime divisor of a number k is the third member in the ordered list of the distinct prime divisors of k. Only numbers in A000977 have a third smallest prime divisor.
The partial sums of the fractions first exceed 1/2 after summing 4467 terms. Therefore, the median value of the distribution of the third prime divisor is prime(4467) = 42719 = A284411(3).

Examples

			The fractions begin with 0/1, 0/1, 1/30, 1/30, 4/165, 326/15015, 628/36465, 992/62985, 98304/7436429, 125568/11849255, ..., .
a(1) = a(2) = 0 since there are no numbers whose third prime divisor is 2 or 3.
a(3)/A378721(3) = 1/30 since the numbers whose third prime divisor is 5 are the numbers that are divisible by 2, 3 and 5, and their density if (1/2)*(1/3)*(1/5) = 1/30.
a(4)/A378721(4) = 1/30 since the numbers whose third prime divisor is 7 are the union of the numbers that are divisible by 2, 3 and 7 and not by 5 whose density is (1/2)*(1/3)*(1-1/5)*(1/7) = 2/105, the numbers that are divisible by 2, 5 and 7 and not by 3 whose density is (1/2)*(1-1/3)*(1/5)*(1/7) = 1/105, and the numbers that are divisible by 3, 5 and 7 and not by 2 whose density is (1-1/2)*(1/3)*(1/5)*(1/7) = 1/210, and 2/105 + 1/105 + 1/210 = 1/30.
		

References

  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, pp. 337-341.

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{p, q = Prime@ Range@ n}, p = Fold[Times, 1, q]; q = Most@ q; Plus @@ Times @@@ Subsets[q -1, {n -3}]/p]; a[1] = 0; Numerator@ Array[a, 22]
  • PARI
    a(n) = {my(v = primes(n), q = vecextract(apply(x -> x-1, v),"^-1"), p = vecprod(v), prd = vecprod(q)/p, sm = 0, sb); forsubset([#q, 2], s, sb = vecextract(q, s); sm += 1/vecprod(sb)); numerator(prd * sm);}

Formula

a(n)/A378721(n) = (1/prime(n)#) * (Product_{k=1..n-1} (prime(k) - 1)) * Sum_{j=1..n-1, i=1..j-1} 1/((prime(i)-1)*(prime(j)-1)), where prime(n)# = A002110(n) is the n-th primorial number.
Sum_{n>=1} a(n)/A378721(n) = 1.
Sum_{n=1..m} a(n)/A378721(n) > 1/2 for m >= 4467 = primepi(A284411(3)).
Showing 1-8 of 8 results.