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

A005940 The Doudna sequence: write n-1 in binary; power of prime(k) in a(n) is # of 1's that are followed by k-1 0's.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 15, 12, 25, 18, 27, 16, 11, 14, 21, 20, 35, 30, 45, 24, 49, 50, 75, 36, 125, 54, 81, 32, 13, 22, 33, 28, 55, 42, 63, 40, 77, 70, 105, 60, 175, 90, 135, 48, 121, 98, 147, 100, 245, 150, 225, 72, 343, 250, 375, 108, 625, 162, 243, 64, 17, 26, 39
Offset: 1

Views

Author

Keywords

Comments

A permutation of the natural numbers. - Robert G. Wilson v, Feb 22 2005
Fixed points: A029747. - Reinhard Zumkeller, Aug 23 2006
The even bisection, when halved, gives the sequence back. - Antti Karttunen, Jun 28 2014
From Antti Karttunen, Dec 21 2014: (Start)
This irregular table can be represented as a binary tree. Each child to the left is obtained by applying A003961 to the parent, and each child to the right is obtained by doubling the parent:
1
|
...................2...................
3 4
5......../ \........6 9......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 10 15 12 25 18 27 16
11 14 21 20 35 30 45 24 49 50 75 36 125 54 81 32
etc.
Sequence A163511 is obtained by scanning the same tree level by level, from right to left. Also in binary trees A253563 and A253565 the terms on level of the tree are some permutation of the terms present on the level n of this tree. A252464(n) gives the distance of n from 1 in all these trees.
A252737(n) gives the sum and A252738(n) the product of terms on row n (where 1 is on row 0, 2 on row 1, 3 and 4 on row 2, etc.). A252745(n) gives the number of nodes on level n whose left child is larger than the right child, A252750 the difference between left and right child for each node from node 2 onward.
(End)
-A008836(a(1+n)) gives the corresponding numerator for A323505(n). - Antti Karttunen, Jan 19 2019
(a(2n+1)-1)/2 [= A244154(n)-1, for n >= 0] is a permutation of the natural numbers. - George Beck and Antti Karttunen, Dec 08 2019
From Peter Munn, Oct 04 2020: (Start)
Each term has the same even part (equivalently, the same 2-adic valuation) as its index.
Using the tree depicted in Antti Karttunen's 2014 comment:
Numbers are on the right branch (4 and descendants) if and only if divisible by the square of their largest prime factor (cf. A070003).
Numbers on the left branch, together with 2, are listed in A102750.
(End)
According to Kutz (1981), he learned of this sequence from American mathematician Byron Leon McAllister (1929-2017) who attributed the invention of the sequence to a graduate student by the name of Doudna (first name Paul?) in the mid-1950's at the University of Wisconsin. - Amiram Eldar, Jun 17 2021
From David James Sycamore, Sep 23 2022: (Start)
Alternative (recursive) definition: If n is a power of 2 then a(n)=n. Otherwise, if 2^j is the greatest power of 2 not exceeding n, and if k = n - 2^j, then a(n) is the least m*a(k) that has not occurred previously, where m is an odd prime.
Example: Use recursion with n = 77 = 2^6 + 13. a(13) = 25 and since 11 is the smallest odd prime m such that m*a(13) has not already occurred (see a(27), a(29),a(45)), then a(77) = 11*25 = 275. (End)
The odd bisection, when transformed by replacing all prime(k)^e in a(2*n - 1) with prime(k-1)^e, returns a(n), and thus gives the sequence back. - David James Sycamore, Sep 28 2022

Examples

			From _N. J. A. Sloane_, Aug 22 2022: (Start)
Let c_i = number of 1's in binary expansion of n-1 that have i 0's to their right, and let p(j) = j-th prime.  Then a(n) = Product_i p(i+1)^c_i.
If n=9, n-1 is 1000, c_3 = 1, a(9) = p(4)^1 = 7.
If n=10, n-1 = 1001, c_0 = 1, c_2 = 1, a(10) = p(1)*p(3) = 2*5 = 10.
If n=11, n-1 = 1010, c_1 = 1, c_2 = 1, a(11) = p(2)*p(3) = 15. (End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A103969. Inverse is A005941 (A156552).
Cf. A125106. [From Franklin T. Adams-Watters, Mar 06 2010]
Cf. A252737 (gives row sums), A252738 (row products), A332979 (largest on row).
Related permutations of positive integers: A163511 (via A054429), A243353 (via A006068), A244154, A253563 (via A122111), A253565, A332977, A334866 (via A225546).
A000120, A003602, A003961, A006519, A053645, A070939, A246278, A250246, A252753, A253552 are used in a formula defining this sequence.
Formulas for f(a(n)) are given for f = A000265, A003963, A007949, A055396, A056239.
Numbers that occur at notable sets of positions in the binary tree representation of the sequence: A000040, A000079, A002110, A070003, A070826, A102750.
Cf. A106737, A290077, A323915, A324052, A324054, A324055, A324056, A324057, A324058, A324114, A324335, A324340, A324348, A324349 for various number-theoretical sequences applied to (i.e., permuted by) this sequence.
k-adic valuation: A007814 (k=2), A337821 (k=3).
Positions of multiples of 3: A091067.
Primorial deflation: A337376 / A337377.
Sum of prime indices of a(n) is A161511, reverse version A359043.
A048793 lists binary indices, ranked by A019565.
A066099 lists standard comps, partial sums A358134 (ranked by A358170).

Programs

  • Haskell
    a005940 n = f (n - 1) 1 1 where
       f 0 y _          = y
       f x y i | m == 0 = f x' y (i + 1)
               | m == 1 = f x' (y * a000040 i) i
               where (x',m) = divMod x 2
    -- Reinhard Zumkeller, Oct 03 2012
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library)
    (define (A005940 n) (A005940off0 (- n 1))) ;; The off=1 version, utilizing any one of three different offset-0 implementations:
    (definec (A005940off0 n) (cond ((< n 2) (+ 1 n)) (else (* (A000040 (- (A070939 n) (- (A000120 n) 1))) (A005940off0 (A053645 n))))))
    (definec (A005940off0 n) (cond ((<= n 2) (+ 1 n)) ((even? n) (A003961 (A005940off0 (/ n 2)))) (else (* 2 (A005940off0 (/ (- n 1) 2))))))
    (define (A005940off0 n) (let loop ((n n) (i 1) (x 1)) (cond ((zero? n) x) ((even? n) (loop (/ n 2) (+ i 1) x)) (else (loop (/ (- n 1) 2) i (* x (A000040 i)))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Maple
    f := proc(n,i,x) option remember ; if n = 0 then x; elif type(n,'even') then procname(n/2,i+1,x) ; else procname((n-1)/2,i,x*ithprime(i)) ; end if; end proc:
    A005940 := proc(n) f(n-1,1,1) ; end proc: # R. J. Mathar, Mar 06 2010
  • Mathematica
    f[n_] := Block[{p = Partition[ Split[ Join[ IntegerDigits[n - 1, 2], {2}]], 2]}, Times @@ Flatten[ Table[q = Take[p, -i]; Prime[ Count[ Flatten[q], 0] + 1]^q[[1, 1]], {i, Length[p]}] ]]; Table[ f[n], {n, 67}] (* Robert G. Wilson v, Feb 22 2005 *)
    Table[Times@@Prime/@(Join@@Position[Reverse[IntegerDigits[n,2]],1]-Range[DigitCount[n,2,1]]+1),{n,0,100}] (* Gus Wiseman, Dec 28 2022 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, n%2 && (t*=p) || p=nextprime(p+1)); t } \\ M. F. Hasler, Mar 07 2010; update Aug 29 2014
    
  • PARI
    a(n)=my(p=2, t=1); for(i=0,exponent(n), if(bittest(n,i), t*=p, p=nextprime(p+1))); t \\ Charles R Greathouse IV, Nov 11 2021
    
  • Python
    from sympy import prime
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    print([b(n - 1) for n in range(1, 101)]) # Indranil Ghosh, Apr 10 2017
    
  • Python
    from math import prod
    from itertools import accumulate
    from collections import Counter
    from sympy import prime
    def A005940(n): return prod(prime(len(a)+1)**b for a, b in Counter(accumulate(bin(n-1)[2:].split('1')[:0:-1])).items()) # Chai Wah Wu, Mar 10 2023

Formula

From Reinhard Zumkeller, Aug 23 2006, R. J. Mathar, Mar 06 2010: (Start)
a(n) = f(n-1, 1, 1)
where f(n, i, x) = x if n = 0,
= f(n/2, i+1, x) if n > 0 is even
= f((n-1)/2, i, x*prime(i)) otherwise. (End)
From Antti Karttunen, Jun 26 2014: (Start)
Define a starting-offset 0 version of this sequence as:
b(0)=1, b(1)=2, [base cases]
and then compute the rest either with recurrence:
b(n) = A000040(1+(A070939(n)-A000120(n))) * b(A053645(n)).
or
b(2n) = A003961(b(n)), b(2n+1) = 2 * b(n). [Compare this to the similar recurrence given for A163511.]
Then define a(n) = b(n-1), where a(n) gives this sequence A005940 with the starting offset 1.
Can be also defined as a composition of related permutations:
a(n+1) = A243353(A006068(n)).
a(n+1) = A163511(A054429(n)). [Compare the scatter plots of this sequence and A163511 to each other.]
This permutation also maps between the partitions as enumerated in the lists A125106 and A112798, providing identities between:
A161511(n) = A056239(a(n+1)). [The corresponding sums ...]
A243499(n) = A003963(a(n+1)). [... and the products of parts of those partitions.]
(End)
From Antti Karttunen, Dec 21 2014 - Jan 04 2015: (Start)
A002110(n) = a(1+A002450(n)). [Primorials occur at (4^n - 1)/3 in the offset-0 version of the sequence.]
a(n) = A250246(A252753(n-1)).
a(n) = A122111(A253563(n-1)).
For n >= 1, A055396(a(n+1)) = A001511(n).
For n >= 2, a(n) = A246278(1+A253552(n)).
(End)
From Peter Munn, Oct 04 2020: (Start)
A000265(a(n)) = a(A000265(n)) = A003961(a(A003602(n))).
A006519(a(n)) = a(A006519(n)) = A006519(n).
a(n) = A003961(a(A003602(n))) * A006519(n).
A007814(a(n)) = A007814(n).
A007949(a(n)) = A337821(n) = A007814(A003602(n)).
a(n) = A225546(A334866(n-1)).
(End)
a(2n) = 2*a(n), or generally a(2^k*n) = 2^k*a(n). - Amiram Eldar, Oct 03 2022
If n-1 = Sum_{i} 2^(q_i-1), then a(n) = Product_{i} prime(q_i-i+1). These are the Heinz numbers of the rows of A125106. If the offset is changed to 0, the inverse is A156552. - Gus Wiseman, Dec 28 2022

Extensions

More terms from Robert G. Wilson v, Feb 22 2005
Sign in a formula switched and Maple program added by R. J. Mathar, Mar 06 2010
Binary tree illustration and keyword tabf added by Antti Karttunen, Dec 21 2014

A243071 Permutation of nonnegative integers: a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).

Original entry on oeis.org

0, 1, 3, 2, 7, 6, 15, 4, 5, 14, 31, 12, 63, 30, 13, 8, 127, 10, 255, 28, 29, 62, 511, 24, 11, 126, 9, 60, 1023, 26, 2047, 16, 61, 254, 27, 20, 4095, 510, 125, 56, 8191, 58, 16383, 124, 25, 1022, 32767, 48, 23, 22, 253, 252, 65535, 18, 59, 120, 509, 2046, 131071
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2014

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
See also the comments at A163511, which is the inverse permutation to this one.

Crossrefs

Inverse: A163511.
Cf. A000040, A000225, A007814, A054429, A064989, A064216, A122111, A209229, A245611 (= (a(2n-1)-1)/2, for n > 1), A245612, A292383, A292385, A297171 (Möbius transform).
Cf. A007283 (known positions where a(n)=n), A364256 [= gcd(n,a(n))], A364288 [= n-a(n)], A364289 [where a(n)>=n], A364290 [where a(n)A364291 [where a(n)<=n], A364497 [where n|a(n)].
Cf. A156552 (variant with inverted binary code), A253566, A332215, A332811, A334859 (other variants).

Programs

  • PARI
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A243071(n) = if(n<=2, n-1, if(!(n%2), 2*A243071(n/2), 1+(2*A243071(A064989(n))))); \\ Antti Karttunen, Jul 18 2020
    
  • PARI
    A243071(n) = if(n<=2, n-1, my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p*p2*(2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); ((3<<#binary(res\2))-res-1)); \\ (Combining programs given in A156552 and A054429) - Antti Karttunen, Jul 28 2023
    
  • Python
    from functools import reduce
    from sympy import factorint, prevprime
    from operator import mul
    def a064989(n):
        f = factorint(n)
        return 1 if n==1 else reduce(mul, (1 if i==2 else prevprime(i)**f[i] for i in f))
    def a(n): return n - 1 if n<3 else 2*a(n//2) if n%2==0 else 1 + 2*a(a064989(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 15 2017
  • Scheme
    ;; With memoizing definec-macro from Antti Karttunen's IntSeq-library.
    (definec (A243071 n) (cond ((<= n 2) (- n 1)) ((even? n) (* 2 (A243071 (/ n 2)))) (else (+ 1 (* 2 (A243071 (A064989 n)))))))
    

Formula

a(1) = 0, a(2) = 1, a(2n) = 2*a(n), a(2n+1) = 1 + 2*a(A064989(2n+1)).
For n >= 1, a(A000040(n)) = A000225(n).
For n >= 1, a(2n+1) = 1 + 2*a(A064216(n+1)).
From Antti Karttunen, Jul 18 2020: (Start)
a(n) = A245611(A048673(n)).
a(n) = A253566(A122111(n)).
a(n) = A334859(A225546(n)).
For n >= 2, a(n) = A054429(A156552(n)).
a(n) = A292383(n) + A292385(n) = A292383(n) OR A292385(n).
For n > 1, A007814(a(n)) = A007814(n) - A209229(n). [This map preserves the 2-adic valuation of n, except when n is a power of two, in which cases it is decremented by one.]
(End)

A253565 Permutation of natural numbers: a(0) = 1, a(1) = 2; after which, a(2n) = A253550(a(n)), a(2n+1) = A253560(a(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 6, 8, 7, 25, 15, 27, 10, 18, 12, 16, 11, 49, 35, 125, 21, 75, 45, 81, 14, 50, 30, 54, 20, 36, 24, 32, 13, 121, 77, 343, 55, 245, 175, 625, 33, 147, 105, 375, 63, 225, 135, 243, 22, 98, 70, 250, 42, 150, 90, 162, 28, 100, 60, 108, 40, 72, 48, 64, 17, 169, 143, 1331, 91, 847, 539, 2401, 65, 605, 385, 1715, 275, 1225, 875, 3125, 39
Offset: 0

Views

Author

Antti Karttunen, Jan 03 2015

Keywords

Comments

This sequence can be represented as a binary tree. Each child to the left is obtained by applying A253550 to the parent, and each child to the right is obtained by applying A253560 to the parent:
1
|
...................2...................
3 4
5......../ \........9 6......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 25 15 27 10 18 12 16
11 49 35 125 21 75 45 81 14 50 30 54 20 36 24 32
etc.
Sequence A253563 is the mirror image of the same tree. Also in binary trees A005940 and A163511 the terms on level of the tree are some permutation of the terms present on the level n of this tree. A252464(n) gives the distance of n from 1 in all these trees. Of these four trees, this is the one where the left child is always smaller than the right child.
Note that the indexing of sequence starts from 0, although its range starts from one.
The term a(n) is the Heinz number of the adjusted partial sums of the n-th composition in standard order, where (1) 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, (2) the Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), and (3) we define the adjusted partial sums of a composition to be obtained by subtracting one from all parts, taking partial sums, and adding one back to all parts. See formula for a simplification. A triangular form is A242628. The inverse is A253566. The non-adjusted version is A358170. - Gus Wiseman, Dec 17 2022

Examples

			From _Gus Wiseman_, Dec 23 2022: (Start)
This represents the following bijection between compositions and partitions. The n-th composition in standard order together with the reversed prime indices of a(n) are:
   0:        () -> ()
   1:       (1) -> (1)
   2:       (2) -> (2)
   3:     (1,1) -> (1,1)
   4:       (3) -> (3)
   5:     (2,1) -> (2,2)
   6:     (1,2) -> (2,1)
   7:   (1,1,1) -> (1,1,1)
   8:       (4) -> (4)
   9:     (3,1) -> (3,3)
  10:     (2,2) -> (3,2)
  11:   (2,1,1) -> (2,2,2)
  12:     (1,3) -> (3,1)
  13:   (1,2,1) -> (2,2,1)
  14:   (1,1,2) -> (2,1,1)
  15: (1,1,1,1) -> (1,1,1,1)
(End)
		

Crossrefs

Inverse: A253566.
Cf. A252737 (row sums), A252738 (row products).
Applying A001222 gives A000120.
A reverse version is A005940.
These are the Heinz numbers of the rows of A242628.
Sum of prime indices of a(n) is A359043, reverse A161511.
A048793 gives partial sums of reversed standard comps, Heinz number A019565.
A066099 lists standard compositions.
A112798 list prime indices, sum A056239.
A358134 gives partial sums of standard compositions, Heinz number A358170.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Times@@Prime/@#&/@Table[Accumulate[stc[n]-1]+1,{n,0,60}] (* Gus Wiseman, Dec 17 2022 *)

Formula

a(0) = 1, a(1) = 2; after which, a(2n) = A253550(a(n)), a(2n+1) = A253560(a(n)).
As a composition of related permutations:
a(n) = A122111(A163511(n)).
a(n) = A253563(A054429(n)).
Other identities and observations. For all n >= 0:
a(2n+1) - a(2n) > 0. [See the comment above.]
If n = 2^(x_1)+...+2^(x_k) then a(n) = Product_{i=1..k} prime(x_k-x_{i-1}-k+i) where x_0 = 0. - Gus Wiseman, Dec 23 2022

A242628 Irregular table enumerating partitions; n-th row has partitions in previous row with each part incremented, followed by partitions in previous row with an additional part of size 1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This can be calculated using the binary expansion of n; see the PARI program.
The n-th row consists of all partitions with hook size (maximum + number of parts - 1) equal to n.
The partitions in row n of this sequence are the conjugates of the partitions in row n of A125106 taken in reverse order.
Row n is also the reversed partial sums plus one of the n-th composition in standard order (A066099) minus one. - Gus Wiseman, Nov 07 2022

Examples

			The table starts:
  1;
  2; 1,1;
  3; 2,2; 2,1; 1,1,1;
  4; 3,3; 3,2; 2,2,2; 3,1 2,2,1 2,1,1 1,1,1,1;
  ...
		

Crossrefs

Cf. A241596 (another version of this list of partitions), A125106, A240837, A112531, A241597 (compositions).
For other schemes to list integer partitions, please see for example A227739, A112798, A241918, A114994.
First element in each row is A008687.
Last element in each row is A065120.
Heinz numbers of rows are A253565.
Another version is A358134.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [[1]],
          [map(x-> map(y-> y+1, x), b(n-1))[],
           map(x-> [x[], 1], b(n-1))[]])
        end:
    T:= n-> map(x-> x[], b(n))[]:
    seq(T(n), n=1..7);  # Alois P. Heinz, Sep 25 2015
  • Mathematica
    T[1] = {{1}};
    T[n_] := T[n] = Join[T[n-1]+1, Append[#, 1]& /@ T[n-1]];
    Array[T, 7] // Flatten (* Jean-François Alcover, Jan 25 2021 *)
  • PARI
    apart(n) = local(r=[1]); while(n>1,if(n%2==0,for(k=1,#r,r[k]++),r=concat(r,[1]));n\=2);r \\ Generates n-th partition.

A359042 Sum of partial sums of the n-th composition in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 20 2022

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.

Examples

			The 29th composition in standard order is (1,1,2,1), with partial sums (1,2,4,5), with sum 12, so a(29) = 12.
		

Crossrefs

See link for sequences related to standard compositions.
Each n appears A000009(n) times.
The reverse version is A029931.
Comps counted by this statistic are A053632, ptns A264034, rev ptns A358194.
This is the sum of partial sums of rows of A066099.
The version for Heinz numbers of partitions is A318283, row sums of A358136.
Row sums of A358134.
A011782 counts compositions.
A065120 gives first part of standard compositions, last A001511.
A242628 lists adjusted partial sums, ranked by A253565, row sums A359043.
A358135 gives last minus first of standard compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total[Accumulate[stc[n]]],{n,0,100}]

A359043 Sum of adjusted partial sums of the n-th composition in standard order (A066099). Row sums of A242628.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Dec 21 2022

Keywords

Comments

We define the adjusted partial sums of a composition to be obtained by subtracting one from all parts, taking partial sums, and adding one back to all parts.
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.

Examples

			The 29th composition in standard order is (1,1,2,1), with adjusted partial sums (1,1,2,2), with sum 6, so a(29) = 6.
		

Crossrefs

See link for sequences related to standard compositions.
The unadjusted reverse version is A029931, row sums of A048793.
The reverse version is A161511, row sums of A125106.
Row sums of A242628, ranked by A253565.
The unadjusted version is A359042, row sums of A358134.
A011782 counts compositions.
A066099 lists standard compositions.
A358135 gives last minus first of standard compositions.
A358194 counts partitions by sum and weighted sum.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total[Accumulate[stc[n]-1]+1],{n,0,100}]

A358134 Triangle read by rows whose n-th row lists the partial sums of the n-th composition in standard order (row n of A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 31 2022

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.

Examples

			Triangle begins:
  1
  2
  1 2
  3
  2 3
  1 3
  1 2 3
  4
  3 4
  2 4
  2 3 4
  1 4
  1 3 4
  1 2 4
  1 2 3 4
		

Crossrefs

See link for sequences related to standard compositions.
First element in each row is A065120.
Rows are the partial sums of rows of A066099.
Last element in each row is A070939.
An adjusted version is A242628, ranked by A253565.
The first differences instead of partial sums are A358133.
The version for Heinz numbers of partitions is A358136, ranked by A358137.
Row sums are A359042.
A011782 counts compositions.
A351014 counts distinct runs in standard compositions.
A358135 gives last minus first of standard compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Join@@Table[Accumulate[stc[n]],{n,100}]

A336120 a(n) = A292383(A122111(n)).

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 2, 0, 4, 0, 4, 0, 8, 0, 5, 0, 5, 0, 8, 0, 16, 0, 10, 1, 32, 0, 16, 0, 10, 0, 11, 0, 64, 2, 8, 0, 128, 0, 20, 0, 20, 0, 32, 0, 256, 0, 22, 0, 8, 0, 64, 0, 11, 4, 40, 0, 512, 0, 16, 0, 1024, 0, 22, 8, 40, 0, 128, 0, 16, 0, 20, 0, 2048, 1, 256, 0, 80, 0, 44, 0, 4096, 0, 32, 16, 8192, 0, 80, 0, 22, 0, 512, 0, 16384, 32, 44, 0, 17, 0, 17, 0
Offset: 1

Views

Author

Antti Karttunen, Jul 14 2020

Keywords

Crossrefs

Programs

  • PARI
    \\ Uses also code given in A336124:
    A253553(n) = if(n<=2,1,my(f=factor(n), k=#f~); if(f[k,2]>1,f[k,2]--,f[k,1] = precprime(f[k,1]-1)); factorback(f));
    A336120(n) = if(1==n,0,(3==A336124(n))+(2*A336120(A253553(n))));

Formula

a(1) = 0, and for n > 1, a(n) = [A122111(n) == 3 (mod 4)] + 2*a(A253553(n)).
a(n) = A292383(A122111(n)).
a(n) = A253566(n) - A336125(n).
A000120(a(n)) = A336121(n).

A336125 a(n) = A292385(A122111(n)).

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 8, 5, 5, 8, 16, 10, 32, 16, 10, 10, 64, 8, 128, 20, 20, 32, 256, 20, 8, 64, 11, 40, 512, 16, 1024, 20, 40, 128, 16, 21, 2048, 256, 80, 40, 4096, 32, 8192, 80, 22, 512, 16384, 40, 17, 17, 160, 160, 32768, 16, 32, 80, 320, 1024, 65536, 42, 131072, 2048, 44, 41, 64, 64, 262144, 320, 640, 34, 524288, 41, 1048576, 4096, 20
Offset: 1

Views

Author

Antti Karttunen, Jul 17 2020

Keywords

Crossrefs

Programs

Formula

a(1) = 0, a(2) = 1, and for n > 2, a(n) = [A122111(n) == 1 (mod 4)] + 2*a(A253553(n)).
a(n) = A292385(A122111(n)).
a(n) = A253566(n) - A336120(n).
A000120(a(n)) = A336123(n).

A358133 Triangle read by rows whose n-th row lists the first differences of the n-th composition in standard order (row n of A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 31 2022

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.

Examples

			Triangle begins (dots indicate empty rows):
   1:   .
   2:   .
   3:   0
   4:   .
   5:  -1
   6:   1
   7:   0  0
   8:   .
   9:  -2
  10:   0
  11:  -1  0
  12:   2
  13:   1 -1
  14:   0  1
  15:   0  0  0
		

Crossrefs

See link for sequences related to standard compositions.
First differences of rows of A066099.
The version for Heinz numbers of partitions is A355536, ranked by A253566.
The partial sums instead of first differences are A358134.
Row sums are A358135.
A011782 counts compositions.
A351014 counts distinct runs in standard compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Differences[stc[n]],{n,100}]
Showing 1-10 of 15 results. Next