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

A359756 First position of n in the sequence of zero-based weighted sums of standard compositions (A124757), if we start with position 0.

Original entry on oeis.org

0, 3, 6, 7, 13, 14, 15, 27, 29, 30, 31, 55, 59, 61, 62, 63, 111, 119, 123, 125, 126
Offset: 0

Views

Author

Gus Wiseman, Jan 17 2023

Keywords

Comments

The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
The zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.
Is this sequence strictly increasing?

Examples

			The terms together with their standard compositions begin:
    0: ()
    3: (1,1)
    6: (1,2)
    7: (1,1,1)
   13: (1,2,1)
   14: (1,1,2)
   15: (1,1,1,1)
   27: (1,2,1,1)
   29: (1,1,2,1)
   30: (1,1,1,2)
   31: (1,1,1,1,1)
		

Crossrefs

The one-based version is A089633, for prime indices A359682.
First index of n in A124757, reverse A231204.
The version for prime indices is A359676, reverse A359681.
A053632 counts compositions by zero-based weighted sum.
A066099 lists standard compositions.
A304818 gives weighted sums of prime indices, reverse A318283.
A320387 counts multisets by weighted sum, zero-based A359678.

Programs

  • Mathematica
    nn=10;
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    wts[y_]:=Sum[(i-1)*y[[i]],{i,Length[y]}];
    seq=Table[wts[stc[n]],{n,0,2^(nn-1)}];
    Table[Position[seq,k][[1,1]]-1,{k,0,nn}]

Formula

Appears to be the complement of A083329 in A089633.

A029931 If 2n = Sum 2^e_i, a(n) = Sum e_i.

Original entry on oeis.org

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, 6, 7, 8, 9, 9, 10, 11, 12, 10, 11, 12, 13, 13, 14, 15, 16, 11, 12, 13, 14, 14, 15, 16, 17, 15, 16, 17, 18, 18, 19, 20, 21, 7, 8, 9, 10, 10, 11, 12, 13, 11, 12, 13, 14, 14, 15, 16
Offset: 0

Views

Author

Keywords

Comments

Write n in base 2, n = sum b(i)*2^(i-1), then a(n) = sum b(i)*i. - Benoit Cloitre, Jun 09 2002
May be regarded as a triangular array read by rows, giving weighted sum of compositions in standard order. The standard order of compositions is given by A066099. - Franklin T. Adams-Watters, Nov 06 2006
Sum of all positive integer roots m_i of polynomial {m,k} - see link [Shevelev]; see also A264613. - Vladimir Shevelev, Dec 13 2015
Also the sum of binary indices of n, where a binary index of n (A048793) is any position of a 1 in its reversed binary expansion. For example, the binary indices of 11 are {1,2,4}, so a(11) = 7. - Gus Wiseman, May 22 2024

Examples

			14 = 8+4+2 so a(7) = 3+2+1 = 6.
Composition number 11 is 2,1,1; 1*2+2*1+3*1 = 7, so a(11) = 7.
The triangle starts:
  0
  1
  2 3
  3 4 5 6
The reversed binary expansion of 18 is (0,1,0,0,1) with 1's at positions {2,5}, so a(18) = 2 + 5 = 7. - _Gus Wiseman_, Jul 22 2019
		

Crossrefs

Other sequences that are built by replacing 2^k in the binary representation with other numbers: A022290 (Fibonacci), A059590 (factorials), A073642, A089625 (primes), A116549, A326031.
Cf. A001793 (row sums), A011782 (row lengths), A059867, A066099, A124757.
Row sums of A048793 and A272020.
Contains exactly A000009(n) copies of n.
For length instead of sum we have A000120, complement A023416.
For minimum instead of sum we have A001511, opposite A000012.
For maximum instead of sum we have A029837 or A070939, opposite A070940.
For product instead of sum we have A096111.
The reverse version is A230877, row sums of A371572.
The reverse complement is A359359, row sums of A371571.
The complement is A359400, row sums of A368494.
Numbers k such that a(k) is prime are A372689.
A014499 lists binary indices of prime numbers.
A019565 gives Heinz number of binary indices, inverse A048675.
A372471 lists binary indices of primes, row-sums A372429.

Programs

  • Haskell
    a029931 = sum . zipWith (*) [1..] . a030308_row
    -- Reinhard Zumkeller, Feb 28 2014
    
  • Maple
    HammingWeight := n -> add(i, i = convert(n, base, 2)):
    a := proc(n) option remember; `if`(n = 0, 0,
    ifelse(n::even, a(n/2) + HammingWeight(n/2), a(n-1) + 1)) end:
    seq(a(n), n = 0..78); # Peter Luschny, Oct 30 2021
  • Mathematica
    a[n_] := (b = IntegerDigits[n, 2]).Reverse @ Range[Length @ b]; Array[a,78,0] (* Jean-François Alcover, Apr 28 2011, after B. Cloitre *)
  • PARI
    for(n=0,100,l=length(binary(n)); print1(sum(i=1,l, component(binary(n),i)*(l-i+1)),","))
    
  • PARI
    a(n) = my(b=binary(n)); b*-[-#b..-1]~; \\ Ruud H.G. van Tol, Oct 17 2023
    
  • Python
    def A029931(n): return sum(i if j == '1' else 0 for i, j in enumerate(bin(n)[:1:-1],1)) # Chai Wah Wu, Dec 20 2022
    (C#)
    ulong A029931(ulong n) {
        ulong result = 0, counter = 1;
        while(n > 0) {
            if (n % 2 == 1)
              result += counter;
            counter++;
            n /= 2;
        }
        return result;
    } // Frank Hollstein, Jan 07 2023

Formula

a(n) = a(n - 2^L(n)) + L(n) + 1 [where L(n) = floor(log_2(n)) = A000523(n)] = sum of digits of A048794 [at least for n < 512]. - Henry Bottomley, Mar 09 2001
a(0) = 0, a(2n) = a(n) + e1(n), a(2n+1) = a(2n) + 1, where e1(n) = A000120(n). a(n) = log_2(A029930(n)). - Ralf Stephan, Jun 19 2003
G.f.: (1/(1-x)) * Sum_{k>=0} (k+1)*x^2^k/(1+x^2^k). - Ralf Stephan, Jun 23 2003
a(n) = Sum_{k>=0} A030308(n,k)*A000027(k+1). - Philippe Deléham, Oct 15 2011
a(n) = sum of n-th row of the triangle in A213629. - Reinhard Zumkeller, Jun 17 2012
From Reinhard Zumkeller, Feb 28 2014: (Start)
a(A089633(n)) = n and a(m) != n for m < A089633(n).
a(n) = Sum_{k=1..A070939(n)} k*A030308(n,k-1). (End)
a(n) = A073642(n) + A000120(n). - Peter Kagey, Apr 04 2016

Extensions

More terms from Erich Friedman

A283477 If 2n = 2^e1 + 2^e2 + ... + 2^ek [e1 .. ek distinct], then a(n) = A002110(e1) * A002110(e2) * ... * A002110(ek).

Original entry on oeis.org

1, 2, 6, 12, 30, 60, 180, 360, 210, 420, 1260, 2520, 6300, 12600, 37800, 75600, 2310, 4620, 13860, 27720, 69300, 138600, 415800, 831600, 485100, 970200, 2910600, 5821200, 14553000, 29106000, 87318000, 174636000, 30030, 60060, 180180, 360360, 900900, 1801800, 5405400, 10810800, 6306300, 12612600, 37837800, 75675600
Offset: 0

Views

Author

Antti Karttunen, Mar 16 2017

Keywords

Comments

a(n) = Product of distinct primorials larger than one, obtained as Product_{i} A002110(1+i), where i ranges over the zero-based positions of the 1-bits present in the binary representation of n.
This sequence can be represented as a binary tree. Each child to the left is obtained as A283980(k), and each child to the right is obtained as 2*A283980(k), when their parent contains k:
1
|
...................2....................
6 12
30......../ \........60 180......../ \......360
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
210 420 1260 2520 6300 12600 37800 75600
etc.

Crossrefs

Programs

  • Mathematica
    Table[Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e == 1 :> {Times @@ Prime@ Range@ PrimePi@ p, e}] &[Times @@ Prime@ Flatten@ Position[#, 1] &@ Reverse@ IntegerDigits[n, 2]], {n, 0, 43}] (* Michael De Vlieger, Mar 18 2017 *)
  • PARI
    A283477(n) = prod(i=0,exponent(n),if(bittest(n,i),vecprod(primes(1+i)),1)) \\ Edited by M. F. Hasler, Nov 11 2019
    
  • Python
    from sympy import prime, primerange, factorint
    from operator import mul
    from functools import reduce
    def P(n): return reduce(mul, [i for i in primerange(2, n + 1)])
    def a108951(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, [P(i)**f[i] for i in f])
    def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # after Chai Wah Wu
    def a(n): return a108951(a019565(n))
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 22 2017
    
  • Python
    from sympy import primorial
    from math import prod
    def A283477(n): return prod(primorial(i) for i, b in enumerate(bin(n)[:1:-1],1) if b =='1') # Chai Wah Wu, Dec 08 2022
  • Scheme
    (define (A283477 n) (A108951 (A019565 n)))
    ;; Recursive "binary tree" implementation, using memoization-macro definec:
    (definec (A283477 n) (cond ((zero? n) 1) ((even? n) (A283980 (A283477 (/ n 2)))) (else (* 2 (A283980 (A283477 (/ (- n 1) 2)))))))
    

Formula

a(0) = 1; a(2n) = A283980(a(n)), a(2n+1) = 2*A283980(a(n)).
Other identities. For all n >= 0 (or for n >= 1):
a(2n+1) = 2*a(2n).
a(n) = A108951(A019565(n)).
A097248(a(n)) = A283475(n).
A007814(a(n)) = A051903(a(n)) = A000120(n).
A001221(a(n)) = A070939(n).
A001222(a(n)) = A029931(n).
A048675(a(n)) = A005187(n).
A248663(a(n)) = A006068(n).
A090880(a(n)) = A283483(n).
A276075(a(n)) = A283984(n).
A276085(a(n)) = A283985(n).
A046660(a(n)) = A124757(n).
A056169(a(n)) = A065120(n). [seems to be]
A005361(a(n)) = A284001(n).
A072411(a(n)) = A284002(n).
A007913(a(n)) = A284003(n).
A000005(a(n)) = A284005(n).
A324286(a(n)) = A324287(n).
A276086(a(n)) = A324289(n).
A267263(a(n)) = A324341(n).
A276150(a(n)) = A324342(n). [subsequences in the latter are converging towards this sequence]
G.f.: Product_{k>=0} (1 + prime(k + 1)# * x^(2^k)), where prime()# = A002110. - Ilya Gutkovskiy, Aug 19 2019

Extensions

More formulas and the binary tree illustration added by Antti Karttunen, Mar 19 2017
Four more linking formulas added by Antti Karttunen, Feb 25 2019

A359678 Number of multisets (finite weakly increasing sequences of positive integers) with zero-based weighted sum (A359674) equal to n > 0.

Original entry on oeis.org

1, 2, 4, 4, 6, 9, 8, 10, 14, 13, 16, 21, 17, 22, 28, 23, 30, 37, 30, 38, 46, 38, 46, 59, 46, 55, 70, 59, 70, 86, 67, 81, 96, 84, 98, 115, 95, 114, 135, 114, 132, 158, 127, 156, 178, 148, 176, 207, 172, 201, 227, 196, 228, 270, 222, 255, 296, 255, 295, 338, 278
Offset: 1

Views

Author

Gus Wiseman, Jan 15 2023

Keywords

Comments

The zero-based weighted sum of a sequence (y_1,...,y_k) is Sum_{i=1..k} (i-1)*y_i.

Examples

			The a(1) = 1 through a(8) = 10 multisets:
  {1,1}  {1,2}  {1,3}    {1,4}  {1,5}    {1,6}      {1,7}    {1,8}
         {2,2}  {2,3}    {2,4}  {2,5}    {2,6}      {2,7}    {2,8}
                {3,3}    {3,4}  {3,5}    {3,6}      {3,7}    {3,8}
                {1,1,1}  {4,4}  {4,5}    {4,6}      {4,7}    {4,8}
                                {5,5}    {5,6}      {5,7}    {5,8}
                                {1,1,2}  {6,6}      {6,7}    {6,8}
                                         {1,2,2}    {7,7}    {7,8}
                                         {2,2,2}    {1,1,3}  {8,8}
                                         {1,1,1,1}           {1,2,3}
                                                             {2,2,3}
		

Crossrefs

The one-based version is A320387.
Number of appearances of n > 0 in A359674.
The sorted minimal ranks are A359675, reverse A359680.
The minimal ranks are A359676, reverse A359681.
The maximal ranks are A359757.
A053632 counts compositions by zero-based weighted sum.
A124757 gives zero-based weighted sums of standard compositions, rev A231204.

Programs

  • Mathematica
    zz[n_]:=Select[IntegerPartitions[n],UnsameQ@@#&&GreaterEqual @@ Differences[Append[#,0]]&];
    Table[Sum[Append[z,0][[1]]-Append[z,0][[2]],{z,zz[n]}],{n,30}]
  • PARI
    seq(n)={Vec(sum(k=2, (sqrtint(8*n+1)+1)\2, my(t=binomial(k, 2)); x^t/((1-x^t)*prod(j=1, k-1, 1 - x^(t-binomial(j, 2)) + O(x^(n-t+1))))))} \\ Andrew Howroyd, Jan 22 2023

Formula

G.f.: Sum_{k>=2} x^binomial(k,2)/((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[[#]]]&]

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}]
Showing 1-10 of 16 results. Next