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.

Previous Showing 41-47 of 47 results.

A345907 Triangle giving the main antidiagonals of the matrices counting integer compositions by length and alternating sum (A345197).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 0, 4, 3, 1, 1, 0, 0, 3, 6, 4, 1, 1, 0, 0, 6, 9, 8, 5, 1, 1, 0, 0, 0, 18, 18, 10, 6, 1, 1, 0, 0, 0, 10, 36, 30, 12, 7, 1, 1, 0, 0, 0, 20, 40, 60, 45, 14, 8, 1, 1, 0, 0, 0, 0, 80, 100, 90, 63, 16, 9, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. Here, the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
Problem: What are the column sums? They appear to match A239201, but it is not clear why.

Examples

			Triangle begins:
   1
   1   1
   0   1   1
   0   1   1   1
   0   2   2   1   1
   0   0   4   3   1   1
   0   0   3   6   4   1   1
   0   0   6   9   8   5   1   1
   0   0   0  18  18  10   6   1   1
   0   0   0  10  36  30  12   7   1   1
   0   0   0  20  40  60  45  14   8   1   1
   0   0   0   0  80 100  90  63  16   9   1   1
   0   0   0   0  35 200 200 126  84  18  10   1   1
   0   0   0   0  70 175 400 350 168 108  20  11   1   1
   0   0   0   0   0 350 525 700 560 216 135  22  12   1   1
		

Crossrefs

Row sums are A163493.
Rows are the antidiagonals of the matrices given by A345197.
The main diagonals of A345197 are A346632, with sums A345908.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{n-k}],k==(n+ats[#])/2-1&]],{k,0,n-1}],{n,0,15}]

A338252 Nonpositive values in A317050, in order of appearance and negated.

Original entry on oeis.org

0, 1, 2, 4, 3, 5, 6, 10, 9, 7, 8, 16, 15, 17, 18, 14, 13, 11, 12, 20, 19, 21, 22, 26, 25, 23, 24, 40, 39, 41, 42, 38, 37, 35, 36, 28, 27, 29, 30, 34, 33, 31, 32, 64, 63, 65, 66, 62, 61, 59, 60, 68, 67, 69, 70, 74, 73, 71, 72, 56, 55, 57, 58, 54, 53, 51, 52, 44
Offset: 0

Views

Author

Rémy Sigrist, Oct 18 2020

Keywords

Comments

This sequence is a permutation of the nonnegative integers, with inverse A338254 (the offset has been set to 0 so as to have a permutation).

Examples

			A338251 = 0, 1, -1, -2, 2, 3, 5, 4, -4, -3, -5, -6, -10, -9, -7, -8, ...
We keep:  0,     1,  2,              4,  3,  5,  6,  10,  9,  7,  8, ...
		

Crossrefs

Programs

  • PARI
    A317050(n) = fromdigits(binary(bitxor(n, n>>1)), -2)
    print (-select(v -> v<=0, apply(A317050, [0..152])))

Formula

a(n) = -A317050(A053754(n+1)) for any n >= 0.
a(n) = n iff n belongs to A136324.

A346632 Triangle read by rows giving the main diagonals of the matrices counting integer compositions by length and alternating sum (A345197).

Original entry on oeis.org

1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 0, 1, 2, 3, 0, 0, 0, 1, 2, 6, 6, 0, 0, 0, 1, 2, 9, 12, 0, 0, 0, 0, 1, 2, 12, 18, 10, 0, 0, 0, 0, 1, 2, 15, 24, 30, 20, 0, 0, 0, 0, 1, 2, 18, 30, 60, 60, 0, 0, 0, 0, 0, 1, 2, 21, 36, 100, 120, 35, 0, 0, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Jul 26 2021

Keywords

Comments

The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

Examples

			Triangle begins:
   1
   0   0
   0   1   0
   0   1   2   0
   0   1   2   0   0
   0   1   2   3   0   0
   0   1   2   6   6   0   0
   0   1   2   9  12   0   0   0
   0   1   2  12  18  10   0   0   0
   0   1   2  15  24  30  20   0   0   0
   0   1   2  18  30  60  60   0   0   0   0
   0   1   2  21  36 100 120  35   0   0   0   0
   0   1   2  24  42 150 200 140  70   0   0   0   0
   0   1   2  27  48 210 300 350 280   0   0   0   0   0
   0   1   2  30  54 280 420 700 700 126   0   0   0   0   0
		

Crossrefs

The first nonzero element in each column appears to be A001405.
These are the diagonals of the matrices given by A345197.
Antidiagonals of the same matrices are A345907.
Row sums are A345908.
A011782 counts compositions.
A097805 counts compositions by alternating (or reverse-alternating) sum.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A316524 gives the alternating sum of prime indices (reverse: A344616).
Other diagonals are A008277 of A318393 and A055884 of A320808.
Compositions of n, 2n, or 2n+1 with alternating/reverse-alternating sum k:
- k = 0: counted by A088218, ranked by A344619/A344619.
- k = 1: counted by A000984, ranked by A345909/A345911.
- k = -1: counted by A001791, ranked by A345910/A345912.
- k = 2: counted by A088218, ranked by A345925/A345922.
- k = -2: counted by A002054, ranked by A345924/A345923.
- k >= 0: counted by A116406, ranked by A345913/A345914.
- k <= 0: counted by A058622(n-1), ranked by A345915/A345916.
- k > 0: counted by A027306, ranked by A345917/A345918.
- k < 0: counted by A294175, ranked by A345919/A345920.
- k != 0: counted by A058622, ranked by A345921/A345921.
- k even: counted by A081294, ranked by A053754/A053754.
- k odd: counted by A000302, ranked by A053738/A053738.

Programs

  • Mathematica
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];
    Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],k==(n+ats[#])/2&]],{k,n}],{n,0,15}]

A380856 In the binary expansion of n, arrange bits row-wise in a binary tree which is complete except for the last row and then read those bits in pre-order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 9, 11, 12, 14, 13, 15, 16, 18, 20, 22, 17, 19, 21, 23, 24, 26, 28, 30, 25, 27, 29, 31, 32, 33, 36, 37, 40, 41, 44, 45, 34, 35, 38, 39, 42, 43, 46, 47, 48, 49, 52, 53, 56, 57, 60, 61, 50, 51, 54, 55, 58, 59, 62, 63, 64, 65, 66, 67, 72
Offset: 0

Views

Author

Darío Clavijo, Feb 06 2025

Keywords

Comments

The formed tree is a max-heap when n is in A335040, also is strict if n is in A053738 and not strict if n is in A053754.
The re-ordering of the bits depends only on the bit length of n (cf. A379905), and the two most significant bits are always fixed.
If the remaining bits are all 0's or all 1's then re-ordering them is no change so that fixed points a(n) = n include n = 2^k or 2^k-1.

Examples

			For n = 65537, its binary expansion 10000000000000001 is arranged by rows in the following tree
            ______1______
           /             \
        __0__           __0__
       /     \         /     \
      0       0       0       0
     / \     / \     / \     / \
    0   0   0   0   0   0   0   0
   / \
  0   1
Reading this in pre-order is binary 10000100000000000 so that a(65537) = 67584.
		

Crossrefs

Cf. A378496 (inverse permutation).

Programs

  • Maple
    a:= proc(n) uses Bits; local b, l; b, l:= i->
          `if`(i>nops(l), [], [b(2*i+1)[], b(2*i)[], l[-i]]),
           Split(n); Join(b(1))
        end:
    seq(a(n), n=0..68);  # Alois P. Heinz, Feb 06 2025
  • Mathematica
    a[n_Integer] := Module[{res = {}, data, len},
      data = IntegerDigits[n, 2];
      len = Length[data];
      Which[
       MemberQ[{0, 1, 2}, n], n,
       True,
       DepthFirstScan[TreeGraph[Table[Floor[j/2] -> j, {j, 2, len}]],
        1, {"PrevisitVertex" -> (AppendTo[res, #] &)}];
       FromDigits[data[[res]], 2]]]; a /@ Range[0, 68]
     (* Shenghui Yang, Feb 14 2025 *)
  • Python
    from binarytree import Node, build
    a = lambda n: int("".join([node.value for node in build(bin(n)[2:]).preorder]),2)
    print([a(n) for n in range(1, 69)])

A338249 Nonpositive values in A053985, in order of appearance and negated.

Original entry on oeis.org

0, 2, 1, 8, 7, 10, 9, 4, 3, 6, 5, 32, 31, 34, 33, 28, 27, 30, 29, 40, 39, 42, 41, 36, 35, 38, 37, 16, 15, 18, 17, 12, 11, 14, 13, 24, 23, 26, 25, 20, 19, 22, 21, 128, 127, 130, 129, 124, 123, 126, 125, 136, 135, 138, 137, 132, 131, 134, 133, 112, 111, 114, 113
Offset: 0

Views

Author

Rémy Sigrist, Oct 18 2020

Keywords

Comments

This sequence is a self-inverse permutation of the nonnegative integers (the offset has been set to 0 so as to get a permutation).
There is only one fixed point: a(0) = 0.

Examples

			A053985 = 0, 1, -2, -1, 4, 5, 2, 3, -8, -7, -10, -9, -4, -3, -6, -5, ...
We keep:  0,     2,  1,              8,  7,  10,  9,  4,  3,  6,  5, ...
		

Crossrefs

Programs

  • PARI
    A053985(n) = fromdigits(binary(n), -2)
    print (-select(v -> v<=0, apply(A053985, [0..147])))

Formula

a(n) = -A053985(A053754(n+1)) for any n >= 0.

A346309 Positions of words in A076478 such that #0's - #1's is odd.

Original entry on oeis.org

1, 2, 7, 8, 9, 10, 11, 12, 13, 14, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145
Offset: 1

Views

Author

Clark Kimberling, Aug 28 2021

Keywords

Examples

			The first fourteen words w(n) are 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111, so that a(3) = 7.
		

Crossrefs

Cf. A007931, A076478, A346310 (complement), A053754.

Programs

Formula

a(n) = A053754(n+1) + 1, conjectured.

A358892 Numbers obtained by self-shuffling the binary expansion of nonnegative numbers.

Original entry on oeis.org

0, 3, 10, 12, 15, 36, 40, 43, 45, 48, 51, 53, 54, 58, 60, 63, 136, 144, 147, 149, 153, 160, 163, 165, 169, 170, 172, 175, 178, 180, 183, 187, 192, 195, 197, 201, 202, 204, 207, 210, 212, 215, 216, 219, 221, 228, 232, 235, 237, 238, 240, 243, 245, 246, 250, 252
Offset: 1

Views

Author

Rémy Sigrist, Dec 05 2022

Keywords

Comments

This sequence lists the distinct values in A358893, in ascending order.
For any n > 0, there are A191755(n)/2 terms with binary length 2*n.
All terms are evil (A001969) and have an even number of binary digits (A053754).

Examples

			The binary expansion of 204 is "11001100" and can be obtained by self-shuffling the binary expansion of 10 ("1010") or 12 ("1100"), so 204 is a term.
		

Crossrefs

Programs

  • PARI
    See Links section.
Previous Showing 41-47 of 47 results.