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 26 results. Next

A320387 Number of partitions of n into distinct parts such that the successive differences of consecutive parts are nonincreasing, and first difference <= first part.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 2, 2, 4, 3, 4, 5, 3, 5, 7, 4, 7, 8, 6, 8, 11, 7, 9, 13, 9, 11, 16, 12, 15, 18, 13, 17, 20, 17, 21, 24, 19, 24, 30, 22, 28, 34, 26, 34, 38, 30, 37, 43, 37, 42, 48, 41, 50, 58, 48, 55, 64, 53, 64, 71, 59, 73, 81, 69, 79, 89, 79, 90, 101, 87, 100, 111
Offset: 0

Views

Author

Seiichi Manyama, Oct 12 2018

Keywords

Comments

Partitions are usually written with parts in descending order, but the conditions are easier to check "visually" if written in ascending order.
Generating function of the "second integrals" of partitions: given a partition (p_1, ..., p_s) written in weakly decreasing order, write the sequence B = (b_1, b_2, ..., b_s) = (p_1, p_1 + p_2, ..., p_1 + ... + p_s). The sequence gives the coefficients of the generating function summing q^(b_1 + ... + b_s) over all partitions of all nonnegative integers. - William J. Keith, Apr 23 2022
From Gus Wiseman, Jan 17 2023: (Start)
Equivalently, a(n) is the number of multisets (weakly increasing sequences of positive integers) with weighted sum n. For example, the Heinz numbers of the a(0) = 1 through a(15) = 7 multisets are:
1 2 3 4 7 6 8 10 15 12 16 18 20 26 24 28
5 11 9 17 19 14 21 22 27 41 30 32
13 23 29 31 33 55 39 34
25 35 37 43 45
49 77 47
65
121
These multisets are counted by A264034. The reverse version is A007294. The zero-based version is A359678.
(End)

Examples

			There are a(29) = 15 such partitions of 29:
  01: [29]
  02: [10, 19]
  03: [11, 18]
  04: [12, 17]
  05: [13, 16]
  06: [14, 15]
  07: [5, 10, 14]
  08: [6, 10, 13]
  09: [6, 11, 12]
  10: [7, 10, 12]
  11: [8, 10, 11]
  12: [3, 6, 9, 11]
  13: [5, 7, 8, 9]
  14: [2, 4, 6, 8, 9]
  15: [3, 5, 6, 7, 8]
There are a(30) = 18 such partitions of 30:
  01: [30]
  02: [10, 20]
  03: [11, 19]
  04: [12, 18]
  05: [13, 17]
  06: [14, 16]
  07: [5, 10, 15]
  08: [6, 10, 14]
  09: [6, 11, 13]
  10: [7, 10, 13]
  11: [7, 11, 12]
  12: [8, 10, 12]
  13: [3, 6, 9, 12]
  14: [9, 10, 11]
  15: [4, 7, 9, 10]
  16: [2, 4, 6, 8, 10]
  17: [6, 7, 8, 9]
  18: [4, 5, 6, 7, 8]
		

Crossrefs

Number of appearances of n > 0 in A304818, reverse A318283.
A053632 counts compositions by weighted sum.
A358194 counts partitions by weighted sum, reverse A264034.
Weighted sum of prime indices: A359497, A359676, A359682, A359754, A359755.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ots[y_]:=Sum[i*y[[i]],{i,Length[y]}];
    Table[Length[Select[Range[2^n],ots[prix[#]]==n&]],{n,10}] (* Gus Wiseman, Jan 17 2023 *)
  • PARI
    seq(n)={Vec(sum(k=1, (sqrtint(8*n+1)+1)\2, my(t=binomial(k,2)); x^t/prod(j=1, k-1, 1 - x^(t-binomial(j,2)) + O(x^(n-t+1)))))} \\ Andrew Howroyd, Jan 22 2023
  • Ruby
    def partition(n, min, max)
      return [[]] if n == 0
      [max, n].min.downto(min).flat_map{|i| partition(n - i, min, i - 1).map{|rest| [i, *rest]}}
    end
    def f(n)
      return 1 if n == 0
      cnt = 0
      partition(n, 1, n).each{|ary|
        ary << 0
        ary0 = (1..ary.size - 1).map{|i| ary[i - 1] - ary[i]}
        cnt += 1 if ary0.sort == ary0
      }
      cnt
    end
    def A320387(n)
      (0..n).map{|i| f(i)}
    end
    p A320387(50)
    

Formula

G.f.: Sum_{k>=1} x^binomial(k,2)/Product_{j=1..k-1} (1 - x^(binomial(k,2)-binomial(j,2))). - Andrew Howroyd, Jan 22 2023

A264034 Triangle read by rows: T(n,k) (n>=0, 0<=k<=A161680(n)) is the number of integer partitions of n with weighted sum k.

Original entry on oeis.org

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

Views

Author

Christian Stump, Nov 01 2015

Keywords

Comments

Row sums give A000041.
The weighted sum is given by the sum of the rows where row i is weighted by i.
Note that the first part has weight 0. This statistic (zero-based weighted sum) is ranked by A359677, reverse A359674. Also the number of partitions of n with one-based weighted sum n + k. - Gus Wiseman, Jan 10 2023

Examples

			Triangle T(n,k) begins:
  1;
  1;
  1,1;
  1,1,0,1;
  1,1,1,1,0,0,1;
  1,1,1,1,1,0,1,0,0,0,1;
  1,1,1,2,1,0,2,1,0,0,1,0,0,0,0,1;
  1,1,1,2,1,1,2,1,0,1,1,1,0,0,0,1,0,0,0,0,0,1;
  1,1,1,2,2,1,2,2,1,1,1,1,1,1,0,1,1,0,0,0,0,1,0,0,0,0,0,0,1;
  ...
The a(15,31) = 5 partitions of 15 with weighted sum 31 are: (6,2,2,1,1,1,1,1), (5,4,1,1,1,1,1,1), (5,2,2,2,2,1,1), (4,3,2,2,2,2), (3,3,3,3,2,1). These are also the partitions of 15 with one-based weighted sum 46. - _Gus Wiseman_, Jan 09 2023
		

Crossrefs

Row sums are A000041.
The version for compositions is A053632, ranked by A124757 (reverse A231204).
Row lengths are A152947, or A161680 plus 1.
The one-based version is also A264034, if we use k = n..n(n+1)/2.
The reverse version A358194 counts partitions by sum of partial sums.
A359677 gives zero-based weighted sum of prime indices, reverse A359674.
A359678 counts multisets by zero-based weighted sum.

Programs

  • Maple
    b:= proc(n, i, w) option remember; expand(
          `if`(n=0, 1, `if`(i<1, 0, b(n, i-1, w)+
          `if`(i>n, 0, x^(w*i)*b(n-i, i, w+1)))))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2, 0)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Nov 01 2015
  • Mathematica
    b[n_, i_, w_] := b[n, i, w] = Expand[If[n == 0, 1, If[i < 1, 0, b[n, i - 1, w] + If[i > n, 0, x^(w*i)*b[n - i, i, w + 1]]]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, n, 0]]; Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Feb 07 2017, after Alois P. Heinz *)
    Table[Length[Select[IntegerPartitions[n],Total[Accumulate[Reverse[#]]]==k&]],{n,0,8},{k,n,n*(n+1)/2}] (* Gus Wiseman, Jan 09 2023 *)

Formula

From Alois P. Heinz, Jan 20 2023: (Start)
max_{k=0..A161680(n)} T(n,k) = A337206(n).
Sum_{k=0..A161680(n)} k * T(n,k) = A066185(n). (End)

A359755 Positions of first appearances in the sequence of weighted sums of prime indices (A304818).

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 10, 12, 15, 16, 18, 20, 24, 26, 28, 36, 40, 46, 48, 50, 52, 56, 62, 68, 74, 76, 86, 88, 92, 94, 106, 107, 118, 122, 124, 131, 134, 136, 142, 146, 152, 158, 164, 166, 173, 178, 188, 193, 194, 199, 202, 206, 214, 218, 226, 229, 236, 239, 254
Offset: 1

Views

Author

Gus Wiseman, Jan 15 2023

Keywords

Comments

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 weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i*y_i.

Examples

			The terms together with their prime indices begin:
    1: {}
    2: {1}
    3: {2}
    4: {1,1}
    6: {1,2}
    7: {4}
    8: {1,1,1}
   10: {1,3}
   12: {1,1,2}
   15: {2,3}
   16: {1,1,1,1}
   18: {1,2,2}
   20: {1,1,3}
   24: {1,1,1,2}
		

Crossrefs

The version for standard compositions is A089633, zero-based A359756.
Positions of first appearances in A304818, reverse A318283.
The zero-based version is A359675, unsorted A359676.
The reverse zero-based version is A359680, unsorted A359681.
This is the sorted version of A359682, reverse A359679.
The reverse version is A359754.
A053632 counts compositions by weighted sum.
A112798 lists prime indices, length A001222, sum A056239.
A320387 counts multisets by weighted sum, zero-based A359678.
A358136 lists partial sums of prime indices, ranked by A358137, rev A359361.

Programs

  • Mathematica
    nn=1000;
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ots[y_]:=Sum[i*y[[i]],{i,Length[y]}];
    seq=Table[ots[primeMS[n]],{n,1,nn}];
    Select[Range[nn],FreeQ[seq[[Range[#-1]]],seq[[#]]]&]

A124757 Zero-based weighted sum of compositions in standard order.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 3, 4, 5, 6, 0, 1, 2, 3, 3, 4, 5, 6, 4, 5, 6, 7, 7, 8, 9, 10, 0, 1, 2, 3, 3, 4, 5, 6, 4, 5, 6, 7, 7, 8, 9, 10, 5, 6, 7, 8, 8, 9, 10, 11, 9, 10, 11, 12, 12, 13, 14, 15, 0, 1, 2, 3, 3, 4, 5, 6, 4, 5, 6, 7, 7, 8, 9, 10, 5, 6, 7, 8, 8, 9, 10, 11, 9, 10, 11, 12, 12, 13, 14
Offset: 0

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
Sum of all positions of 1's except the last in the reversed binary expansion of n. For example, the reversed binary expansion of 14 is (0,1,1,1), so a(14) = 2 + 3 = 5. Keeping the last position gives A029931. - Gus Wiseman, Jan 17 2023

Examples

			Composition number 11 is 2,1,1; 0*2+1*1+2*1 = 3, so a(11) = 3.
The table starts:
  0
  0
  0 1
  0 1 2 3
		

Crossrefs

Cf. A066099, A070939, A029931, A011782 (row lengths), A001788 (row sums).
Row sums of A048793 if we delete the last part of every row.
For prime indices instead of standard comps we have A359674, rev A359677.
Positions of first appearances are A359756.
A003714 lists numbers with no successive binary indices.
A030190 gives binary expansion, reverse A030308.
A230877 adds up positions of 1's in binary expansion, length A000120.
A359359 adds up positions of 0's in binary expansion, length A023416.

Programs

  • Mathematica
    Table[Total[Most[Join@@Position[Reverse[IntegerDigits[n,2]],1]]],{n,30}]

Formula

For a composition b(1),...,b(k), a(n) = Sum_{i=1..k} (i-1)*b(i).
For n>0, a(n) = A029931(n) - A070939(n).

A359674 Zero-based weighted sum of the prime indices of n in weakly increasing order.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 3, 2, 3, 0, 5, 0, 4, 3, 6, 0, 6, 0, 7, 4, 5, 0, 9, 3, 6, 6, 9, 0, 8, 0, 10, 5, 7, 4, 11, 0, 8, 6, 12, 0, 10, 0, 11, 8, 9, 0, 14, 4, 9, 7, 13, 0, 12, 5, 15, 8, 10, 0, 14, 0, 11, 10, 15, 6, 12, 0, 15, 9, 11, 0, 17, 0, 12, 9, 17, 5, 14, 0, 18
Offset: 1

Views

Author

Gus Wiseman, Jan 13 2023

Keywords

Comments

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 zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.

Examples

			The prime indices of 12 are {1,1,2}, so a(12) = 0*1 + 1*1 + 2*2 = 5.
		

Crossrefs

Positions of last appearances (except 0) are A001248.
Positions of 0's are A008578.
The version for standard compositions is A124757, reverse A231204.
The one-based version is A304818, reverse A318283.
Positions of first appearances are A359675, reverse A359680.
First position of n is A359676(n), reverse A359681.
The reverse version is A359677, firsts A359679.
Number of appearances of positive n is A359678(n).
A053632 counts compositions by zero-based weighted sum.
A112798 lists prime indices, length A001222, sum A056239.
A358136 lists partial sums of prime indices, ranked by A358137, rev A359361.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    Table[wts[primeMS[n]],{n,100}]

A359676 Least positive integer whose weakly increasing prime indices have zero-based weighted sum n (A359674).

Original entry on oeis.org

1, 4, 6, 8, 14, 12, 16, 20, 30, 24, 32, 36, 40, 52, 48, 56, 100, 72, 80, 92, 96, 104, 112, 124, 136, 148, 176, 152, 214, 172, 184, 188, 262, 212, 272, 236, 248, 244, 304, 268, 346, 284, 328, 292, 386, 316, 398, 332, 376, 356, 458, 388, 478, 404, 472, 412, 526
Offset: 1

Views

Author

Gus Wiseman, Jan 14 2023

Keywords

Comments

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 zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.

Examples

			The terms together with their prime indices begin:
    1: {}
    4: {1,1}
    6: {1,2}
    8: {1,1,1}
   14: {1,4}
   12: {1,1,2}
   16: {1,1,1,1}
   20: {1,1,3}
   30: {1,2,3}
   24: {1,1,1,2}
   32: {1,1,1,1,1}
   36: {1,1,2,2}
   40: {1,1,1,3}
   52: {1,1,6}
   48: {1,1,1,1,2}
		

Crossrefs

First position of n in A359674, reverse A359677.
The sorted version is A359675, reverse A359680.
The reverse one-based version is A359679, sorted A359754.
The reverse version is A359681.
The one-based version is A359682, sorted A359755.
The version for standard compositions is A359756, one-based A089633.
A053632 counts compositions by zero-based weighted sum.
A112798 lists prime indices, length A001222, sum A056239.
A124757 gives zero-based weighted sum of standard compositions, rev A231204.
A304818 gives weighted sums of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.
A358136 lists partial sums of prime indices, ranked by A358137, rev A359361.

Programs

  • Mathematica
    nn=20;
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    seq=Table[wts[primeMS[n]],{n,1,Prime[nn]^2}];
    Table[Position[seq,k][[1,1]],{k,0,nn}]

A359677 Zero-based weighted sum of the reversed (weakly decreasing) prime indices of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jan 13 2023

Keywords

Comments

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 zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.

Examples

			The reversed prime indices of 12 are (2,1,1), so a(12) = 0*2 + 1*1 + 2*1 = 3.
		

Crossrefs

Positions of 0's are A008578.
Positions of 1's are A100484.
The version for standard compositions is A231204, reverse of A124757.
The one-based version is A318283, unreversed A304818.
The one-based version for standard compositions is A359042, rev of A029931.
This is the reverse version of A359674.
First position of n is A359679(n), reverse of A359675.
Positions of first appearances are A359680, reverse of A359676.
A053632 counts compositions by weighted sum.
A112798 lists prime indices, length A001222, sum A056239.
A358136 lists partial sums of prime indices, ranked by A358137, rev A359361.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    Table[wts[Reverse[primeMS[n]]],{n,100}]

A359681 Least positive integer whose reversed (weakly decreasing) prime indices have zero-based weighted sum (A359677) equal to n.

Original entry on oeis.org

1, 4, 9, 8, 18, 50, 16, 36, 100, 54, 32, 72, 81, 108, 300, 64, 144, 400, 216, 600, 243, 128, 288, 800, 432, 486, 1350, 648, 256, 576, 729, 864, 2400, 3375, 1296, 3600, 512, 1152, 1944, 1728, 4800, 9000, 2187, 2916, 8100, 1024, 2304, 6400, 3456, 4374, 12150
Offset: 0

Views

Author

Gus Wiseman, Jan 15 2023

Keywords

Comments

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 zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.

Examples

			The terms together with their prime indices begin:
    1: {}
    4: {1,1}
    9: {2,2}
    8: {1,1,1}
   18: {1,2,2}
   50: {1,3,3}
   16: {1,1,1,1}
   36: {1,1,2,2}
  100: {1,1,3,3}
   54: {1,2,2,2}
   32: {1,1,1,1,1}
   72: {1,1,1,2,2}
   81: {2,2,2,2}
  108: {1,1,2,2,2}
  300: {1,1,2,3,3}
		

Crossrefs

The unreversed version is A359676.
First position of n in A359677, reverse A359674.
The one-based version is A359679, sorted A359754.
The sorted version is A359680, reverse A359675.
The unreversed one-based version is A359682, sorted A359755.
A053632 counts compositions by zero-based weighted sum.
A112798 lists prime indices, length A001222, sum A056239.
A124757 gives zero-based weighted sum of standard compositions, rev A231204.
A304818 gives weighted sum of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.

Programs

  • Mathematica
    nn=20;
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    seq=Table[wts[Reverse[primeMS[n]]],{n,1,Prime[nn]^2}];
    Table[Position[seq,k][[1,1]],{k,0,nn}]

A359682 Least positive integer whose weakly increasing prime indices have weighted sum (A304818) equal to n.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 8, 10, 15, 12, 16, 18, 20, 26, 24, 28, 50, 36, 40, 46, 48, 52, 56, 62, 68, 74, 88, 76, 107, 86, 92, 94, 131, 106, 136, 118, 124, 122, 152, 134, 173, 142, 164, 146, 193, 158, 199, 166, 188, 178, 229, 194, 239, 202, 236, 206, 263, 214, 271, 218
Offset: 0

Views

Author

Gus Wiseman, Jan 15 2023

Keywords

Comments

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 weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i*y_i.

Examples

			The 5 numbers with weighted sum of prime indices 12, together with their prime indices:
  20: {1,1,3}
  27: {2,2,2}
  33: {2,5}
  37: {12}
  49: {4,4}
Hence a(12) = 20.
		

Crossrefs

The version for standard compositions is A089633, zero-based A359756.
First position of n in A304818, reverse A318283.
The greatest instead of least is A359497, reverse A359683.
The sorted zero-based version is A359675, reverse A359680.
The zero-based version is A359676, reverse A359681.
The reverse version is A359679.
The sorted version is A359755, reverse A359754.
A112798 lists prime indices, length A001222, sum A056239.
A320387 counts multisets by weighted sum, zero-based A359678.
A358136 lists partial sums of prime indices, ranked by A358137, rev A359361.

Programs

  • Mathematica
    nn=20;
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ots[y_]:=Sum[i*y[[i]],{i,Length[y]}];
    seq=Table[ots[primeMS[n]],{n,1,Prime[nn]^2}];
    Table[Position[seq,k][[1,1]],{k,0,nn}]

A359497 Greatest positive integer whose weakly increasing prime indices have weighted sum (A304818) equal to n.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 25, 29, 35, 49, 55, 77, 121, 91, 143, 169, 187, 221, 289, 247, 323, 361, 391, 437, 539, 605, 847, 1331, 715, 1001, 1573, 1183, 1859, 2197, 1547, 2431, 2873, 3179, 3757, 4913, 3553, 4199, 5491, 4693, 6137, 6859, 9317, 14641
Offset: 0

Views

Author

Gus Wiseman, Jan 15 2023

Keywords

Comments

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 weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} i*y_i.

Examples

			The terms together with their prime indices begin:
    1: {}
    2: {1}
    3: {2}
    5: {3}
    7: {4}
   11: {5}
   13: {6}
   17: {7}
   19: {8}
   25: {3,3}
   29: {10}
   35: {3,4}
   49: {4,4}
   55: {3,5}
   77: {4,5}
The 5 numbers with weighted sum of prime indices 12, together with their prime indices:
  20: {1,1,3}
  27: {2,2,2}
  33: {2,5}
  37: {12}
  49: {4,4}
Hence a(12) = 49.
		

Crossrefs

First position of n in A304818, reverse A318283.
The least instead of greatest is given by A359682, reverse A359679.
The reverse version is A359683.
A112798 lists prime indices, length A001222, sum A056239.
A320387 counts multisets by weighted sum, zero-based A359678.
A358136 lists partial sums of prime indices, ranked by A358137, rev A359361.

Programs

  • Mathematica
    nn=10;
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ots[y_]:=Sum[i*y[[i]],{i,Length[y]}];
    seq=Table[ots[primeMS[n]],{n,1,2^nn}];
    Table[Position[seq,k][[-1,1]],{k,0,nn}]
  • PARI
    a(n)={ my(recurse(r, k, m) = if(k==1, if(m>=r, prime(r)),
      my(z=0); for(j=1, min(m, (r-k*(k-1)/2)\k), z=max(z, self()(r-k*j, k-1, j)*prime(j))); z));
      if(n==0, 1, vecmax(vector((sqrtint(8*n+1)-1)\2, k, recurse(n, k, n))));
    } \\ Andrew Howroyd, Jan 21 2023

Extensions

Terms a(21) and beyond from Andrew Howroyd, Jan 21 2023
Showing 1-10 of 26 results. Next