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

A345926 Number of distinct possible alternating sums of permutations of the multiset of prime indices of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 4, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 3
Offset: 1

Views

Author

Gus Wiseman, Jul 14 2021

Keywords

Comments

First differs from A096825 at a(90) = 3, A096825(90) = 4.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. Of course, the alternating sum of prime indices is also the reverse-alternating sum of reversed prime indices.
Also the number of possible values of A056239(d) where d is a divisor of n with half as many prime factors (rounded up) as n.

Examples

			Grouping the 12 permutations of {1,2,2,3} by alternating sum k gives:
  k = -2: (1223) (1322) (2213) (2312)
  k =  0: (1232) (2123) (2321) (3212)
  k =  2: (2132) (2231) (3122) (3221)
so a(90) = 3.
		

Crossrefs

The version for prime factors instead of indices is A343943.
A000005 counts divisors.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A001414 adds up prime factors, row sums of A027746.
A056239 adds up prime indices, row sums of A112798.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
A345197 counts compositions by length and alternating sum.
A344610 counts partitions by sum and positive reverse-alternating sum.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Length[Union[ats/@Permutations[primeMS[n]]]],{n,100}]
  • Python
    from sympy import factorint, primepi
    from sympy.utilities.iterables import multiset_combinations
    def A345926(n):
        fs = dict((primepi(a),b) for (a,b) in factorint(n).items())
        return len(set(sum(d) for d in multiset_combinations(fs, (sum(fs.values())+1)//2))) # Chai Wah Wu, Aug 23 2021

A370817 Greatest number of multisets that can be obtained by choosing a prime factor of each factor in an integer factorization of n into unordered factors > 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 4, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Mar 07 2024

Keywords

Comments

First differs from A096825 at a(210) = 4, A096825(210) = 6.
First differs from A343943 at a(210) = 4, A343943(210) = 6.
First differs from A345926 at a(90) = 4, A345926(90) = 3.

Examples

			For the factorizations of 60 we have the following choices (using prime indices {1,2,3} instead of prime factors {2,3,5}):
  (2*2*3*5): {{1,1,2,3}}
   (2*2*15): {{1,1,2},{1,1,3}}
   (2*3*10): {{1,1,2},{1,2,3}}
    (2*5*6): {{1,1,3},{1,2,3}}
    (3*4*5): {{1,2,3}}
     (2*30): {{1,1},{1,2},{1,3}}
     (3*20): {{1,2},{2,3}}
     (4*15): {{1,2},{1,3}}
     (5*12): {{1,3},{2,3}}
     (6*10): {{1,1},{1,2},{1,3},{2,3}}
       (60): {{1},{2},{3}}
So a(60) = 4.
		

Crossrefs

For all divisors (not just prime factors) we have A370816.
The version for partitions is A370809, for all divisors A370808.
A000005 counts divisors.
A001055 counts factorizations, strict A045778.
A006530 gives greatest prime factor, least A020639.
A027746 lists prime factors, A112798 indices, length A001222.
A355741 chooses prime factors of prime indices, variations A355744, A355745.
A368413 counts non-choosable factorizations, complement A368414.
A370813 counts non-divisor-choosable factorizations, complement A370814.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    Table[Max[Length[Union[Sort/@Tuples[If[#==1,{},First/@FactorInteger[#]]&/@#]]]&/@facs[n]],{n,100}]
Showing 1-2 of 2 results.