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-10 of 31 results. Next

A196724 Number of subsets of {1..n} (including empty set) such that the pairwise products of distinct elements are all distinct.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 58, 116, 212, 416, 720, 1440, 2340, 4680, 7920, 13024, 23328, 46656, 74168, 148336, 229856, 371424, 615304, 1230608, 1780224, 3401568, 5589360, 9468504, 14397744, 28795488, 40312128, 80624256, 131388480, 206363168, 335814288, 521401536
Offset: 0

Views

Author

Alois P. Heinz, Oct 06 2011

Keywords

Comments

The number of subsets of {1..n} such that every orderless pair of (not necessarily distinct) elements has a different product is A325860(n). - Gus Wiseman, Jun 03 2019

Examples

			a(6) = 58: from the 2^6=64 subsets of {1,2,3,4,5,6} only 6 do not have all the pairwise products of elements distinct: {1,2,3,6}, {2,3,4,6}, {1,2,3,4,6}, {1,2,3,5,6}, {2,3,4,5,6}, {1,2,3,4,5,6}.
		

Crossrefs

The subset case is A196724 (this sequence).
The maximal case is A325859.
The integer partition case is A325856.
The strict integer partition case is A325855.
Heinz numbers of the counterexamples are given by A325993.

Programs

  • Maple
    b:= proc(n, s) local sn, m;
          m:= nops(s);
          sn:= [s[], n];
          `if`(n<1, 1, b(n-1, s) +`if`(m*(m+1)/2 = nops(({seq(seq(
           sn[i]*sn[j], j=i+1..m+1), i=1..m)})), b(n-1, sn), 0))
        end:
    a:= proc(n) option remember;
          b(n-1, [n]) +`if`(n=0, 0, a(n-1))
        end:
    seq(a(n), n=0..20);
  • Mathematica
    b[n_, s_] := b[n, s] = Module[{sn, m}, m = Length[s]; sn = Append[s, n]; If[n < 1, 1, b[n - 1, s] + If[m*(m + 1)/2 == Length[Union[Flatten[Table[ sn[[i]] * sn[[j]], {i, 1, m}, {j, i + 1, m + 1}]]]], b[n - 1, sn], 0]]]; a[n_] := a[n] = b[n - 1, {n}] + If[n == 0, 0, a[n - 1]]; Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Jan 31 2017, translated from Maple *)
    Table[Length[Select[Subsets[Range[n]],UnsameQ@@Times@@@Subsets[#,{2}]&]],{n,0,10}] (* Gus Wiseman, Jun 03 2019 *)

Extensions

Name edited by Gus Wiseman, Jun 03 2019
a(33)-a(35) from Fausto A. C. Cariboni, Oct 05 2020

A339564 Number of ways to choose a distinct factor in a factorization of n (pointed factorizations).

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 4, 2, 3, 1, 7, 1, 3, 3, 7, 1, 7, 1, 7, 3, 3, 1, 14, 2, 3, 4, 7, 1, 10, 1, 12, 3, 3, 3, 17, 1, 3, 3, 14, 1, 10, 1, 7, 7, 3, 1, 26, 2, 7, 3, 7, 1, 14, 3, 14, 3, 3, 1, 25, 1, 3, 7, 19, 3, 10, 1, 7, 3, 10, 1, 36, 1, 3, 7, 7, 3, 10, 1, 26, 7, 3
Offset: 1

Views

Author

Gus Wiseman, Apr 10 2021

Keywords

Examples

			The pointed factorizations of n for n = 2, 4, 6, 8, 12, 24, 30:
  ((2))  ((4))    ((6))    ((8))      ((12))     ((24))       ((30))
         ((2)*2)  ((2)*3)  ((2)*4)    ((2)*6)    ((3)*8)      ((5)*6)
                  (2*(3))  (2*(4))    (2*(6))    (3*(8))      (5*(6))
                           ((2)*2*2)  ((3)*4)    ((4)*6)      ((2)*15)
                                      (3*(4))    (4*(6))      (2*(15))
                                      ((2)*2*3)  ((2)*12)     ((3)*10)
                                      (2*2*(3))  (2*(12))     (3*(10))
                                                 ((2)*2*6)    ((2)*3*5)
                                                 (2*2*(6))    (2*(3)*5)
                                                 ((2)*3*4)    (2*3*(5))
                                                 (2*(3)*4)
                                                 (2*3*(4))
                                                 ((2)*2*2*3)
                                                 (2*2*2*(3))
		

Crossrefs

The additive version is A000070 (strict: A015723).
The unpointed version is A001055 (strict: A045778, ordered: A074206, listed: A162247).
Allowing point (1) gives A057567.
Choosing a position instead of value gives A066637.
The ordered additive version is A336875.
A000005 counts divisors.
A001787 count normal multisets with a selected position.
A001792 counts compositions with a selected position.
A006128 counts partitions with a selected position.
A066186 count strongly normal multisets with a selected position.
A254577 counts ordered factorizations with a selected position.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    Table[Sum[Length[Union[fac]],{fac,facs[n]}],{n,50}]

Formula

a(n) = A057567(n) - A001055(n).
a(n) = Sum_{d|n, d>1} A001055(n/d).

A347460 Number of distinct possible alternating products of factorizations of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 4, 1, 2, 2, 4, 1, 4, 1, 4, 2, 2, 1, 6, 2, 2, 3, 4, 1, 5, 1, 5, 2, 2, 2, 7, 1, 2, 2, 6, 1, 5, 1, 4, 4, 2, 1, 8, 2, 4, 2, 4, 1, 5, 2, 6, 2, 2, 1, 10, 1, 2, 4, 6, 2, 5, 1, 4, 2, 5, 1, 10, 1, 2, 4, 4, 2, 5, 1, 8, 4, 2, 1, 10, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 06 2021

Keywords

Comments

We define the alternating product of a sequence (y_1,...,y_k) to be Product_i y_i^((-1)^(i-1)).
A factorization of n is a weakly increasing sequence of positive integers > 1 with product n.

Examples

			The a(n) alternating products for n = 1, 4, 8, 12, 24, 30, 36, 48, 60, 120:
  1  4  8    12   24   30    36   48    60    120
     1  2    3    6    10/3  9    12    15    30
        1/2  3/4  8/3  5/6   4    16/3  20/3  40/3
             1/3  2/3  3/10  1    3     15/4  15/2
                  3/8  2/15  4/9  3/4   12/5  24/5
                  1/6        1/4  1/3   3/5   10/3
                             1/9  3/16  5/12  5/6
                                  1/12  4/15  8/15
                                        3/20  3/10
                                        1/15  5/24
                                              2/15
                                              3/40
                                              1/30
		

Crossrefs

Positions of 1's are 1 and A000040.
Positions of 2's appear to be A001358.
Positions of 3's appear to be A030078.
Dominates A038548, the version for reverse-alternating product.
Counting only integers gives A046951.
The even-length case is A072670.
The version for partitions (not factorizations) is A347461, reverse A347462.
The odd-length case is A347708.
The length-3 case is A347709.
A001055 counts factorizations (strict A045778, ordered A074206).
A056239 adds up prime indices, row sums of A112798.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A108917 counts knapsack partitions, ranked by A299702.
A276024 counts distinct positive subset-sums of partitions, strict A284640.
A292886 counts knapsack factorizations, by sum A293627.
A299701 counts distinct subset-sums of prime indices, positive A304793.
A301957 counts distinct subset-products of prime indices.
A304792 counts distinct subset-sums of partitions.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    altprod[q_]:=Product[q[[i]]^(-1)^(i-1),{i,Length[q]}];
    Table[Length[Union[altprod/@facs[n]]],{n,100}]

A301957 Number of distinct subset-products of the integer partition with Heinz number n.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 4, 1, 2, 3, 2, 2, 4, 2, 2, 2, 3, 2, 4, 2, 2, 4, 2, 1, 4, 2, 4, 3, 2, 2, 4, 2, 2, 4, 2, 2, 6, 2, 2, 2, 3, 3, 4, 2, 2, 4, 4, 2, 4, 2, 2, 4, 2, 2, 5, 1, 4, 4, 2, 2, 4, 4, 2, 3, 2, 2, 6, 2, 4, 4, 2, 2, 5, 2, 2, 4, 4, 2, 4, 2, 2, 6, 4, 2, 4, 2, 4, 2, 2, 3, 6, 3, 2, 4, 2, 2, 8
Offset: 1

Views

Author

Gus Wiseman, Mar 29 2018

Keywords

Comments

A subset-product of an integer partition y is a product of some submultiset of y. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
Number of distinct values obtained when A003963 is applied to all divisors of n. - Antti Karttunen, Sep 05 2018

Examples

			The distinct subset-products of (4,2,1,1) are 1, 2, 4, and 8, so a(84) = 4.
The distinct subset-products of (6,3,2) are 1, 2, 3, 6, 12, 18, and 36, so a(195) = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[If[n===1,1,Length[Union[Times@@@Subsets[Join@@Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]]],{n,100}]
  • PARI
    up_to = 65537;
    A003963(n) = { n=factor(n); n[, 1]=apply(primepi, n[, 1]); factorback(n) }; \\ From A003963
    v003963 = vector(up_to,n,A003963(n));
    A301957(n) = { my(m=Map(),s,k=0,c); fordiv(n,d,if(!mapisdefined(m,s = v003963[d],&c), mapput(m,s,s); k++)); (k); }; \\ Antti Karttunen, Sep 05 2018

Extensions

More terms from Antti Karttunen, Sep 05 2018

A293627 Number of knapsack factorizations whose factors sum to n.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 4, 6, 8, 11, 12, 19, 21, 27, 34, 45, 51, 69, 77, 100, 117, 146
Offset: 1

Views

Author

Gus Wiseman, Oct 23 2017

Keywords

Comments

A knapsack factorization is a finite multiset of positive integers greater than one such that every distinct submultiset has a different product.

Examples

			The a(12) = 19 partitions are:
(12),
(10 2), (9 3), (8 4), (7 5), (6 6),
(8 2 2), (7 3 2), (6 4 2), (6 3 3), (5 5 2), (5 4 3), (4 4 4),
(6 2 2 2), (5 3 2 2), (4 3 3 2), (3 3 3 3),
(3 3 2 2 2),
(2 2 2 2 2 2).
		

Crossrefs

Programs

  • Mathematica
    nn=22;
    apsQ[y_]:=UnsameQ@@Times@@@Union[Rest@Subsets[y]];
    Table[Length@Select[IntegerPartitions[n],apsQ],{n,nn}]

A347705 Number of factorizations of n with reverse-alternating product > 1.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 2, 3, 1, 4, 1, 4, 2, 2, 1, 7, 1, 2, 3, 4, 1, 5, 1, 7, 2, 2, 2, 7, 1, 2, 2, 7, 1, 5, 1, 4, 4, 2, 1, 12, 1, 4, 2, 4, 1, 7, 2, 7, 2, 2, 1, 11, 1, 2, 4, 8, 2, 5, 1, 4, 2, 5, 1, 16, 1, 2, 4, 4, 2, 5, 1, 12, 3, 2, 1, 11, 2
Offset: 1

Views

Author

Gus Wiseman, Oct 12 2021

Keywords

Comments

A factorization of n is a weakly increasing sequence of positive integers > 1 with product n.
We define the alternating product of a sequence (y_1,...,y_k) to be Product_i y_i^((-1)^(i-1)). The reverse-alternating product is the alternating product of the reversed sequence.

Examples

			The a(n) factorizations for n = 2, 6, 8, 12, 24, 30, 48, 60:
  2   6     8       12      24        30      48          60
      2*3   2*4     2*6     3*8       5*6     6*8         2*30
            2*2*2   3*4     4*6       2*15    2*24        3*20
                    2*2*3   2*12      3*10    3*16        4*15
                            2*2*6     2*3*5   4*12        5*12
                            2*3*4             2*3*8       6*10
                            2*2*2*3           2*4*6       2*5*6
                                              3*4*4       3*4*5
                                              2*2*12      2*2*15
                                              2*2*2*6     2*3*10
                                              2*2*3*4     2*2*3*5
                                              2*2*2*2*3
		

Crossrefs

Positions of 1's are A000430.
The weak version (>= instead of >) is A001055, non-reverse A347456.
The non-reverse version is A339890, strict A347447.
The version for reverse-alternating product 1 is A347438.
Allowing any integer reciprocal alternating product gives A347439.
The even-length case is A347440, also the opposite reverse version.
Allowing any integer rev-alt product gives A347442, non-reverse A347437.
The version for partitions is A347449, non-reverse A347448.
A001055 counts factorizations (strict A045778, ordered A074206).
A038548 counts possible rev-alt products of factorizations, integer A046951.
A103919 counts partitions by sum and alternating sum, reverse A344612.
A292886 counts knapsack factorizations, by sum A293627.
A347707 counts possible integer reverse-alternating products of partitions.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    revaltprod[q_]:=Product[q[[-i]]^(-1)^(i-1),{i,Length[q]}];
    Table[Length[Select[facs[n],revaltprod[#]>1&]],{n,100}]

Formula

a(n) = A001055(n) - A347438(n).

A325592 Triangle read by rows where T(n,k) is the number of length-k knapsack partitions of n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 3, 2, 0, 0, 1, 0, 1, 3, 4, 2, 0, 0, 1, 0, 1, 4, 3, 3, 0, 0, 0, 1, 0, 1, 4, 7, 2, 2, 0, 0, 0, 1, 0, 1, 5, 6, 4, 2, 0, 0, 0, 0, 1, 0, 1, 5, 10, 6, 4, 2, 0, 0, 0, 0, 1, 0, 1, 6, 9, 5, 1, 2, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Gus Wiseman, May 15 2019

Keywords

Comments

A knapsack partition of n is an integer partition of n whose distinct submultisets all have different sums.

Examples

			Triangle begins:
  1
  0  1
  0  1  1
  0  1  1  1
  0  1  2  0  1
  0  1  2  2  0  1
  0  1  3  2  0  0  1
  0  1  3  4  2  0  0  1
  0  1  4  3  3  0  0  0  1
  0  1  4  7  2  2  0  0  0  1
  0  1  5  6  4  2  0  0  0  0  1
  0  1  5 10  6  4  2  0  0  0  0  1
  0  1  6  9  5  1  2  0  0  0  0  0  1
  0  1  6 14 10  5  2  2  0  0  0  0  0  1
  0  1  7 13 11  3  3  2  0  0  0  0  0  0  1
  0  1  7 19 16  7  3  2  2  0  0  0  0  0  0  1
Row n = 12 counts the following partitions (A = 10, B = 11, C = 12):
   (C)  (66)   (444)   (3333)  (81111)  (222222)  (111111111111)
        (75)   (543)   (5511)           (711111)
        (84)   (552)   (7221)
        (93)   (732)   (7311)
        (A2)   (741)   (9111)
        (B1)   (822)
               (831)
               (921)
               (A11)
		

Crossrefs

Row sums are A000041.
Column k = 2 is A004526.
Column k = 3 is A325690.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n,{k}],UnsameQ@@Total/@Union[Subsets[#]]&]],{n,0,15},{k,0,n}]

A066637 Total number of elements in all factorizations of n with all factors > 1.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 1, 6, 3, 3, 1, 8, 1, 3, 3, 12, 1, 8, 1, 8, 3, 3, 1, 17, 3, 3, 6, 8, 1, 10, 1, 20, 3, 3, 3, 22, 1, 3, 3, 17, 1, 10, 1, 8, 8, 3, 1, 34, 3, 8, 3, 8, 1, 17, 3, 17, 3, 3, 1, 27, 1, 3, 8, 35, 3, 10, 1, 8, 3, 10, 1, 46, 1, 3, 8, 8, 3, 10, 1, 34, 12, 3, 1, 27, 3, 3, 3, 17, 1, 27, 3, 8, 3, 3, 3
Offset: 1

Views

Author

Amarnath Murthy, Dec 28 2001

Keywords

Comments

From Gus Wiseman, Apr 18 2021: (Start)
Number of ways to choose a factor index or position in a factorization of n. The version selecting a factor value is A339564. For example, the factorizations of n = 2, 4, 8, 12, 16, 24, 30 with a selected position (in parentheses) are:
((2)) ((4)) ((8)) ((12)) ((16)) ((24)) ((30))
((2)*2) ((2)*4) ((2)*6) ((2)*8) ((3)*8) ((5)*6)
(2*(2)) (2*(4)) (2*(6)) (2*(8)) (3*(8)) (5*(6))
((2)*2*2) ((3)*4) ((4)*4) ((4)*6) ((2)*15)
(2*(2)*2) (3*(4)) (4*(4)) (4*(6)) (2*(15))
(2*2*(2)) ((2)*2*3) ((2)*2*4) ((2)*12) ((3)*10)
(2*(2)*3) (2*(2)*4) (2*(12)) (3*(10))
(2*2*(3)) (2*2*(4)) ((2)*2*6) ((2)*3*5)
((2)*2*2*2) (2*(2)*6) (2*(3)*5)
(2*(2)*2*2) (2*2*(6)) (2*3*(5))
(2*2*(2)*2) ((2)*3*4)
(2*2*2*(2)) (2*(3)*4)
(2*3*(4))
((2)*2*2*3)
(2*(2)*2*3)
(2*2*(2)*3)
(2*2*2*(3))
(End)

Examples

			a(12) = 8: there are 4 factorizations of 12: (12), (6*2), (4*3), (3*2*2) having 1, 2, 2, 3 elements respectively, a total of 8.
		

References

  • Amarnath Murthy, Generalization of Partition function, Introducing Smarandache Factor partitions, Smarandache Notions Journal, Vol. 11, 1-2-3, Spring 2000.
  • Amarnath Murthy, Length and extent of Smarandache Factor partitions, Smarandache Notions Journal, Vol. 11, 1-2-3, Spring 2000.

Crossrefs

The version for normal multisets is A001787.
The version for compositions is A001792.
The version for partitions is A006128 (strict: A015723).
Choosing a value instead of position gives A339564.
A000070 counts partitions with a selected part.
A001055 counts factorizations.
A002033 and A074206 count ordered factorizations.
A067824 counts strict chains of divisors starting with n.
A336875 counts compositions with a selected part.

Programs

  • Maple
    # Return a list of lists which are factorizations (product representations)
    # of n. Within each sublist, the factors are sorted. A minimum factor in
    # each element of sublists returned can be specified with 'mincomp'.
    # If mincomp=2, the number of sublists contained in the list returned is A001055(n).
    # Example:
    # n=8 and mincomp=2 return [[2,2,2],[4,8],[8]]
    listProdRep := proc(n,mincomp)
        local dvs,resul,f,i,j,rli,tmp ;
        resul := [] ;
        # list returned is empty if n < mincomp
        if n >= mincomp then
            if n = 1 then
                RETURN([1]) ;
            else
                # compute the divisors, and take each divisor
                # as a head element (minimum element) of one of the
                # sublists. Example: for n=8 use {1,2,4,8}, and consider
                # (for mincomp=2) sublists [2,...], [4,...] and [8].
                dvs := numtheory[divisors](n) ;
                for i from 1 to nops(dvs) do
                    # select the head element 'f' from the divisors
                    f := op(i,dvs) ;
                    # if this is already the maximum divisor n
                    # itself, this head element is the last in
                    # the sublist
                    if f =n and f >= mincomp then
                        resul := [op(resul),[f]] ;
                    elif f >= mincomp then
                        # if this is not the maximum element
                        # n itself, produce all factorizations
                        # of the remaining factor recursively.
                        rli := procname(n/f,f) ;
                        # Prepend all the results produced
                        # from the recursion with the head
                        # element for the result.
                        for j from 1 to nops(rli) do
                            tmp := [f,op(op(j,rli))] ;
                            resul := [op(resul),tmp] ;
                        od ;
                    fi ;
                od ;
            fi ;
        fi ;
        resul ;
    end:
    A066637 := proc(n)
        local f,d;
        a := 0 ;
        for d in listProdRep(n,2) do
            a := a+nops(d) ;
        end do:
        a ;
    end proc: # R. J. Mathar, Jul 11 2013
    # second Maple program:
    with(numtheory):
    b:= proc(n, k) option remember; `if`(n>k, 0, [1$2])+
          `if`(isprime(n), 0, (p-> p+[0, p[1]])(add(
          `if`(d>k, 0, b(n/d, d)), d=divisors(n) minus {1, n})))
        end:
    a:= n-> `if`(n<2, 0, b(n$2)[2]):
    seq(a(n), n=1..120); # Alois P. Heinz, Feb 12 2019
  • Mathematica
    g[1, r_] := g[1, r]={1, 0}; g[n_, r_] := g[n, r]=Module[{ds, i, val}, ds=Select[Divisors[n], 1<#<=r&]; val={0, 0}+Sum[g[n/ds[[i]], ds[[i]]], {i, 1, Length[ds]}]; val+{0, val[[1]]}]; a[n_] := g[n, n][[2]]; a/@Range[95] (* g[n, r] = {c, f}, where c is the number of factorizations of n with factors <= r and f is the total number of factors in them. - Dean Hickerson, Oct 28 2002 *)
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];Table[Sum[Length[fac],{fac,facs[n]}],{n,50}] (* Gus Wiseman, Apr 18 2021 *)

A267597 Number of sum-product knapsack partitions of n. Number of integer partitions y of n such that every sum of products of the parts of a multiset partition of any submultiset of y is distinct.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 3, 4, 4, 6, 7, 8, 12, 12, 14, 18, 23, 23, 32, 30, 35, 50, 48, 47, 56, 80, 77, 87, 105, 100, 134, 139, 145, 194, 170, 192, 250
Offset: 0

Views

Author

Gus Wiseman, Oct 04 2018

Keywords

Examples

			The sequence of product-sum knapsack partitions begins:
   0: ()
   1: (1)
   2: (2)
   3: (3)
   4: (4)
   5: (5) (3,2)
   6: (6) (4,2) (3,3)
   7: (7) (5,2) (4,3)
   8: (8) (6,2) (5,3) (4,4)
   9: (9) (7,2) (6,3) (5,4)
  10: (10) (8,2) (7,3) (6,4) (5,5) (4,3,3)
  11: (11) (9,2) (8,3) (7,4) (6,5) (5,4,2) (5,3,3)
The partition (4,4,3) is not a sum-product knapsack partition of 11 because (4*4) = (4)+(4*3).
A complete list of all sums of products of multiset partitions of submultisets of (5,4,2) is:
            0 = 0
          (2) = 2
          (4) = 4
          (5) = 5
        (2*4) = 8
        (2*5) = 10
        (4*5) = 20
      (2*4*5) = 40
      (2)+(4) = 6
      (2)+(5) = 7
    (2)+(4*5) = 22
      (4)+(5) = 9
    (4)+(2*5) = 14
    (5)+(2*4) = 13
  (2)+(4)+(5) = 11
These are all distinct, so (5,4,2) is a sum-product knapsack partition of 11.
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};
    sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    rrtuks[n_]:=Select[IntegerPartitions[n],Function[q,UnsameQ@@Apply[Plus,Apply[Times,Union@@mps/@Union[Subsets[q]],{2}],{1}]]];
    Table[Length[rrtuks[n]],{n,12}]

Extensions

a(13)-a(37) from Sean A. Irvine, Jul 13 2022

A301856 Number of subset-products (greater than 1) of factorizations of n into factors greater than 1.

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 1, 7, 3, 4, 1, 12, 1, 4, 4, 14, 1, 12, 1, 12, 4, 4, 1, 29, 3, 4, 7, 12, 1, 17, 1, 27, 4, 4, 4, 36, 1, 4, 4, 29, 1, 17, 1, 12, 12, 4, 1, 62, 3, 12, 4, 12, 1, 29, 4, 29, 4, 4, 1, 53, 1, 4, 12, 47, 4, 17, 1, 12, 4, 17, 1, 90, 1, 4, 12, 12, 4, 17
Offset: 1

Views

Author

Gus Wiseman, Mar 27 2018

Keywords

Comments

For a finite multiset p of positive integers greater than 1 with product n, a pair (t > 1, p) is defined to be a subset-product if there exists a nonempty submultiset of p with product t.

Examples

			The a(12) = 12 subset-products:
12<=(2*2*3), 6<=(2*2*3), 4<=(2*2*3), 3<=(2*2*3), 2<=(2*2*3),
12<=(2*6),   6<=(2*6),   4<=(3*4),   3<=(3*4),   2<=(2*6),
12<=(3*4),
12<=(12).
The a(16) = 14 subset-products:
16<=(16),
16<=(4*4),
16<=(2*8),     8<=(2*8),     4<=(4*4),     2<=(2*8),
16<=(2*2*4),   8<=(2*2*4),   4<=(2*2*4),   2<=(2*2*4),
16<=(2*2*2*2), 8<=(2*2*2*2), 4<=(2*2*2*2), 2<=(2*2*2*2).
		

Crossrefs

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    Table[Sum[Length[Union[Times@@@Rest[Subsets[f]]]],{f,facs[n]}],{n,100}]
Showing 1-10 of 31 results. Next