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.

A374252 Irregular triangle read by rows where T(n,k) is the number of permutations of the prime factors of n with k runs.

Original entry on oeis.org

1, 1, 1, 0, 1, 0, 2, 1, 1, 0, 0, 1, 0, 0, 2, 1, 0, 2, 1, 1, 0, 2, 0, 2, 1, 0, 0, 0, 1, 0, 2, 1, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 2, 2, 0, 1, 0, 0, 2, 1, 0, 0, 0, 2, 1, 1, 0, 0, 6, 1, 1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 0, 2, 2, 2, 1, 0, 2, 0, 2, 0, 2, 2, 0, 1
Offset: 2

Views

Author

Gus Wiseman, Jul 07 2024

Keywords

Comments

An alternative form of this sequence (with the same data) has offset 1 and begins with an empty row.
Note that the prime factors of n are separable (A335433) iff the last term of row n is positive.

Examples

			The T(36,3) = 2 permutations are (2,3,3,2) and (3,2,2,3).
Row n = 72 counts the following permutations:
  .  (2,2,2,3,3)  (2,2,3,3,2)  (2,2,3,2,3)  (2,3,2,3,2)
     (3,3,2,2,2)  (2,3,3,2,2)  (2,3,2,2,3)
                  (3,2,2,2,3)  (3,2,2,3,2)
                               (3,2,3,2,2)
Triangle begins:
   1:
   2: 1
   3: 1
   4: 1  0
   5: 1
   6: 0  2
   7: 1
   8: 1  0  0
   9: 1  0
  10: 0  2
  11: 1
  12: 0  2  1
  13: 1
  14: 0  2
  15: 0  2
  16: 1  0  0  0
  17: 1
  18: 0  2  1
  19: 1
  20: 0  2  1
		

Crossrefs

Row-lengths are A001222.
Row-sums are A008480 (number of permutations of prime factors).
Column k = 1 is A069513.
For compositions instead of permutations of prime factors we have A238130.
Last column is A335452 (where k = A001222(n)), which counts separations.
Position of the last positive term in row n is A373957(n).
The number of zeros at the end of row n is A374246(n).
The number of nonzero terms in row n is A374247(n).
A001221 counts distinct prime factors.
A003242 counts run-compressed compositions, i.e., anti-runs.
A124767 counts runs in standard compositions, anti-runs A333381.
A333755 counts compositions by number of runs.
A335433 lists separable numbers, complement A335448.
A374250 maximizes sum of run-compression, for indices A373956.

Programs

  • Mathematica
    prifacs[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[Length[Select[Permutations[prifacs[n]], Length[Split[#]]==k&]],{n,100},{k,PrimeOmega[n]}]

A374246 Number of prime factors of n counted with multiplicity (A001222) minus the greatest number of runs possible in a permutation of them (A373957).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 07 2024

Keywords

Comments

a(n) = 0 iff n has separable prime factors (A335433). A multiset is separable iff it has a permutation that is an anti-run (meaning there are no adjacent equal parts).

Examples

			The runs of the 4 permutations of the prime factors of 24 are:
  ((2,2,2),(3))
  ((2,2),(3),(2))
  ((2),(3),(2,2))
  ((3),(2,2,2))
The longest have length 3, so a(24) = 4 - 3 = 1.
		

Crossrefs

Using the minimum instead of maximum number of runs gives A046660.
Positions of first appearances are A151821 (powers of 2 except 2 itself).
Positions of positive terms are A335448, complement A335433.
This is an opposite version of A373957.
The sister-sequence A374247 uses A001221 instead of A001222.
This is the number of zeros at the end of row n of A374252.
A001221 counts distinct prime factors, A001222 with multiplicity.
A008480 counts permutations of prime factors.
A027746 lists prime factors, row-sums A001414.
A027748 is run-compression of prime factors, row-sums A008472.
A304038 is run-compression of prime indices, row-sums A066328.
A374250 maximizes sum of run-compression, for indices A373956.

Programs

  • Mathematica
    prifacs[n_]:=If[n==1,{}, Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[PrimeOmega[n]-Max@@Table[Length[Split[y]], {y,Permutations[prifacs[n]]}],{n,100}]

Formula

a(n) = A001222(n) - A373957(n).

A374250 Greatest sum of run-compression of a permutation of the prime factors of n.

Original entry on oeis.org

0, 2, 3, 2, 5, 5, 7, 2, 3, 7, 11, 7, 13, 9, 8, 2, 17, 8, 19, 9, 10, 13, 23, 7, 5, 15, 3, 11, 29, 10, 31, 2, 14, 19, 12, 10, 37, 21, 16, 9, 41, 12, 43, 15, 11, 25, 47, 7, 7, 12, 20, 17, 53, 8, 16, 11, 22, 31, 59, 12, 61, 33, 13, 2, 18, 16, 67, 21, 26, 14, 71
Offset: 1

Views

Author

Gus Wiseman, Jul 09 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The prime factors of 24 are {2,2,2,3}, with permutations such as (2,2,3,2) whose run-compression sums to 7, so a(24) = 7.
The prime factors of 216 are {2,2,2,3,3,3}, with permutations such as (2,3,2,3,2,3) whose run-compression sums to 15, so a(216) = 15.
		

Crossrefs

Positions of 2 are A000079 (powers of two) except 1.
Positions of 3 are A000244 (powers of three) except 1.
For least instead of greatest sum of run-compression we have A008472.
For prime indices instead of factors we have A373956.
For number of runs instead of sum of run-compression we have A373957.
A001221 counts distinct prime factors, A001222 with multiplicity.
A003242 counts run-compressed compositions, i.e., anti-runs.
A007947 (squarefree kernel) represents run-compression of multisets.
A008480 counts permutations of prime factors (or prime indices).
A056239 adds up prime indices, row sums of A112798.
A116861 counts partitions by sum of run-compression.
A304038 lists run-compression of prime indices, sum A066328.
A335433 lists numbers whose prime indices are separable, complement A335448.
A373949 counts compositions by sum of run-compression, opposite A373951.
A374251 run-compresses standard compositions, sum A373953, rank A373948.

Programs

  • Mathematica
    prifacs[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[Max@@(Total[First/@Split[#]]& /@ Permutations[prifacs[n]]),{n,100}]

Formula

a(n) = A001414(n) iff n belongs to A335433 (the separable case, complement A335448), row-sums of A027746.

A374247 The greatest number of runs possible in a permutation of the prime factors of n (A373957) minus the number of distinct such factors (A001221).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Jul 07 2024

Keywords

Comments

If n has separable prime factors (A335433), then a(n) = A001222(n) - A001221(n) = A046660(n). A multiset is separable iff it has an anti-run permutation (meaning there are no adjacent equal parts).

Examples

			The runs of the 6 permutations of the prime factors of 36 are:
  ((2,2),(3,3))
  ((2),(3),(2),(3))
  ((2),(3,3),(2))
  ((3),(2,2),(3))
  ((3),(2),(3),(2))
  ((3,3),(2,2))
The longest length is 4, so a(36) = 4 - 2 = 2.
		

Crossrefs

Positions of first appearances appear to be A026549.
Positions of nonzero terms are A126706, complement A303554.
This is an opposite version of A373957.
The sister-sequence A374246 uses A001222 instead of A001221.
This is the number of nonzero terms in row n of A374252.
A003242 counts run-compressed compositions, i.e., anti-runs.
A008480 counts permutations of prime factors, by number of runs A374252.
A027746 lists prime factors, row-sums A001414.
A027748 is run-compression of prime factors, row-sums A008472.
A304038 is run-compression of prime indices, row-sums A066328.
A333755 counts compositions by number of runs.
A335433 lists separable numbers, complement A335448.
A374250 maximizes sum of run-compression, for indices A373956.

Programs

  • Mathematica
    prifacs[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[Max@@Table[Length[Split[y]], {y,Permutations[prifacs[n]]}]-PrimeNu[n],{n,100}]

Formula

a(n) = A373957(n) - A001221(n).

A374248 Sum of prime indices of n (with multiplicity) minus the greatest possible sum of run-compression of a permutation of the prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 10 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).
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.

Examples

			The prime indices of 96 are {1,1,1,1,1,2}, with sum 7, and we have permutations such as (1,1,1,1,2,1), with run-compression (1,2,1), with sum 4, so a(96) = 7 - 4 = 3.
		

Crossrefs

Positions of zeros are A335433 (separable).
Positions of positive terms are A335448 (inseparable).
This is an opposite version of A373956, for prime factors A374250.
For prime factors instead of indices we have A374255.
A001221 counts distinct prime factors, A001222 with multiplicity.
A003242 counts run-compressed compositions, i.e., anti-runs.
A007947 (squarefree kernel) represents run-compression of multisets.
A008480 counts permutations of prime factors.
A027746 lists prime factors, row-sums A001414.
A027748 is run-compression of prime factors, row-sums A008472.
A056239 adds up prime indices, row-sums of A112798.
A116861 counts partitions by sum of run-compression.
A304038 is run-compression of prime indices, row-sums A066328.
A373949 counts compositions by sum of run-compression, opposite A373951.
A373957 gives greatest number of runs in a permutation of prime factors.
A374251 run-compresses standard compositions, sum A373953, rank A373948.
A374252 counts permutations of prime factors by number of runs.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Total[prix[n]]-Max@@(Total[First/@Split[#]]&/@Permutations[prix[n]]),{n,100}]

Formula

a(n) = A056239(n) - A373956(n).

A373950 Number of integer compositions of n containing two adjacent ones and no other runs.

Original entry on oeis.org

0, 0, 1, 0, 2, 4, 5, 14, 26, 46, 92, 176, 323, 610, 1145, 2108, 3912, 7240, 13289, 24418, 44778, 81814, 149356, 272222, 495144, 899554, 1632176, 2957332, 5352495, 9677266, 17477761, 31536288, 56852495, 102403134, 184302331, 331452440, 595659234, 1069742760
Offset: 0

Views

Author

Gus Wiseman, Jun 28 2024

Keywords

Comments

Also the number of integer compositions of n such that replacing each run of repeated parts with a single part (run-compression) results in a composition of n-1.

Examples

			The a(0) = 0 through a(7) = 14 compositions:
  .  .  (11)  .  (112)  (113)   (114)   (115)
                 (211)  (311)   (411)   (511)
                        (1121)  (1131)  (1123)
                        (1211)  (1311)  (1132)
                                (2112)  (1141)
                                        (1411)
                                        (2113)
                                        (2311)
                                        (3112)
                                        (3211)
                                        (11212)
                                        (12112)
                                        (21121)
                                        (21211)
		

Crossrefs

For any run (not just of ones) we have A003242.
Subdiagonal of A373949.
These compositions are ranked by A373956.
A003242 counts compressed compositions.
A114901 counts compositions with no isolated parts.
A116861 counts partitions by compressed sum, by compressed length A116608.
A333755 counts compositions by compressed length (number of runs).
A373948 represents the run-compression transformation.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations /@ IntegerPartitions[n], Total[First/@Split[#]]==n-1&]],{n,0,10}]
  • PARI
    A_x(N)={my(x='x+O('x^N), h=x/((1+x)^2*(1-sum(i=1,N, (x^i /(1+x^i))))^2)); concat([0, 0], Vec(h))}
    A_x(40) \\ John Tyler Rascoe, Jul 02 2024

Formula

a(n>0) = A373949(n,n-1).
G.f.: x/((1-x)^2 * (1 - Sum_{i>0} (x^i/(1+x^i)))^2). - John Tyler Rascoe, Jul 02 2024

Extensions

a(26) onwards from John Tyler Rascoe, Jul 02 2024

A374255 Sum of prime factors of n (with multiplicity) minus the greatest possible sum of run-compression of a permutation of the prime factors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 10 2024

Keywords

Comments

Contains no ones.
We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, run-compression removes all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The prime factors of 96 are {2,2,2,2,2,3}, with sum 13, and we have permutations such as (2,2,2,2,3,2), with run-compression (2,3,2), with sum 7, so a(96) = 13 - 7 = 6.
		

Crossrefs

Positions of first appearances are A280286.
For least instead of greatest sum of run-compression we have A280292.
Positions of zeros are A335433 (separable).
Positions of positive terms are A335448 (inseparable).
For prime indices instead of factors we have A374248.
This is an opposite version of A374250, for prime indices A373956.
A001221 counts distinct prime factors, A001222 with multiplicity.
A003242 counts run-compressed compositions, i.e., anti-runs.
A007947 (squarefree kernel) represents run-compression of multisets.
A008480 counts permutations of prime factors.
A027746 lists prime factors, row-sums A001414.
A027748 is run-compression of prime factors, row-sums A008472.
A056239 adds up prime indices, row sums of A112798.
A116861 counts partitions by sum of run-compression.
A304038 is run-compression of prime indices, row-sums A066328.
A373949 counts compositions by sum of run-compression, opposite A373951.
A373957 gives greatest number of runs in a permutation of prime factors.
A374251 run-compresses standard compositions, sum A373953, rank A373948.
A374252 counts permutations of prime factors by number of runs.

Programs

  • Mathematica
    prifacs[n_]:=If[n==1,{},Flatten[ConstantArray@@@FactorInteger[n]]];
    Table[Total[prifacs[n]]-Max@@(Total[First/@Split[#]]& /@ Permutations[prifacs[n]]),{n,100}]

Formula

a(n) = A001414(n) - A374250(n).
Showing 1-7 of 7 results.