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.

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

A116451 Numbers having fewer prime factors than at least one smaller number.

Original entry on oeis.org

5, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 16 2006

Keywords

Comments

Complement of A029744.
Numbers whose odd part is greater than 3. - Peter Munn, Aug 12 2020

Crossrefs

Formula

A116452(n) = A001222(a(n)).

Extensions

The offset should really be 1, since this is a list, but that change would also require a complete rewrite of A116454, plus changes to A116453. So for the moment let's leave this with offset 0. - N. J. A. Sloane, Aug 17 2020

A328524 T(n,k) is the k-th smallest least integer of prime signatures for partitions of n into distinct parts; triangle T(n,k), n>=0, 1<=k<=A000009(n), read by rows.

Original entry on oeis.org

1, 2, 4, 8, 12, 16, 24, 32, 48, 72, 64, 96, 144, 360, 128, 192, 288, 432, 720, 256, 384, 576, 864, 1440, 2160, 512, 768, 1152, 1728, 2592, 2880, 4320, 10800, 1024, 1536, 2304, 3456, 5184, 5760, 8640, 12960, 21600, 75600, 2048, 3072, 4608, 6912, 10368, 11520
Offset: 0

Views

Author

Alois P. Heinz, Feb 18 2020

Keywords

Examples

			Triangle T(n,k) begins:
     1;
     2;
     4;
     8,   12;
    16,   24;
    32,   48,   72;
    64,   96,  144,  360;
   128,  192,  288,  432,  720;
   256,  384,  576,  864, 1440, 2160;
   512,  768, 1152, 1728, 2592, 2880, 4320, 10800;
  1024, 1536, 2304, 3456, 5184, 5760, 8640, 12960, 21600, 75600;
  ...
		

Crossrefs

Column k=1-3 give: A000079, A003945 for n>2, A116453 for n>4.
Row sums give A332626.
Last elements of rows give A332644.
Cf. A000009, A087443 (for all partitions), A087980 (as sorted sequence).

Programs

  • Maple
    b:= proc(n, i, j) option remember; `if`(i*(i+1)/2 x*ithprime(j)^i,
           b(n-i, min(n-i, i-1), j+1))[], b(n, i-1, j)[]]))
        end:
    T:= n-> sort(b(n$2, 1))[]:
    seq(T(n), n=0..12);
  • Mathematica
    b[n_, i_, j_] := b[n, i, j] = If[i(i+1)/2 < n, {}, If[n == 0, {1}, Join[# * Prime[j]^i& /@ b[n - i, Min[n - i, i - 1], j + 1], b[n, i - 1, j]]]];
    T[n_] := Sort[b[n, n, 1]];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, May 07 2020, after Maple *)

A247283 Positions of subrecords in A048673.

Original entry on oeis.org

5, 7, 9, 15, 18, 27, 36, 54, 72, 108, 144, 216, 288, 432, 576, 864, 1152, 1728, 2304, 3456, 4608, 6912, 9216, 13824, 18432, 27648, 36864, 55296, 73728, 110592, 147456, 221184, 294912, 442368, 589824, 884736, 1179648, 1769472, 2359296, 3538944, 4718592, 7077888
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2014

Keywords

Comments

Odd bisection seems to be A116453 (i.e. A005010, 9*2^n from a(3)=9 onward).
After terms 7 and 15, even bisection from a(6)=27 onward seems to be A175806 (27*2^n).

Examples

			The fourth (A246360(4) = 5) and the fifth (A246360(5) = 8) record of A048673 (1, 2, 3, 5, 4, 8, ...) occur at A029744(4) = 4 and A029744(5) = 6 respectively. In range between, the maximum must occur at 5, thus a(4-3) = a(1) = 5. (All the previous records of A048673 are in consecutive positions, 1, 2, 3, 4, thus there are no previous subrecords).
The ninth (A246360(9) = 68) and the tenth (A246360(10) = 122) record of A048673 occur at A029744(9) = 24 and A029744(10) = 32 respectively. For n in range 25 .. 31 the values of A048673 are: 25, 26, 63, 50, 16, 53, 19, of which 63 is the maximum, and because it occurs at n = 27, we have a(9-3) = a(6) = 27.
		

Crossrefs

A247284 gives the corresponding values.

Programs

  • PARI
    \\ Compute A245449, A246360, A247283 and A247284 at the same time:
    default(primelimit,(2^31)+(2^30));
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A048673(n) = (A003961(n)+1)/2;
    n = 0; i2 = 0; i3 = 0; ir = 0; prevmax = 0; submax = 0; while(n < 2^32, n++; a_n = A048673(n); if((A048673(a_n) == n), i2++; write("b245449.txt", i2, " ", n)); if((a_n > prevmax), if(submax > 0, i3++; write("b247283.txt", i3, " ", submaxpt); write("b247284.txt", i3, " ", submax)); prevmax = a_n; submax = 0; ir++; write("b029744_empirical.txt", ir, " ", n); write("b246360_empirical.txt", ir, " ", a_n), if((a_n > submax), submax = a_n; submaxpt = n)));
    
  • Scheme
    (definec (A247283 n) (max_pt_in_range A048673 (+ (A029744 (+ n 3)) 1) (- (A029744 (+ n 4)) 1)))
    (define (max_pt_in_range intfun lowlim uplim) (let loop ((i (+ 1 lowlim)) (maxnow (intfun lowlim)) (maxpt lowlim)) (cond ((> i uplim) maxpt) (else (let ((v (intfun i))) (if (> v maxnow) (loop (+ 1 i) v i) (loop (+ 1 i) maxnow maxpt)))))))

Formula

a(n) = A064216(A247284(n)).
Conjectures from Chai Wah Wu, Jul 30 2020: (Start)
a(n) = 2*a(n-2) for n > 6.
G.f.: x*(3*x^5 - x^3 + x^2 - 7*x - 5)/(2*x^2 - 1). (End)

A116454 Smallest m such that A116452(m) = n.

Original entry on oeis.org

0, 2, 9, 25, 59, 129, 271, 557, 1131, 2281, 4583, 9189, 18403, 36833, 73695, 147421, 294875, 589785, 1179607, 2359253, 4718547, 9437137, 18874319, 37748685, 75497419, 150994889, 301989831, 603979717, 1207959491, 2415919041
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 16 2006

Keywords

Comments

A116451(a(n)) = A116453(n);
Primes include a(2) = 2, a(5) = 59, a(7) = 271, a(8) = 557, a(10) = 2281, a(11) = 4583, a(14) = 36833. - Jonathan Vos Post, Feb 20 2006

Programs

  • Mathematica
    Join[{0},RecurrenceTable[{a[1]==2,a[n]==2(a[n-1]+n)+1},a[n],{n,30}]] (* or *) Join[{0},LinearRecurrence[{4,-5,2},{2,9,25},30]] (* Harvey P. Dale, Jul 18 2011 *)

Formula

a(n+1) = (a(n) + n) * 2 + 1 for n>1.
From Harvey P. Dale, Jul 18 2011: (Start)
a(0)=0, a(1)=2, a(2)=9, a(3)=25, a(n) = 4*a(n-1)-5*a(n-2)+2*a(n-3).
G.f.: (x-2)*x^2*(x+1)/((x-1)^2*(2*x-1)). (End)

A130877 Numbers that are congruent to {0, 5} mod 9.

Original entry on oeis.org

0, 5, 9, 14, 18, 23, 27, 32, 36, 41, 45, 50, 54, 59, 63, 68, 72, 77, 81, 86, 90, 95, 99, 104, 108, 113, 117, 122, 126, 131, 135, 140, 144, 149, 153, 158, 162, 167, 171, 176, 180, 185, 189, 194, 198, 203, 207, 212, 216, 221, 225, 230, 234, 239, 243, 248, 252, 257
Offset: 1

Views

Author

Keywords

Comments

Numbers m such that m = digitsum(k*(m+k)) for some k>=0.
The first differences are 2-periodic: 5, 4, 5, 4, etc. The minimum numbers k associated to the first elements of the sequence are (m,k): (0,0), (5,2), (9,3), (14,5), (18,15), (23,44), (27,42), (32,119), etc.

Crossrefs

Programs

  • Maple
    op(select(n->n mod 9=0 or n mod 9=5,[$0..257])); # Paolo P. Lava, Jul 12 2018
    # second Maple program:
    a:= n-> ceil(9*(n-1)/2):
    seq(a(n), n=1..58);  # Alois P. Heinz, Apr 12 2025
  • Mathematica
    Table[5n-5-Floor[(n-1)/2], {n,100}] (* Wesley Ivan Hurt, Oct 25 2013 *)
    Select[Range[0,300],MemberQ[{0,5},Mod[#,9]]&] (* or *) LinearRecurrence[ {1,1,-1},{0,5,9},60] (* Harvey P. Dale, Aug 04 2019 *)
  • PARI
    forstep(n=0,200,[5,4],print1(n", ")) \\ Charles R Greathouse IV, Oct 17 2011

Formula

a(n) = a(n-2) + 9 for n >= 3.
a(n) = 9/2*(n+1) - 4 + Sum{j=0..n} (-1)^j/2.
O.g.f.: x^2(5+4x)/((1+x)(1-x)^2). a(n) = 9(n-1)/2+(1+(-1)^n)/4. - R. J. Mathar, Jun 13 2008
a(n+1) = Sum_{k>=0} A030308(n,k)*A116453(k+1). - Philippe Deléham, Oct 17 2011
a(n) = 5n - 5 - floor((n-1)/2). - Wesley Ivan Hurt, Oct 25 2013
a(n) = ceiling(9*(n-1)/2). - Alois P. Heinz, Apr 12 2025

A116452 Number of prime factors of A116451.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 16 2006

Keywords

Comments

a(n) = A001222(A116451(n));
record values: A116453(n) = a(A116454(n)).

A202241 Array F(n,m) read by antidiagonals: F(0,m)=1, F(n,0) = A130713(n), and column m+1 is recursively defined as the partial sums of column m.

Original entry on oeis.org

1, 2, 1, 1, 3, 1, 0, 4, 4, 1, 0, 4, 8, 5, 1, 0, 4, 12, 13, 6, 1, 0, 4, 16, 25, 19, 7, 1, 0, 4, 20, 41, 44, 26, 8, 1, 0, 4, 24, 61, 85, 70, 34, 9, 1, 0, 4, 28, 85, 146, 155, 104, 43, 10, 1, 0, 4, 32, 113, 231, 301, 259, 147, 53, 11, 1, 0, 4, 36, 145, 344, 532, 560, 406, 200, 64, 12, 1
Offset: 0

Views

Author

Paul Curtz, Dec 16 2011

Keywords

Comments

The array F(n,m), beginning with row n=0, is:
1, 1, 1, 1, 1, 1, 1,
2, 3, 4, 5, 6, 7, 8,
1, 4, 8, 13, 19, 26, 34,
0, 4, 12, 25, 44, 70, 104,
0, 4, 16, 41, 85, 155, 259,
0, 4, 20, 61, 146, 301, 560,
0, 4, 24, 85, 231, 532, 1092.
Columns after A130713, A113311, A008574 have signatures (3,-3,1), (4,-6,4,-1), (5,-10,10,-5,1), (6,-15,20,-15,6,-1) (from A135278(n+3)).
Inserting columns of zeros and pushing the columns down, plus alternating sign switches defines the following triangle T(n,2m) = (-1)^(m/2)*F(n-2m,m):
1,
2 0,
1 0 -1,
0 0 -3 0,
0 0 -4 0 1,
0 0 -4 0 4 0,
0 0 -4 0 8 0 -1
The row sums in the triangle are (-1)^n*A099838(n).
The companion to A201863 is
1
1 0
1 0 0
1 0 -2 0
1 0 -4 0 1
1 0 -6 0 5 0
1 0 -8 0 13 0 -2
1 0 -10 0 25 0 -12 0
1 0 -12 0 41 0 -38 0 4
1 0 -14 0 61 0 -88 0 28 0
1 0 -16 0 85 0 -170 0 104 0 -8
5th column: A001844; 7th column: -A035597=-2*A005900(n+1); 9th column: 4*A006325(n+2); 11th column: -8*(1,8,34,104) (from columns 4,5,6,7 of F(n,m)).
As a triangular array, this is the Riordan array ((1+x)^2, x/(1-x)). - Philippe Deléham, Feb 21 2012

Examples

			Triangle T(n,k) begins:
  1
  2, 1
  1, 3,  1
  0, 4,  4,  1
  0, 4,  8,  5,   1
  0, 4, 12, 13,   6,   1
  0, 4, 16, 25,  19,   7,   1
  0, 4, 20, 41,  44,  26,   8,  1
  0, 4, 24, 61,  85,  70,  34,  9,  1
  0, 4, 28, 85, 146, 155, 104, 43, 10, 1
- _Philippe Deléham_, Feb 21 2012
		

Crossrefs

Cf. A130713 (column 0), A113311 (column 1), A008574 (column 2), A001844 (column 3), A005900 (column 4), A006325 (column 5), A033455 (column 6).
Cf. A267633.

Programs

  • GAP
    Flat(List([0..12],n->List([0..n],k->Binomial(n,n-k)+Binomial(n-1,n-k-1)-Binomial(n-2,n-k-2)-Binomial(n-3,n-k-3)))); # Muniru A Asiru, Mar 22 2018
  • Maple
    A130713 := proc(n)
        if n <= 2 and n >=0 then
            op(n+1,[1,2,1]) ;
        else
            0;
        end if;
    end proc:
    A202241 := proc(n,m)
        option remember;
        if n < 0 then
            0 ;
        elif m = 0 then
            A130713(n);
        else
            procname(n,m-1)+procname(n-1,m) ;
        end if;
    end proc:
    for d from 0 to 12 do
        for m from 0 to d do
            printf("%d,",A202241(d-m,m)) ;
        end do:
    end do: # R. J. Mathar, Dec 22 2011
    C := proc (n, k) if 0 <= k and k <= n then factorial(n)/(factorial(k)*factorial(n-k)) else 0 end if end proc:
    for n from 0 to 10 do
         seq(C(n, n-k) + C(n-1, n-k-1) - C(n-2, n-k-2) - C(n-3, n-k-3), k = 0..n);
    end do; # Peter Bala, Mar 20 2018
  • Mathematica
    rows = 12;
    T[0] = PadRight[{1, 2, 1}, rows];
    T[n_ /; nJean-François Alcover, Jun 29 2019 *)
  • Sage
    def Trow(n): return [binomial(n, n-k) + binomial(n-1, n-k-1) - binomial(n-2, n-k-2) - binomial(n-3, n-k-3) for k in (0..n)]
    for n in (0..9): print(Trow(n)) # Peter Luschny, Mar 21 2018
    

Formula

F(1,m) = m+2.
F(2,m) = A034856(m+1).
F(3,m) = A000297(m-1).
Sum_{m=0..d} F(d-m,m) = A116453(d-3), d >= 3 (antidiagonal sums).
As a triangular array T(n,k), 0 <= k <= n, satisfies: T(n,k) = T(n-1,k) + T(n-1,k-1) with T(0,0) = 1, T(1,0) = 2, T(2,0) = 1, T(3,0) = 0. - Philippe Deléham, Feb 21 2012
Unsigned diagonals of A267633 (beginning with its main diagonal) appear to be the reverse rows of this entry's triangle beginning with the fourth row. - Tom Copeland, Jan 26 2016
T(n,k) = C(n, n-k) + C(n-1, n-k-1) - C(n-2, n-k-2) - C(n-3, n-k-3), where C(n, k) = n!/(k!*(n-k)!) if 0 <= k <= n, otherwise 0. - Peter Bala, Mar 20 2018
Showing 1-8 of 8 results.