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

A225620 Indices of partitions in the table of compositions of A228351.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 40, 42, 48, 52, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 100, 104, 106, 112, 116, 120, 122, 124, 126, 127, 128, 136, 144, 160, 164, 168, 170, 192, 200, 208, 212, 224, 228, 232, 234, 240, 244, 248, 250, 252, 254, 255
Offset: 1

Views

Author

Omar E. Pol, Aug 03 2013

Keywords

Comments

Also triangle read by rows in which T(n,k) is the decimal representation of a binary number whose mirror represents the k-th partition of n according with the list of juxtaposed reverse-lexicographically ordered partitions of the positive integers (A026792).
In order to construct this sequence as a triangle we use the following rules:
- In the list of A026792 we replace each part of size j of the k-th partition of n by concatenation of j - 1 zeros and only one 1.
- Then replace this new set of parts by the concatenation of its parts.
- Then replace this string by its mirror version which is a binary number.
T(n,k) is the decimal value of this binary number, which represents the k-th partition of n (see example).
The partitions of n are represented by a subsequence with A000041(n) integers starting with 2^(n-1) and ending with 2^n - 1, n >= 1. The odd numbers of the sequence are in A000225.
First differs from A065609 at a(23).
Conjecture: this sequence is a sorted version of b(n) where b(2^k) = 2^k for k >= 0, b(n) = A080100(n)*(2*b(A053645(n)) + 1) otherwise. - Mikhail Kurkov, Oct 21 2023

Examples

			T(6,8) = 58 because 58 in base 2 is 111010 whose mirror is 010111 which is the concatenation of 01, 01, 1, 1, whose number of digits are 2, 2, 1, 1, which are also the 8th partition of 6.
Illustration of initial terms:
The sequence represents a table of partitions (see below):
--------------------------------------------------------
.            Binary                        Partitions
n  k  T(n,k) number  Mirror   Diagram       (A026792)
.                                          1 2 3 4 5 6
--------------------------------------------------------
.                             _
1  1     1       1    1        |           1,
.                             _ _
1  1     2      10    01      _  |           2,
2  2     3      11    11       | |         1,1,
.                             _ _ _
3  1     4     100    001     _ _  |           3,
3  2     6     110    011     _  | |         2,1,
3  3     7     111    111      | | |       1,1,1,
.                             _ _ _ _
4  1     8    1000    0001    _ _    |           4,
4  2    10    1010    0101    _ _|_  |         2,2,
4  3    12    1100    0011    _ _  | |         3,1,
4  4    14    1110    0111    _  | | |       2,1,1,
4  5    15    1111    1111     | | | |     1,1,1,1,
.                             _ _ _ _ _
5  1    16   10000    00001   _ _ _    |           5,
5  2    20   10100    00101   _ _ _|_  |         3,2,
5  3    24   11000    00011   _ _    | |         4,1,
5  4    26   11010    01011   _ _|_  | |       2,2,1,
5  5    28   11100    00111   _ _  | | |       3,1,1,
5  6    30   11110    01111   _  | | | |     2,1,1,1,
5  7    31   11111    11111    | | | | |   1,1,1,1,1,
.                             _ _ _ _ _ _
6  1    32  100000    000001  _ _ _      |           6
6  2    36  100100    001001  _ _ _|_    |         3,3,
6  3    40  101000    000101  _ _    |   |         4,2,
6  4    42  101010    010101  _ _|_ _|_  |       2,2,2,
6  5    48  110000    000011  _ _ _    | |         5,1,
6  6    52  110100    001011  _ _ _|_  | |       3,2,1,
6  7    56  111000    000111  _ _    | | |       4,1,1,
6  8    58  111010    010111  _ _|_  | | |     2,2,1,1,
6  9    60  111100    001111  _ _  | | | |     3,1,1,1,
6  10   62  111110    011111  _  | | | | |   2,1,1,1,1,
6  11   63  111111    111111   | | | | | | 1,1,1,1,1,1,
.
Triangle begins:
  1;
  2,   3;
  4,   6,  7;
  8,  10, 12, 14, 15;
  16, 20, 24, 26, 28, 30, 31;
  32, 36, 40, 42, 48, 52, 56, 58, 60, 62, 63;
  ...
From _Gus Wiseman_, Apr 01 2020: (Start)
Using the encoding of A066099, this sequence ranks all finite nonempty multisets, as follows.
   1: {1}
   2: {2}
   3: {1,1}
   4: {3}
   6: {1,2}
   7: {1,1,1}
   8: {4}
  10: {2,2}
  12: {1,3}
  14: {1,1,2}
  15: {1,1,1,1}
  16: {5}
  20: {2,3}
  24: {1,4}
  26: {1,2,2}
  28: {1,1,3}
  30: {1,1,1,2}
  31: {1,1,1,1,1}
(End)
		

Crossrefs

Column 1 is A000079. Row n has length A000041(n). Right border gives A000225.
The case covering an initial interval is A333379 or A333380.
All of the following pertain to compositions in the order of A066099.
- The weakly increasing version is this sequence.
- The weakly decreasing version is A114994.
- The strictly increasing version is A333255.
- The strictly decreasing version is A333256.
- The unequal version is A233564.
- The equal version is A272919.
- The case covering an initial interval is A333217.
- Initial intervals are ranked by A164894.
- Reversed initial intervals are ranked by A246534.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],LessEqual@@stc[#]&] (* Gus Wiseman, Apr 01 2020 *)

Formula

Conjecture: a(A000070(m) - k) = 2^m - A228354(k) for m > 0, 0 < k <= A000041(m). - Mikhail Kurkov, Oct 20 2023

A344618 Reverse-alternating sums of standard compositions (A066099). Alternating sums of the compositions ranked by A228351.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 03 2021

Keywords

Comments

Up to sign, same as A124754.
The reverse-alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i.
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 sequence of nonnegative integers together with the corresponding standard compositions and their reverse-alternating sums begins:
  0:     () ->  0    15: (1111) ->  0    30:  (1112) ->  1
  1:    (1) ->  1    16:    (5) ->  5    31: (11111) ->  1
  2:    (2) ->  2    17:   (41) -> -3    32:     (6) ->  6
  3:   (11) ->  0    18:   (32) -> -1    33:    (51) -> -4
  4:    (3) ->  3    19:  (311) ->  3    34:    (42) -> -2
  5:   (21) -> -1    20:   (23) ->  1    35:   (411) ->  4
  6:   (12) ->  1    21:  (221) ->  1    36:    (33) ->  0
  7:  (111) ->  1    22:  (212) ->  3    37:   (321) ->  2
  8:    (4) ->  4    23: (2111) -> -1    38:   (312) ->  4
  9:   (31) -> -2    24:   (14) ->  3    39:  (3111) -> -2
  10:  (22) ->  0    25:  (131) -> -1    40:    (24) ->  2
  11: (211) ->  2    26:  (122) ->  1    41:   (231) ->  0
  12:  (13) ->  2    27: (1211) ->  1    42:   (222) ->  2
  13: (121) ->  0    28:  (113) ->  3    43:  (2211) ->  0
  14: (112) ->  2    29: (1121) -> -1    44:   (213) ->  4
Triangle begins (row lengths A011782):
  0
  1
  2  0
  3 -1  1  1
  4 -2  0  2  2  0  2  0
  5 -3 -1  3  1  1  3 -1  3 -1  1  1  3 -1  1  1
		

Crossrefs

Up to sign, same as the reverse version A124754.
The version for Heinz numbers of partitions is A344616.
Positions of zeros are A344619.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 is the alternating sum of the prime indices of n (reverse: A344616).
A116406 counts compositions with alternating sum >= 0.
A344610 counts partitions by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.
All of the following pertain to compositions in standard order:
- The length is A000120.
- Converting to reversed ranking gives A059893.
- The rows are A066099.
- The sum is A070939.
- The runs are counted by A124767.
- The reversed version is A228351.
- Strict compositions are ranked by A233564.
- Constant compositions are ranked by A272919.
- The Heinz number is A333219.
- Anti-run compositions are ranked by A333489.

Programs

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

A375296 Numbers k such that the leaders of maximal weakly increasing runs in the reverse of the k-th composition in standard order (row k of A228351) are not strictly decreasing.

Original entry on oeis.org

13, 25, 27, 29, 41, 45, 49, 51, 53, 54, 55, 57, 59, 61, 77, 81, 82, 83, 89, 91, 93, 97, 99, 101, 102, 103, 105, 107, 108, 109, 110, 111, 113, 115, 117, 118, 119, 121, 123, 125, 141, 145, 153, 155, 157, 161, 162, 163, 165, 166, 167, 169, 173, 177, 179, 181, 182
Offset: 1

Views

Author

Gus Wiseman, Aug 13 2024

Keywords

Comments

The leaders of maximal weakly increasing runs in a sequence are obtained by splitting it into maximal weakly increasing subsequences and taking the first term of each.
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.
Also numbers k such that the k-th composition in standard order (row k of A066099) matches the dashed patterns 23-1 or 12-1.

Examples

			The sequence together with corresponding compositions begins:
  13: (1,2,1)
  25: (1,3,1)
  27: (1,2,1,1)
  29: (1,1,2,1)
  41: (2,3,1)
  45: (2,1,2,1)
  49: (1,4,1)
  51: (1,3,1,1)
  53: (1,2,2,1)
  54: (1,2,1,2)
  55: (1,2,1,1,1)
  57: (1,1,3,1)
  59: (1,1,2,1,1)
  61: (1,1,1,2,1)
		

Crossrefs

For leaders of identical runs we have A335486, reverse A335485.
Matching 1-32 only gives A375138, reverse A375137, both counted by A374636.
Compositions of this type are counted by A375140, complement A188920.
The reverse version is A375295.
A003242 counts anti-runs, ranks A333489.
A011782 counts compositions.
A238130, A238279, A333755 count compositions by number of runs.
A274174 counts contiguous compositions, ranks A374249.
A374637 counts compositions by sum of leaders of weakly increasing runs.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Sum is A029837(n+1).
- Leader is A065120.
- Parts are listed by A066099, reverse A228351.
- Number of adjacent equal pairs is A124762, unequal A333382.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Run-length transform is A333627, sum A070939.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!Greater@@First/@Split[Reverse[stc[#]],LessEqual]&]
    - or -
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,300],MatchQ[stc[#],{_,y_,z_,_,x_,_}/;x<=y
    				

A066099 Triangle read by rows, in which row n lists the compositions of n in reverse lexicographic order.

Original entry on oeis.org

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

Views

Author

Alford Arnold, Dec 30 2001

Keywords

Comments

The representation of the compositions (for fixed n) is as lists of parts, the order between individual compositions (for the same n) is (list-)reversed lexicographic; see the example by Omar E. Pol. - Joerg Arndt, Sep 03 2013
This is the standard ordering for compositions in this database; it is similar to the Mathematica ordering for partitions (A080577). Other composition orderings include A124734 (similar to the Abramowitz & Stegun ordering for partitions, A036036), A108244 (similar to the Maple partition ordering, A080576), etc (see crossrefs).
Factorize each term in A057335; sequence records the values of the resulting exponents. It also runs through all possible permutations of multiset digits.
This can be regarded as a table in two ways: with each composition as a row, or with the compositions of each integer as a row. The first way has A000120 as row lengths and A070939 as row sums; the second has A001792 as row lengths and A001788 as row sums. - Franklin T. Adams-Watters, Nov 06 2006
This sequence includes every finite sequence of positive integers. - Franklin T. Adams-Watters, Nov 06 2006
Compositions (or ordered partitions) are also generated in sequence A101211. - Alford Arnold, Dec 12 2006
The equivalent sequence for partitions is A228531. - Omar E. Pol, Sep 03 2013
The sole partition of zero has no components, not a single component of length one. Hence the first nonempty row is row 1. - Franklin T. Adams-Watters, Apr 02 2014 [Edited by Andrey Zabolotskiy, May 19 2018]
See sequence A261300 for another version where the terms of each composition are concatenated to form one single integer: (0, 1, 2, 11, 3, 21, 12, 111,...). This also shows how the terms can be obtained from the binary numbers A007088, cf. Arnold's first Example. - M. F. Hasler, Aug 29 2015
The k-th composition in the list 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 is described as the standard ordering used in the OEIS, although the sister sequence A228351 is also sometimes considered to be canonical. Both sequences define a bijective correspondence between nonnegative integers and integer compositions. - Gus Wiseman, May 19 2020
First differences of A030303 = positions of bits 1 in the concatenation A030190 (= A030302) of numbers written in binary (A007088). - Indices of record values (= first occurrence of n) are given by A005183: a(A005183(n)) = n, cf. FORMULA for more. - M. F. Hasler, Oct 12 2020
The geometric mean approaches the Somos constant (A112302). - Jwalin Bhatt, Feb 10 2025

Examples

			A057335 begins 1 2 4 6 8 12 18 30 16 24 36 ... so we can write
  1 2 1 3 2 1 1 4 3 2 2 1 1 1 1 ...
  . . 1 . 1 2 1 . 1 2 1 3 2 1 1 ...
  . . . . . . 1 . . . 1 . 1 2 1 ...
  . . . . . . . . . . . . . . 1 ...
and the columns here gives the rows of the triangle, which begins
  1
  2; 1 1
  3; 2 1; 1 2; 1 1 1
  4; 3 1; 2 2; 2 1 1; 1 3; 1 2 1; 1 1 2; 1 1 1 1
  ...
From _Omar E. Pol_, Sep 03 2013: (Start)
Illustration of initial terms:
  -----------------------------------
  n  j       Diagram   Composition j
  -----------------------------------
  .               _
  1  1           |_|   1;
  .             _ _
  2  1         |  _|   2,
  2  2         |_|_|   1, 1;
  .           _ _ _
  3  1       |    _|   3,
  3  2       |  _|_|   2, 1,
  3  3       | |  _|   1, 2,
  3  4       |_|_|_|   1, 1, 1;
  .         _ _ _ _
  4  1     |      _|   4,
  4  2     |    _|_|   3, 1,
  4  3     |   |  _|   2, 2,
  4  4     |  _|_|_|   2, 1, 1,
  4  5     | |    _|   1, 3,
  4  6     | |  _|_|   1, 2, 1,
  4  7     | | |  _|   1, 1, 2,
  4  8     |_|_|_|_|   1, 1, 1, 1;
(End)
		

Crossrefs

Lists of compositions of integers: this sequence (reverse lexicographic order; minus one gives A108730), A228351 (reverse colexicographic order - every composition is reversed; minus one gives A163510), A228369 (lexicographic), A228525 (colexicographic), A124734 (length, then lexicographic; minus one gives A124735), A296774 (length, then reverse lexicographic), A337243 (length, then colexicographic), A337259 (length, then reverse colexicographic), A296773 (decreasing length, then lexicographic), A296772 (decreasing length, then reverse lexicographic), A337260 (decreasing length, then colexicographic), A108244 (decreasing length, then reverse colexicographic), also A101211 and A227736 (run lengths of bits).
Cf. row length and row sums for different splittings into rows: A000120, A070939, A001792, A001788.
Cf. lists of partitions of integers, or multisets of integers: A026791 and crosserfs therein, A112798 and crossrefs therein.
See link for additional crossrefs pertaining to standard compositions.
A related ranking of finite sets is A048793/A272020.

Programs

  • Haskell
    a066099 = (!!) a066099_list
    a066099_list = concat a066099_tabf
    a066099_tabf = map a066099_row [1..]
    a066099_row n = reverse $ a228351_row n
    -- (each composition as a row)
    -- Peter Kagey, Aug 25 2016
    
  • Mathematica
    Table[FactorInteger[Apply[Times, Map[Prime, Accumulate @ IntegerDigits[n, 2]]]][[All, -1]], {n, 41}] // Flatten (* Michael De Vlieger, Jul 11 2017 *)
    stc[n_] := Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]] // Reverse;
    Table[stc[n], {n, 0, 20}] // Flatten (* Gus Wiseman, May 19 2020 *)
    Table[Reverse @ LexicographicSort @ Flatten[Permutations /@ Partitions[n], 1], {n, 10}] // Flatten (* Eric W. Weisstein, Jun 26 2023 *)
  • PARI
    arow(n) = {local(v=vector(n),j=0,k=0);
       while(n>0,k++; if(n%2==1,v[j++]=k;k=0);n\=2);
       vector(j,i,v[j-i+1])} \\ returns empty for n=0. - Franklin T. Adams-Watters, Apr 02 2014
    
  • Python
    from itertools import islice
    from itertools import accumulate, count, groupby, islice
    def A066099_gen():
        for i in count(1):
            yield [len(list(g)) for _,g in groupby(accumulate(int(b) for b in bin(i)[2:]))]
    A066099 = list(islice(A066099_gen(), 120))  # Jwalin Bhatt, Feb 28 2025
  • Sage
    def a_row(n): return list(reversed(Compositions(n)))
    flatten([a_row(n) for n in range(1,6)]) # Peter Luschny, May 19 2018
    

Formula

From M. F. Hasler, Oct 12 2020: (Start)
a(n) = A030303(n+1) - A030303(n).
a(A005183(n)) = n; a(A005183(n)+1) = n-1 (n>1); a(A005183(n)+2) = 1. (End)

Extensions

Edited with additional terms by Franklin T. Adams-Watters, Nov 06 2006
0th row removed by Andrey Zabolotskiy, May 19 2018

A333489 Numbers k such that the k-th composition in standard order is an anti-run (no adjacent equal parts).

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 16, 17, 18, 20, 22, 24, 25, 32, 33, 34, 37, 38, 40, 41, 44, 45, 48, 49, 50, 52, 54, 64, 65, 66, 68, 69, 70, 72, 76, 77, 80, 81, 82, 88, 89, 96, 97, 98, 101, 102, 104, 105, 108, 109, 128, 129, 130, 132, 133, 134, 137, 140, 141
Offset: 1

Views

Author

Gus Wiseman, Mar 28 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.

Examples

			The sequence together with the corresponding compositions begins:
    0: ()          33: (5,1)         70: (4,1,2)
    1: (1)         34: (4,2)         72: (3,4)
    2: (2)         37: (3,2,1)       76: (3,1,3)
    4: (3)         38: (3,1,2)       77: (3,1,2,1)
    5: (2,1)       40: (2,4)         80: (2,5)
    6: (1,2)       41: (2,3,1)       81: (2,4,1)
    8: (4)         44: (2,1,3)       82: (2,3,2)
    9: (3,1)       45: (2,1,2,1)     88: (2,1,4)
   12: (1,3)       48: (1,5)         89: (2,1,3,1)
   13: (1,2,1)     49: (1,4,1)       96: (1,6)
   16: (5)         50: (1,3,2)       97: (1,5,1)
   17: (4,1)       52: (1,2,3)       98: (1,4,2)
   18: (3,2)       54: (1,2,1,2)    101: (1,3,2,1)
   20: (2,3)       64: (7)          102: (1,3,1,2)
   22: (2,1,2)     65: (6,1)        104: (1,2,4)
   24: (1,4)       66: (5,2)        105: (1,2,3,1)
   25: (1,3,1)     68: (4,3)        108: (1,2,1,3)
   32: (6)         69: (4,2,1)      109: (1,2,1,2,1)
		

Crossrefs

Anti-runs summing to n are counted by A003242(n).
A triangle counting maximal anti-runs of compositions is A106356.
A triangle counting maximal runs of compositions is A238279 or A238130.
Partitions whose first differences are an anti-run are A238424.
All of the following pertain to compositions in standard order (A066099):
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Strict compositions are ranked by A233564.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!MatchQ[stc[#],{_,x_,x_,_}]&]

A163511 a(0)=1. a(n) = p(A000120(n)) * Product_{m=1..A000120(n)} p(m)^A163510(n,m), where p(m) is the m-th prime.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Jul 29 2009

Keywords

Comments

This is a permutation of the positive integers.
From Antti Karttunen, Jun 20 2014: (Start)
Note the indexing: the domain starts from 0, while the range excludes zero, thus this is neither a bijection on the set of nonnegative integers nor on the set of positive natural numbers, but a bijection from the former set to the latter.
Apart from that discrepancy, this could be viewed as yet another "entanglement permutation" where the two complementary pairs to be interwoven together are even and odd numbers (A005843/A005408) which are entangled with the complementary pair even numbers (taken straight) and odd numbers in the order they appear in A003961: (A005843/A003961). See also A246375 which has almost the same recurrence.
Note how the even bisection halved gives the same sequence back. (For a(0)=1, take ceiling of 1/2).
(End)
From Antti Karttunen, Dec 30 2017: (Start)
This irregular table can be represented as a binary tree. Each child to the left is obtained by doubling the parent, and each child to the right is obtained by applying A003961 to the parent:
1
|
...................2...................
4 3
8......../ \........9 6......../ \........5
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
16 27 18 25 12 15 10 7
32 81 54 125 36 75 50 49 24 45 30 35 20 21 14 11
etc.
Sequence A005940 is obtained by scanning the same tree level by level in mirror image fashion. 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, and A252463 gives the parent of the node containing n.
A252737(n) gives the sum and A252738(n) the product of terms on row n (where 1 is on row 0, 1 on row 1, 3 and 4 on row 2, etc.). A252745(n) gives the number of nodes on level n whose left child is smaller than the right child, and A252744(n) is an indicator function for those nodes.
(End)
Note that the idea behind maps like this (and the mirror image A005940) admits also using alternative orderings of primes, not just standard magnitude-wise ordering (A000040). For example, A332214 is a similar sequence but with primes rearranged as in A332211, and A332817 is obtained when primes are rearranged as in A108546. - Antti Karttunen, Mar 11 2020
From Lorenzo Sauras Altuzarra, Nov 28 2020: (Start)
This sequence is generated from A228351 by applying the following procedure: 1) eliminate the compositions that end in one unless the first one, 2) subtract one unit from every component, 3) replace every tuple [t_1, ..., t_r] by Product_{k=1..r} A000040(k)^(t_k) (see the examples).
Is it true that a(n) = A337909(n+1) if and only if a(n+1) is not a term of A161992?
Does this permutation have any other cycle apart from (1), (2) and (6, 9, 16, 7)? (End)
From Antti Karttunen, Jul 25 2023: (Start)
(In the above question, it is assumed that the starting offset would be 1 instead of 0).
Questions:
Does a(n) = 1+A054429(n) hold only when n is of the form 2^k times 1, 3 or 7, i.e., one of the terms of A029748?
It seems that A007283 gives all fixed points of map n -> a(n), like A335431 seems to give all fixed points of map n -> A332214(n). Is there a general rule for mappings like these that the fixed points (if they exist) must be of the form 2^k times a certain kind of prime, i.e., that any odd composite (times 2^k) can certainly be excluded? See also note in A029747.
(End)
If the conjecture given in A364297 holds, then it implies the above conjecture about A007283. See also A364963. - Antti Karttunen, Sep 06 2023
Conjecture: a(n^k) is never of the form x^k, for any integers n > 0, k > 1, x >= 1. This holds at least for squares, cubes, seventh and eleventh powers (see A365808, A365801, A366287 and A366391). - Antti Karttunen, Sep 24 2023, Oct 10 2023.
See A365805 for why the above holds for any n^k, with k > 1. - Antti Karttunen, Nov 23 2023

Examples

			For n=3, whose binary representation is "11", we have A000120(3)=2, with A163510(3,1) = A163510(3,2) = 0, thus a(3) = p(2) * p(1)^0 * p(2)^0 = 3*1*1 = 3.
For n=9, "1001" in binary, we have A000120(9)=2, with A163510(9,1) = 0 and A163510(9,2) = 2, thus a(9) = p(2) * p(1)^0 * p(2)^2 = 3*1*9 = 27.
For n=10, "1010" in binary, we have A000120(10)=2, with A163510(10,1) = 1 and A163510(10,2) = 1, thus a(10) = p(2) * p(1)^1 * p(2)^1 = 3*2*3 = 18.
For n=15, "1111" in binary, we have A000120(15)=4, with A163510(15,1) = A163510(15,2) = A163510(15,3) = A163510(15,4) = 0, thus a(15) = p(4) * p(1)^0 * p(2)^0 * p(3)^0 * p(4)^0 = 7*1*1*1*1 = 7.
[1], [2], [1,1], [3], [1,2], [2,1] ... -> [1], [2], [3], [1,2], ... -> [0], [1], [2], [0,1], ... -> 2^0, 2^1, 2^2, 2^0*3^1, ... = 1, 2, 4, 3, ... - _Lorenzo Sauras Altuzarra_, Nov 28 2020
		

Crossrefs

Inverse: A243071.
Cf. A007283 (known positions where a(n)=n), A029747, A029748, A364255 [= gcd(n,a(n))], A364258 [= a(n)-n], A364287 (where a(n) < n), A364292 (where a(n) <= n), A364494 (where n|a(n)), A364496 (where a(n)|n), A364963, A364297.
Cf. A365808 (positions of squares), A365801 (of cubes), A365802 (of fifth powers), A365805 [= A052409(a(n))], A366287, A366391.
Cf. A005940, A332214, A332817, A366275 (variants).

Programs

  • Mathematica
    f[n_] := Reverse@ Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]]; {1}~Join~
    Table[Function[t, Prime[t] Product[Prime[m]^(f[n][[m]]), {m, t}]][DigitCount[n, 2, 1]], {n, 120}] (* Michael De Vlieger, Jul 25 2016 *)
  • Python
    from sympy import prime
    def A163511(n):
        if n:
            k, c, m = n, 0, 1
            while k:
                c += 1
                m *= prime(c)**(s:=(~k&k-1).bit_length())
                k >>= s+1
            return m*prime(c)
        return 1 # Chai Wah Wu, Jul 17 2023

Formula

For n >= 1, a(2n) is even, a(2n+1) is odd. a(2^k) = 2^(k+1), for all k >= 0.
From Antti Karttunen, Jun 20 2014: (Start)
a(0) = 1, a(1) = 2, a(2n) = 2*a(n), a(2n+1) = A003961(a(n)).
As a more general observation about the parity, we have:
For n >= 1, A007814(a(n)) = A135523(n) = A007814(n) + A209229(n). [This permutation preserves the 2-adic valuation of n, except when n is a power of two, in which cases that value is incremented by one.]
For n >= 1, A055396(a(n)) = A091090(n) = A007814(n+1) + 1 - A036987(n).
For n >= 1, a(A000225(n)) = A000040(n).
(End)
From Antti Karttunen, Oct 11 2014: (Start)
As a composition of related permutations:
a(n) = A005940(1+A054429(n)).
a(n) = A064216(A245612(n))
a(n) = A246681(A246378(n)).
Also, for all n >= 0, it holds that:
A161511(n) = A243503(a(n)).
A243499(n) = A243504(a(n)).
(End)
More linking identities from Antti Karttunen, Dec 30 2017: (Start)
A046523(a(n)) = A278531(n). [See also A286531.]
A278224(a(n)) = A285713(n). [Another filter-sequence.]
A048675(a(n)) = A135529(n) seems to hold for n >= 1.
A250245(a(n)) = A252755(n).
A252742(a(n)) = A252744(n).
A245611(a(n)) = A253891(n).
A249824(a(n)) = A275716(n).
A292263(a(n)) = A292264(n). [A292944(n) + A292264(n) = n.]
--
A292383(a(n)) = A292274(n).
A292385(a(n)) = A292271(n). [A292271(n) + A292274(n) = n.]
--
A292941(a(n)) = A292942(n).
A292943(a(n)) = A292944(n).
A292945(a(n)) = A292946(n). [A292942(n) + A292944(n) + A292946(n) = n.]
--
A292253(a(n)) = A292254(n).
A292255(a(n)) = A292256(n). [A292944(n) + A292254(n) + A292256(n) = n.]
--
A279339(a(n)) = A279342(n).
a(A071574(n)) = A269847(n).
a(A279341(n)) = A279338(n).
a(A252756(n)) = A250246(n).
(1+A008836(a(n)))/2 = A059448(n).
(End)
From Antti Karttunen, Jul 26 2023: (Start)
For all n >= 0, a(A007283(n)) = A007283(n).
A001222(a(n)) = A290251(n).
(End)

Extensions

More terms computed and examples added by Antti Karttunen, Jun 20 2014

A272919 Numbers of the form 2^(n-1)*(2^(n*m)-1)/(2^n-1), n >= 1, m >= 1.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 10, 15, 16, 31, 32, 36, 42, 63, 64, 127, 128, 136, 170, 255, 256, 292, 511, 512, 528, 682, 1023, 1024, 2047, 2048, 2080, 2184, 2340, 2730, 4095, 4096, 8191, 8192, 8256, 10922, 16383, 16384, 16912, 18724, 32767, 32768, 32896, 34952, 43690, 65535, 65536, 131071
Offset: 1

Views

Author

Ivan Neretin, May 10 2016

Keywords

Comments

In other words, numbers whose binary representation consists of one or more repeating blocks with only one 1 in each block.
Also, fixed points of the permutations A139706 and A139708.
Each a(n) is a term of A064896 multiplied by some power of 2. As such, this sequence must also be a subsequence of A125121.
Also the numbers that uniquely index a Haar graph (i.e., 5 and 6 are not in the sequence since H(5) is isomorphic to H(6)). - Eric W. Weisstein, Aug 19 2017
From Gus Wiseman, Apr 04 2020: (Start)
The k-th composition in standard order (row k of 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. This sequence lists all positive integers k such that the k-th composition in standard order is constant. For example, the sequence together with the corresponding constant compositions begins:
0: () 136: (4,4)
1: (1) 170: (2,2,2,2)
2: (2) 255: (1,1,1,1,1,1,1,1)
3: (1,1) 256: (9)
4: (3) 292: (3,3,3)
7: (1,1,1) 511: (1,1,1,1,1,1,1,1,1)
8: (4) 512: (10)
10: (2,2) 528: (5,5)
15: (1,1,1,1) 682: (2,2,2,2,2)
16: (5) 1023: (1,1,1,1,1,1,1,1,1,1)
31: (1,1,1,1,1) 1024: (11)
32: (6) 2047: (1,1,1,1,1,1,1,1,1,1,1)
36: (3,3) 2048: (12)
42: (2,2,2) 2080: (6,6)
63: (1,1,1,1,1,1) 2184: (4,4,4)
64: (7) 2340: (3,3,3,3)
127: (1,1,1,1,1,1,1) 2730: (2,2,2,2,2,2)
128: (8) 4095: (1,1,1,1,1,1,1,1,1,1,1,1)
(End)

Crossrefs

Cf. A137706 (smallest number indexing a new Haar graph).
Compositions in standard order are A066099.
Strict compositions are ranked by A233564.

Programs

  • Maple
    N:= 10^6: # to get all terms <= N
    R:= select(`<=`,{seq(seq(2^(n-1)*(2^(n*m)-1)/(2^n-1), m = 1 .. ilog2(2*N)/n), n = 1..ilog2(2*N))},N):
    sort(convert(R,list)); # Robert Israel, May 10 2016
  • Mathematica
    Flatten@Table[d = Reverse@Divisors[n]; 2^(d - 1)*(2^n - 1)/(2^d - 1), {n, 17}]

Formula

From Gus Wiseman, Apr 04 2020: (Start)
A333381(a(n)) = A027750(n).
For n > 0, A124767(a(n)) = 1.
If n is a power of two, A333628(a(n)) = 0, otherwise = 1.
A333627(a(n)) is a power of 2.
(End)

A124767 Number of level runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
For n > 0, a(n) is one more than the number of adjacent unequal terms in the n-th composition in standard order. Also the number of runs in the same composition. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the level runs are 2; 1,1; so a(11) = 2.
The table starts:
  0
  1
  1 1
  1 2 2 1
  1 2 1 2 2 3 2 1
  1 2 2 2 2 2 3 2 2 3 2 3 2 3 2 1
  1 2 2 2 1 3 3 2 2 3 1 2 3 4 3 2 2 3 3 3 3 3 4 3 2 3 2 3 2 3 2 1
The 1234567th composition in standard order is (3,2,1,2,2,1,2,5,1,1,1) with runs ((3),(2),(1),(2,2),(1),(2),(5),(1,1,1)), so a(1234567) = 8. - _Gus Wiseman_, Apr 08 2020
		

Crossrefs

Row-lengths are A011782.
Compositions counted by number of runs are A238279 or A333755.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767 (this sequence).
- Weakly increasing compositions are A225620.
- Strict compositions A233564.
- Constant compositions are A272919.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Run-lengths are A333769 (triangle).

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Split[stc[n]]],{n,0,100}] (* Gus Wiseman, Apr 17 2020 *)

Formula

a(0) = 0, a(n) = 1 + Sum_{1<=i=1 0.
For n > 0, a(n) = A333382(n) + 1. - Gus Wiseman, Apr 08 2020

A233564 c-squarefree numbers: positive integers which in binary are concatenation of distinct parts of the form 10...0 with nonnegative number of zeros.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 16, 17, 18, 20, 24, 32, 33, 34, 37, 38, 40, 41, 44, 48, 50, 52, 64, 65, 66, 68, 69, 70, 72, 80, 81, 88, 96, 98, 104, 128, 129, 130, 132, 133, 134, 137, 140, 144, 145, 152, 160, 161, 176, 192, 194, 196, 200, 208, 256, 257, 258, 260, 261
Offset: 1

Views

Author

Vladimir Shevelev, Dec 13 2013

Keywords

Comments

Number of terms in interval [2^(n-1), 2^n) is the number of compositions of n with distinct parts (cf. A032020). For example, if n=6, then interval [2^5, 2^6) contains 11 terms {32,...,52}. This corresponds to 11 compositions with distinct parts of 6: 6, 5+1, 1+5, 4+2, 2+4, 3+2+1, 3+1+2, 2+3+1, 2+1+3, 1+3+2, 1+2+3.
From Gus Wiseman, Apr 06 2020: (Start)
The k-th composition in standard order (row k of 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. This sequence lists all numbers k such that the k-th composition in standard order is strict. For example, the sequence together with the corresponding strict compositions begins:
0: () 38: (3,1,2) 98: (1,4,2)
1: (1) 40: (2,4) 104: (1,2,4)
2: (2) 41: (2,3,1) 128: (8)
4: (3) 44: (2,1,3) 129: (7,1)
5: (2,1) 48: (1,5) 130: (6,2)
6: (1,2) 50: (1,3,2) 132: (5,3)
8: (4) 52: (1,2,3) 133: (5,2,1)
9: (3,1) 64: (7) 134: (5,1,2)
12: (1,3) 65: (6,1) 137: (4,3,1)
16: (5) 66: (5,2) 140: (4,1,3)
17: (4,1) 68: (4,3) 144: (3,5)
18: (3,2) 69: (4,2,1) 145: (3,4,1)
20: (2,3) 70: (4,1,2) 152: (3,1,4)
24: (1,4) 72: (3,4) 160: (2,6)
32: (6) 80: (2,5) 161: (2,5,1)
33: (5,1) 81: (2,4,1) 176: (2,1,5)
34: (4,2) 88: (2,1,4) 192: (1,7)
37: (3,2,1) 96: (1,6) 194: (1,5,2)
(End)

Examples

			49 in binary has the following parts of the form 10...0 with nonnegative number of  zeros: (1),(1000),(1). Two of them are the same. So it is not in the sequence. On the other hand, 50 has distinct parts (1)(100)(10), thus it is a term.
		

Crossrefs

A subset of A333489 and superset of A333218.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Weighted sum is A029931.
- Partial sums from the right are A048793.
- Sum is A070939.
- Runs are counted by A124767.
- Reversed initial intervals A164894.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are counted by A333381.
- Anti-runs are A333489.

Programs

  • Mathematica
    bitPatt[n_]:=bitPatt[n]=Split[IntegerDigits[n,2],#1>#2||#2==0&];
    Select[Range[0,300],bitPatt[#]==DeleteDuplicates[bitPatt[#]]&] (* Peter J. C. Moses, Dec 13 2013 *)
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@stc[#]&] (* Gus Wiseman, Apr 04 2020 *)

Extensions

More terms from Peter J. C. Moses, Dec 13 2013
0 prepended by Gus Wiseman, Apr 04 2020

A333217 Numbers k such that the k-th composition in standard order covers an initial interval of positive integers.

Original entry on oeis.org

0, 1, 3, 5, 6, 7, 11, 13, 14, 15, 21, 22, 23, 26, 27, 29, 30, 31, 37, 38, 41, 43, 44, 45, 46, 47, 50, 52, 53, 54, 55, 58, 59, 61, 62, 63, 75, 77, 78, 83, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 101, 102, 105, 106, 107, 108, 109, 110, 111, 114, 116, 117, 118
Offset: 1

Views

Author

Gus Wiseman, Mar 15 2020

Keywords

Comments

The k-th composition in standard order (row k of 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.

Examples

			The sequence of terms together with the corresponding compositions begins:
    0: ()              37: (3,2,1)           75: (3,2,1,1)
    1: (1)             38: (3,1,2)           77: (3,1,2,1)
    3: (1,1)           41: (2,3,1)           78: (3,1,1,2)
    5: (2,1)           43: (2,2,1,1)         83: (2,3,1,1)
    6: (1,2)           44: (2,1,3)           85: (2,2,2,1)
    7: (1,1,1)         45: (2,1,2,1)         86: (2,2,1,2)
   11: (2,1,1)         46: (2,1,1,2)         87: (2,2,1,1,1)
   13: (1,2,1)         47: (2,1,1,1,1)       89: (2,1,3,1)
   14: (1,1,2)         50: (1,3,2)           90: (2,1,2,2)
   15: (1,1,1,1)       52: (1,2,3)           91: (2,1,2,1,1)
   21: (2,2,1)         53: (1,2,2,1)         92: (2,1,1,3)
   22: (2,1,2)         54: (1,2,1,2)         93: (2,1,1,2,1)
   23: (2,1,1,1)       55: (1,2,1,1,1)       94: (2,1,1,1,2)
   26: (1,2,2)         58: (1,1,2,2)         95: (2,1,1,1,1,1)
   27: (1,2,1,1)       59: (1,1,2,1,1)      101: (1,3,2,1)
   29: (1,1,2,1)       61: (1,1,1,2,1)      102: (1,3,1,2)
   30: (1,1,1,2)       62: (1,1,1,1,2)      105: (1,2,3,1)
   31: (1,1,1,1,1)     63: (1,1,1,1,1,1)    106: (1,2,2,2)
		

Crossrefs

Sequences covering an initial interval are counted by A000670.
Composition in standard order are A066099.
The case of strictly increasing initial intervals is A164894.
The case of strictly decreasing initial intervals is A246534.
The case of permutations is A333218.
The weakly increasing version is A333379.
The weakly decreasing version is A333380.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],normQ[stc[#]]&]
Showing 1-10 of 129 results. Next