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

A078840 Table of n-almost-primes T(n,k) (n >= 0, k > 0), read by antidiagonals, starting at T(0,1)=1 followed by T(1,1)=2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 12, 16, 11, 10, 18, 24, 32, 13, 14, 20, 36, 48, 64, 17, 15, 27, 40, 72, 96, 128, 19, 21, 28, 54, 80, 144, 192, 256, 23, 22, 30, 56, 108, 160, 288, 384, 512, 29, 25, 42, 60, 112, 216, 320, 576, 768, 1024, 31, 26, 44, 81, 120, 224, 432, 640, 1152
Offset: 0

Views

Author

Benoit Cloitre and Paul D. Hanna, Dec 10 2002

Keywords

Comments

An n-almost-prime is a positive integer that has exactly n prime factors.
This sequence is a rearrangement of the natural numbers. - Robert G. Wilson v, Feb 11 2006
Each antidiagonal begins with the n-th prime and ends with 2^n.
From Eric Desbiaux, Jun 27 2009: (Start)
(A001222 gives this sequence)
A001221 gives another table:
1
- 2 3 4 5 7 8 9 11 ... A000961
- 6 10 12 14 15 18 20 21 ... A007774
- 30 42 60 66 70 78 84 90 ... A033992
- 210 330 390 420 462 510 546 570 ... A033993
- 2310 2730 3570 3990 4290 4620 4830 5460 ... A051270
Antidiagonals begin with A000961 and end with A002110.
Diagonal is A073329 which is last term in n-th row of A048692. (End)

Examples

			Table begins:
  1
  -  2  3   5   7  11  13  17  19  23  29 ...
  -  4  6   9  10  14  15  21  22  25  26 ...
  -  8 12  18  20  27  28  30  42  44  45 ...
  - 16 24  36  40  54  56  60  81  84  88 ...
  - 32 48  72  80 108 112 120 162 168 176 ...
  - 64 96 144 160 216 224 240 324 336 352 ...
		

Crossrefs

T(1, k)=A000040(k), T(2, k)=A001358(k), T(3, k)=A014612(k), T(4, k)=A014613(k), T(5, k)=A014614(k), T(6, k)=A046306(k), T(7, k)=A046308(k), T(8, k)=A046310(k), T(9, k)=A046312(k), T(10, k)=A046314(k).
T(11, k)=A069272(k), T(12, k)=A069273(k), T(13, k)=A069274(k), T(14, k)=A069275(k), T(15, k)=A069276(k), T(16, k)=A069277(k), T(17, k)=A069278(k), T(18, k)=A069279(k), T(19, k)=A069280(k), T(20, k)=A069281(k).
T(k, 1)=A000079(k), T(k, 2)=A007283(k), T(k, 3)=A116453(k), T(k, k)=A101695(k), T(k, k+1)=A078841(k).
A091538 is this sequence with zeros inserted, making a square array.

Programs

  • Mathematica
    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 *)
    AlmostPrime[k_, n_] := Block[{e = Floor[Log[2, n]+k], a, b}, a = 2^e; Do[b = 2^p; While[ AlmostPrimePi[k, a] < n, a = a + b]; a = a - b/2, {p, e, 0, -1}]; a + b/2]; Table[ AlmostPrime[k, n - k + 1], {n, 11}, {k, n}] // Flatten (* Robert G. Wilson v *)
    mx = 11; arr = NestList[Take[Union@Flatten@Outer[Times, #, primes], mx] &, primes = Prime@Range@mx, mx]; Prepend[Flatten@Table[arr[[k, n - k + 1]], {n, mx}, {k, n}], 1] (* Ivan Neretin, Apr 30 2016 *)
    (* The next code skips the initial 1. *)
    width = 15; (seq = Table[
      Rest[NestList[1 + NestWhile[# + 1 &, #, ! PrimeOmega[#] == z &] &,
      2^z, width - z + 1]] - 1, {z, width}]) // TableForm
    Flatten[Map[Reverse[Diagonal[Reverse[seq], -width + #]] &, Range[width]]]
    (* Peter J. C. Moses, Jun 05 2019 *)
    Grid[Table[Select[Range[200], PrimeOmega[#] == n &], {n, 0, 7}]]
    (* Clark Kimberling, Nov 17 2024 *)
  • PARI
    T(n,k)=if(k<0,0,s=1; while(sum(i=1,s,if(bigomega(i)-n,0,1))
    				
  • Python
    from math import prod, isqrt
    from sympy import primerange, integer_nthroot, primepi, prime
    def A078840_T(n,k):
        if n == 1: return prime(k)
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(k-1+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,n)))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 23 2024

Extensions

Edited by Robert G. Wilson v, Feb 11 2006

A365494 a(n) is the smallest number which can be represented as the sum of n distinct n-almost primes in exactly n ways, or -1 if no such number exists.

Original entry on oeis.org

2, 19, 65, 190, 440, 1160, 2896, 7072, 16832, 40064, 90752, 208640, 476160, 1082880, 2398208, 5310464, 11694080, 25616384, 56475648, 122388480, 266010624, 575012864, 1245446144, 2699034624, 5779750912, 12296650752, 26377977856, 55855546368, 118656860160, 255458279424, 531669975040
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 07 2023

Keywords

Examples

			For n = 2: 19 = 2*2 + 3*5 = 3*3 + 2*5.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses priqueue; local pq, S, t,x,y,k, i, p, v, R;
         initialize(pq);
         insert([-2^n, 2$n],pq);
         S[0]:= 1:
         for i from 1 to n do S[i]:= 0 od:
         do
           t:= extract(pq);
           x:= -t[1];
           for i from n to 1 by -1 do
             S[i]:= expand(S[i] + S[i-1] * y^x);
           od;
           if type(S[n],`+`) then
             R:= select(t -> degree(t,y) < x and eval(t,y=1) = n, convert(S[n],list));
             if R <> [] then return min(map(t -> degree(t,y),R)) fi;
           fi;
           p:= nextprime(t[-1]);
           for i from n+1 to 2 by -1 while t[i] = t[-1] do
            v:= x*(p/t[-1])^(n+2-i);
            insert([-v, op(t[2..i-1]), p$(n+2-i)], pq)
           od;
         od;
    end proc:
    map(f, [$1..19]); # Robert Israel, Jun 10 2025

Extensions

a(5)-a(19) from Robert Israel, Jun 10 2025
More terms from David A. Corneth, Jun 10 2025

A119586 Triangle where T(n,m) = (n+1-m)-th positive integer with (m+1) divisors.

Original entry on oeis.org

2, 3, 4, 5, 9, 6, 7, 25, 8, 16, 11, 49, 10, 81, 12, 13, 121, 14, 625, 18, 64, 17, 169, 15, 2401, 20, 729, 24, 19, 289, 21, 14641, 28, 15625, 30, 36, 23, 361, 22, 28561, 32, 117649, 40, 100, 48, 29, 529, 26, 83521, 44, 1771561, 42, 196, 80, 1024, 31, 841, 27
Offset: 1

Views

Author

Leroy Quet, May 31 2006

Keywords

Comments

From Peter Munn, May 17 2023: (Start)
As a square array A(n,m), n, m >= 1, read by ascending antidiagonals, A(n,m) is the n-th positive integer with m+1 divisors.
Thus both formats list the numbers with m+1 divisors in their m-th column. For the corresponding sequences giving numbers with a specific number of divisors see the index entries link.
(End)

Examples

			Looking at the 4th row, 7 is the 4th positive integer with 2 divisors, 25 is the 3rd positive integer with 3 divisors, 8 is the 2nd positive integer with 4 divisors and 16 is the first positive integer with 5 divisors. So the 4th row is (7,25,8,16).
The triangle T(n,m) begins:
  n\m:    1     2     3     4     5     6     7
  ---------------------------------------------
   1 :    2
   2 :    3     4
   3 :    5     9     6
   4 :    7    25     8    16
   5 :   11    49    10    81    12
   6 :   13   121    14   625    18    64
   7 :   17   169    15  2401    20   729    24
  ...
Square array A(n,m) begins:
  n\m:     1      2      3       4      5  ...
  --------------------------------------------
   1 :     2      4      6      16     12  ...
   2 :     3      9      8      81     18  ...
   3 :     5     25     10     625     20  ...
   4 :     7     49     14    2401     28  ...
   5 :    11    121     15   14641     32  ...
  ...
		

Crossrefs

Columns: A000040, A001248, A007422, A030514, A030515, A030516, A030626, A030627, A030628, ... (see the index entries link for more).
Cf. A073915.
Diagonals (equivalently, rows of the square array) start: A005179\{1}, A161574.
Cf. A091538.

Programs

  • Mathematica
    t[n_, m_] := Block[{c = 0, k = 1}, While[c < n + 1 - m, k++; If[DivisorSigma[0, k] == m + 1, c++ ]]; k]; Table[ t[n, m], {n, 11}, {m, n}] // Flatten (* Robert G. Wilson v, Jun 07 2006 *)

Extensions

More terms from Robert G. Wilson v, Jun 07 2006

A209934 a(n) is the first value to occur consecutively in the sequence b_n defined by p_2k(b_n(k)) = p_k(n)^2, k=1,2,3,..., where p_k(n) is the n-th k-almost prime.

Original entry on oeis.org

1, 3, 8, 12, 23, 26, 32, 66, 68, 78, 83, 106, 116, 169, 181, 201, 210, 216, 234, 273, 282, 296, 427, 436, 501, 504, 513, 538, 547, 583, 655, 688, 711, 738, 751, 851, 866, 947, 1065, 1088, 1155, 1274, 1277, 1285, 1350, 1369, 1389, 1456, 1594, 1615, 1702, 1734
Offset: 1

Views

Author

Daniel Tisdale, Mar 15 2012

Keywords

Comments

A k-almost prime has exactly k prime factors, repetitions included.
Conjecture: Each sequence b_n repeats indefinitely. (Example: for n=3, b_n = 9, 8, 8, 8, 8, 8, .... It looks like b_3(k) is 8 for all k > 1.)
The conjecture follows from the formula that uses A078843 below (and the strict monotonicity of A078843). However the first repeated value is not for every n the value that repeats indefinitely. For example a(8) = b_8(2) = b_8(3) = 66, but b_8(k) = 64 for k >= 4. - Peter Munn, Aug 05 2019

Examples

			for k = 1, 2, 3, 4, 5, 6, ...:
p_k(3) = 5, 9, 18, 36, 72, 144, ... (the 3rd k-almost prime);
p_k(3)^2 = 25, 81, 324, 1296, 5184, 20736, ...;
b_3(k) = 9, 8, 8, 8, 8, 8, ... (index in the 2k-almost primes);
so since b_3(3) = b_3(2) = 8, a(3) = 8.
		

Crossrefs

Programs

  • PARI
    get_p(m,k) = {local(i,n);i=0;n=1;while(iA209934(n) = {local(m,k,k_old);m=3;k_old=get_k(2,get_p(1,n)^2);k=get_k(4,get_p(2,n)^2);while(kMichael B. Porter, Mar 20 2012

Formula

From Peter Munn, Aug 05 2019: (Start)
b_n(k) = A058933(A078840(k,n)^2).
a(n) = b_n(min {k : b_n(k) = b_n(k+1)}).
If n < A078843(k+1) and b_n(k) < A078843(2k+1) then b_n(i) = b_n(k) for i >= k.
(End)

Extensions

Edited, correcting the subscripting, by Peter Munn, Aug 04 2019

A365493 a(n) is the smallest number which can be represented as the sum of n n-almost primes in exactly n ways, or -1 if no such number exists.

Original entry on oeis.org

2, 18, 44, 112, 418, 776, 1408, 3072, 7040, 14848, 53056, 77312, 147456, 315392, 988160, 5310464, 3194880, 6225920, 12845056, 46252032, 76873728, 117440512, 258998272, 1072824320, 1111490560, 3379560448, 5192548352, 9261023232, 24243077120, 41204842496, 81067507712
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 07 2023

Keywords

Examples

			For n = 2: 18 = 2*2 + 2*7 = 3*3 + 3*3.
		

Crossrefs

Extensions

More terms from David A. Corneth, Jun 12 2025

A365507 a(n) is the least positive integer that can be expressed as the sum of one or more consecutive n-almost primes in exactly n ways, or -1 if no such integer exists.

Original entry on oeis.org

2, 10, 105, 2410, 45010, 708408
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 07 2023

Keywords

Examples

			For n = 3: 105 = 3*5*7 = 2*2*3 + 2*3*3 + 2*2*5 + 3*3*3 + 2*2*7 = 2*2*5 + 3*3*3 + 2*2*7 + 2*3*5.
		

Crossrefs

A384842 a(n) is the n-th number which can be represented as the sum of n distinct n-almost primes in exactly n ways, or -1 if fewer than n such numbers exist.

Original entry on oeis.org

2, 24, 75, 211, 522, 1332, 3588, 8900, 20552, 48304, 118768, 256864, 558272, 1564608, 2863360
Offset: 1

Views

Author

Robert Israel, Jun 10 2025

Keywords

Examples

			For n = 2, the first number that is the sum of two distinct semiprimes in exactly two ways is A365494(2) = 19, and the second is a(2) = 24 = 9 + 15 = 10 + 14.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses priqueue; local pq, S, t, x, y, k, i, p, v, R;
         initialize(pq);
         insert([-2^n, 2$n], pq);
         S[0]:= 1:
         for i from 1 to n do S[i]:= 0 od:
         do
           t:= extract(pq);
           x:= -t[1];
           for i from n to 1 by -1 do
             S[i]:= expand(S[i] + S[i-1] * y^x);
           od;
           if type(S[n], `+`) then
             R:= select(t -> degree(t, y) < x and eval(t, y=1) = n, convert(S[n], list));
             if nops(R) >= n then R:= sort(map(t -> degree(t,y), R)); return R[n] fi;
           fi;
           p:= nextprime(t[-1]);
           for i from n+1 to 2 by -1 while t[i] = t[-1] do
            v:= x*(p/t[-1])^(n+2-i);
            insert([-v, op(t[2..i-1]), p$(n+2-i)], pq)
           od;
         od;
    end proc:
    map(f, [$1..15]);
Showing 1-7 of 7 results.