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.

User: Tilman Piesk

Tilman Piesk's wiki page.

Tilman Piesk has authored 89 sequences. Here are the ten most recent ones:

A387130 a(n) is the number of complement pairs of imprimitive (periodic) 2n-bead balanced binary necklaces.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 11, 0, 39, 0, 118, 12, 395, 0, 1372, 0, 4601, 119, 15986, 0, 56662, 11, 199854, 1337, 716135, 0, 2589376, 0, 9391051, 15987, 34315811, 129, 126096824, 0, 465062362, 199855, 1723071186, 0, 6408523001, 0, 23910175807, 2586090, 89493721076
Offset: 0

Author

Tilman Piesk, Aug 17 2025

Keywords

Comments

A386946(n) is the number of primitive 2n-bead balanced binary necklaces (corresponding to Lyndon words), and A115118 is the number of those that are self-complementary (i.e., can be rotated so that all beads change color). Their difference 2*a(n) is the number of those that are not self-complementary. a(n) is the number pairs of distinct complements.
Doubled entries: 0, 0, 0, 0, 0, 0, 2, 0, 6, 2, 22, 0, 78, 0, 236, 24, 790, 0, 2744, ...
Sequences counting 2n-bead balanced binary necklaces:
primitive imprimitive
+-----------------------+---------+
self-complementary | A000048 A115118 | A000013 |
complement pairs | A383904 this | A386388 |
+-----------------------+---------+
+-----------------------+---------+

Examples

			  n | A386946(n) A115118(n) | 2*a(n)    a(n) | A386388(n) A383904(n)
  0 |         0          0  |     0       0  |         0          0
  1 |         0          0  |     0       0  |         0          0
  2 |         1          1  |     0       0  |         0          0
  3 |         1          1  |     0       0  |         1          1
  4 |         2          2  |     0       0  |         3          3
  5 |         1          1  |     0       0  |        11         11
  6 |         5          3  |     2       1  |        36         35
  7 |         1          1  |     0       0  |       118        118
  8 |        10          4  |     6       3  |       395        392
  9 |         4          2  |     2       1  |      1337       1336
 10 |        27          5  |    22      11  |      4598       4587
 11 |         1          1  |     0       0  |     15986      15986
 12 |        88         10  |    78      39  |     56270      56231
 13 |         1          1  |     0       0  |    199854     199854
 14 |       247         11  |   236     118  |    716132     716014
 15 |        29          5  |    24      12  |   2584754    2584742
 16 |       810         20  |   790     395  |   9391051    9390656
Examples for n=8 with necklaces of length 16:
The total number of necklaces is A003239(8) = 810.
A022553(8) = 800 of them are primitive.
The other A386946(8) = 10 are periodic.
A115118(8) = 4 among those are self-complementary:
 0000111100001111
 0010110100101101
 0011001100110011
 0101010101010101
The remaining 6 necklaces form a(8) = 3 complement pairs:
 0001011100010111 0001110100011101
 0001101100011011 0010011100100111
 0010101100101011 0011010100110101
		

Crossrefs

Formula

a(n) = (A386946(n) - A115118(n)) / 2.
a(n) = A386388(n) - A383904(n).

A386946 a(n) is the number of imprimitive (periodic) 2n-bead balanced binary necklaces.

Original entry on oeis.org

0, 0, 1, 1, 2, 1, 5, 1, 10, 4, 27, 1, 88, 1, 247, 29, 810, 1, 2780, 1, 9260, 249, 32067, 1, 113520, 26, 400025, 2704, 1432868, 1, 5179905, 1, 18784170, 32069, 68635479, 271, 252201136, 1, 930138523, 400027, 3446168660, 1, 12817096533, 1, 47820447036, 5173304
Offset: 0

Author

Tilman Piesk, Aug 10 2025

Keywords

Comments

A003239(n) is the number of 2n-bead balanced binary necklaces. A022553(n) among them are primitive.
The remaining a(n) necklaces are periodic.
Sequences counting 2n-bead balanced binary necklaces:
primitive imprimitive
+-----------------------+---------+
self-complementary | A000048 A115118 | A000013 |
complement pairs | A383904 A387130 | A386388 |
+-----------------------+---------+
| A022553 this | A003239 |
+-----------------------+---------+

Examples

			  n | A003239(n) A022553(n) | a(n)
  0 |         1          1  |   0
  1 |         1          1  |   0
  2 |         2          1  |   1
  3 |         4          3  |   1
  4 |        10          8  |   2
  5 |        26         25  |   1
  6 |        80         75  |   5
  7 |       246        245  |   1
  8 |       810        800  |  10
  9 |      2704       2700  |   4
 10 |      9252       9225  |  27
 11 |     32066      32065  |   1
 12 |    112720     112632  |  88
 13 |    400024     400023  |   1
 14 |   1432860    1432613  | 247
 15 |   5170604    5170575  |  29
 16 |  18784170   18783360  | 810
There are A003239(8) = 810 balanced binary necklaces of length 16. A022553(8) = 800 of them are primitive. a(n) = 10 are not. See A387130 for a list.
		

Formula

a(n) = A003239(n) - A022553(n).
a(n) = A115118(n) + 2 * A387130(n).

A383904 a(n) is the number of complement pairs of primitive 2n-bead balanced binary necklaces.

Original entry on oeis.org

0, 0, 0, 1, 3, 11, 35, 118, 392, 1336, 4587, 15986, 56231, 199854, 716014, 2584742, 9390656, 34315811, 126039218, 465062362, 1723066193, 6407806833, 23910159818, 89493721076, 335912335304, 1264105728831, 4768446686910, 18027215660947, 68291877609003
Offset: 0

Author

Tilman Piesk, Aug 07 2025

Keywords

Comments

A022553(n) is the number of primitive 2n-bead balanced binary necklaces (corresponding to Lyndon words), and A000048 is the number of those that are self-complementary (i.e., can be rotated so that all beads change color). Their difference 2*a(n) is the number of those that are not self-complementary. a(n) is the number pairs of distinct complements.
Doubled entries: 0, 0, 0, 2, 6, 22, 70, 236, 784, 2672, 9174, 31972, 112462, 399708, 1432028, ...
Sequences counting 2n-bead balanced binary necklaces:
primitive imprimitive
+-----------------------+---------+
self-complementary | A000048 A115118 | A000013 |
complement pairs | this A387130 | A386388 |
+-----------------------+---------+
+-----------------------+---------+

Examples

			  n | A022553(n) A000048(n) | 2*a(n)    a(n)
  0 |         1          1  |     0       0
  1 |         1          1  |     0       0
  2 |         1          1  |     0       0
  3 |         3          1  |     2       1
  4 |         8          2  |     6       3
  5 |        25          3  |    22      11
  6 |        75          5  |    70      35
  7 |       245          9  |   236     118
  8 |       800         16  |   784     392
  9 |      2700         28  |  2672    1336
 10 |      9225         51  |  9174    4587
Examples for n=5 with necklaces of length 10:
The total number of necklaces is A003239(5) = 26.
Only A386946(5) = 1 of them is periodic, namely 0101010101.
The other A022553(5) = 25 are primitive.
A000048(5) = 3 among those are self-complementary:
 0000011111
 0001011101
 0010011011
The remaining 22 necklaces form a(5) = 11 complement pairs:
 0000101111 0000111101
 0000110111 0001111001
 0000111011 0001001111
 0001010111 0001110101
 0001011011 0010011101
 0001100111 0001110011
 0001101011 0010100111
 0001101101 0010010111
 0010101011 0011010101
 0010101101 0010110101
 0010110011 0011001101
		

Formula

a(n) = (A022553(n) - A000048(n)) / 2.

A386388 a(n) is the number of complement pairs of 2n-bead balanced bicolor necklaces.

Original entry on oeis.org

0, 0, 0, 1, 3, 11, 36, 118, 395, 1337, 4598, 15986, 56270, 199854, 716132, 2584754, 9391051, 34315811, 126040590, 465062362, 1723070794, 6407806952, 23910175804, 89493721076, 335912391966, 1264105728842, 4768446886764, 18027215662284, 68291878325138
Offset: 0

Author

Tilman Piesk, Jul 20 2025

Keywords

Comments

A003239(n) is the number of 2n-bead balanced bicolor necklaces, and A000013(n) is the number of those that are self-complementary (i.e., can be rotated so that all beads change color). Their difference 2*a(n) is the number of those that are not self-complementary. a(n) is the number pairs of distinct complements.
Doubled entries: 0, 0, 0, 2, 6, 22, 72, 236, 790, 2674, 9196, 31972, 112540, 399708, 1432264, ...

Examples

			  n  | A003239(n) A000013(n) | 2*a(n)      a(n)
  0  |         1          1  |     0         0
  1  |         1          1  |     0         0
  2  |         2          2  |     0         0
  3  |         4          2  |     2         1
  4  |        10          4  |     6         3
  5  |        26          4  |    22        11
  6  |        80          8  |    72        36
  7  |       246         10  |   236       118
  8  |       810         20  |   790       395
  9  |      2704         30  |  2674      1337
 10  |      9252         56  |  9196      4598
Examples for n=4 with necklaces of length 8:
A000013(4) = 4 necklaces are self-complementary:
 00001111, 00110011, 01010101, 00101101 (compare A385665)
There are a(n) = 3 pairs of complementary necklaces:
 (00110101, 00101011), (00100111, 00011011), (00010111, 00011101)
		

Crossrefs

Programs

  • Mathematica
    a[0]=0;a[n_]:=( Sum[ EulerPhi[n/k]*Binomial[2k, k]/(2n), {k, Divisors[n]}]- Fold[ #1 + EulerPhi[2#2]2^(n/#2)/(2n) &, 0, Divisors[n]])/2;Array[a,29,0] (* James C. McMahon, Jul 30 2025 *)

Formula

a(n) = (A003239(n) - A000013(n)) / 2.

A385666 Triangle read by rows: T(n,k) is the number of 2n-bead balanced binary necklaces with period length 2n/k.

Original entry on oeis.org

1, 1, 1, 3, 0, 1, 8, 1, 0, 1, 25, 0, 0, 0, 1, 75, 3, 1, 0, 0, 1, 245, 0, 0, 0, 0, 0, 1, 800, 8, 0, 1, 0, 0, 0, 1, 2700, 0, 3, 0, 0, 0, 0, 0, 1, 9225, 25, 0, 0, 1, 0, 0, 0, 0, 1, 32065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 112632, 75, 8, 3, 0, 1, 0, 0, 0, 0, 0, 1, 400023
Offset: 1

Author

Tilman Piesk, Jul 16 2025

Keywords

Comments

There are A003239(n) balanced binary necklaces of length 2n. (Central numbers of A047996.)
T(n,k) is the number of those that can be rotated into themselves in k different ways (at least 1 for the trivial rotation).
A022553(n) necklaces (corresponding to Lyndon words) have only the trivial rotation.
All columns have the same positive entries, each preceded by k-1 zeros.
Compare triangle A385665, which counts only self-complementary balanced binary necklaces.

Examples

			Triangle begins:
         k     1   2  3  4  5  6  7  8  9 10 11 12 13 14 15 16    A003239(n)
  n
  1            1   .  .  .  .  .  .  .  .  .  .  .  .  .  .  .            1
  2            1   1  .  .  .  .  .  .  .  .  .  .  .  .  .  .            2
  3            3   .  1  .  .  .  .  .  .  .  .  .  .  .  .  .            4
  4            8   1  .  1  .  .  .  .  .  .  .  .  .  .  .  .           10
  5           25   .  .  .  1  .  .  .  .  .  .  .  .  .  .  .           26
  6           75   3  1  .  .  1  .  .  .  .  .  .  .  .  .  .           80
  7          245   .  .  .  .  .  1  .  .  .  .  .  .  .  .  .          246
  8          800   8  .  1  .  .  .  1  .  .  .  .  .  .  .  .          810
  9         2700   .  3  .  .  .  .  .  1  .  .  .  .  .  .  .         2704
 10         9225  25  .  .  1  .  .  .  .  1  .  .  .  .  .  .         9252
 11        32065   .  .  .  .  .  .  .  .  .  1  .  .  .  .  .        32066
 12       112632  75  8  3  .  1  .  .  .  .  .  1  .  .  .  .       112720
 13       400023   .  .  .  .  .  .  .  .  .  .  .  1  .  .  .       400024
 14      1432613 245  .  .  .  .  1  .  .  .  .  .  .  1  .  .      1432860
 15      5170575   . 25  .  3  .  .  .  .  .  .  .  .  .  1  .      5170604
 16     18783360 800  .  8  .  .  .  1  .  .  .  .  .  .  .  1     18784170
Examples for n=4 with necklaces of length 8:
T(4, 1) = 8 necklaces have k=1 rotation, i.e. rotating 0 places:
 00001111, 00010111, 00011011, 00011101, 00100111, 00101011, 00101101, 00110101
T(4, 2) = 1 necklace has k=2 rotations:
 00110011 can be rotated onto itself by rotating 0 or 4 places.
T(4, 4) = 1 necklace has k=4 rotations:
 01010101 can be rotated onto itself by rotating 0, 2, 4 or 6 places.
		

Crossrefs

Formula

T(n,k) = A022553(n/k) iff n divisible by k, otherwise 0.

A385665 Triangle read by rows: T(n,k) is the number of 2n-bead balanced bicolor necklaces that can be rotated into their complements in k different ways.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 2, 1, 0, 1, 3, 0, 0, 0, 1, 5, 1, 1, 0, 0, 1, 9, 0, 0, 0, 0, 0, 1, 16, 2, 0, 1, 0, 0, 0, 1, 28, 0, 1, 0, 0, 0, 0, 0, 1, 51, 3, 0, 0, 1, 0, 0, 0, 0, 1, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 170, 5, 2, 1, 0, 1, 0, 0, 0, 0, 0, 1, 315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Author

Tilman Piesk, Jul 06 2025

Keywords

Comments

Let X = A003239, Y = A000013, Z = A000048.
Rotations producing the complementary and the same necklace: CR and SR
There are X(n) balanced bicolor necklaces (BBN) of length 2n. (Central numbers of A047996.)
Y(n) among them are self-complementary (SCBBN). (They can be rotated so that all beads change color.)
Z(n) among those are primitive (not periodic). Each has a unique CR and SR. (SR is trivial rotation.)
The other Y(n)-Z(n) = A115118(n) SCBBN have multiple CR and SR.
T(n,k) SCBBN have k different CR and SR.
Column 1 is Z. The other columns have the same positive entries, each preceded by k-1 zeros.
One could add a column 0 to this triangle, whose entries would be X(n)-Y(n) = 2*A386388(n).
Triangle A385666 does the same for SR of all BBN.

Examples

			Triangle begins:
      k    1  2  3  4  5  6  7  8  9 10 11 12 12 14 15 16     A000013(n)
  n
  1        1  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .             1
  2        1  1  .  .  .  .  .  .  .  .  .  .  .  .  .  .             2
  3        1  .  1  .  .  .  .  .  .  .  .  .  .  .  .  .             2
  4        2  1  .  1  .  .  .  .  .  .  .  .  .  .  .  .             4
  5        3  .  .  .  1  .  .  .  .  .  .  .  .  .  .  .             4
  6        5  1  1  .  .  1  .  .  .  .  .  .  .  .  .  .             8
  7        9  .  .  .  .  .  1  .  .  .  .  .  .  .  .  .            10
  8       16  2  .  1  .  .  .  1  .  .  .  .  .  .  .  .            20
  9       28  .  1  .  .  .  .  .  1  .  .  .  .  .  .  .            30
 10       51  3  .  .  1  .  .  .  .  1  .  .  .  .  .  .            56
 11       93  .  .  .  .  .  .  .  .  .  1  .  .  .  .  .            94
 12      170  5  2  1  .  1  .  .  .  .  .  1  .  .  .  .           180
 13      315  .  .  .  .  .  .  .  .  .  .  .  1  .  .  .           316
 14      585  9  .  .  .  .  1  .  .  .  .  .  .  1  .  .           596
 15     1091  .  3  .  1  .  .  .  .  .  .  .  .  .  1  .          1096
 16     2048 16  .  2  .  .  .  1  .  .  .  .  .  .  .  1          2068
Examples for n=4 with necklaces of length 8:
T(4, 1) = 2 necklaces can be rotated into their complements in k=1 way:
 00001111 can be turned into 11110000 by rotating 4 places to the right.
 00101101 can be turned into 11010010 by rotating 4 places to the right.
T(4, 2) = 1 necklace can be rotated into its complement in k=2 ways:
 00110011 can be turned into 11001100 by rotating 2 or 6 places to the right.
T(4, 4) = 1 necklace can be rotated into its complement in k=4 ways:
 01010101 can be turned into 10101010 by rotating 1, 3, 5 or 7 places to the right.
		

Formula

T(n,k) = A000048(n/k) iff n divisible by k, otherwise 0.

A358167 Irregular triangle read by rows: T(n, k) = k-th fixed point in Zhegalkin permutation n (row n of A197819).

Original entry on oeis.org

0, 1, 0, 2, 0, 6, 8, 14, 0, 30, 40, 54, 72, 86, 96, 126, 128, 158, 168, 182, 200, 214, 224, 254, 0, 510, 680, 854, 1224, 1334, 1632, 1950, 2176, 2430, 2600, 3030, 3144, 3510, 3808, 3870, 4320, 4382, 4680, 5046, 5160
Offset: 0

Author

Tilman Piesk, Nov 01 2022

Keywords

Comments

Let R = A197819(n, ...) and F = a(n, ...). Then F are the fixed points of R.
But there is a second relationship between F and R:
Let X(i) = R(i) XOR i. Then X(i) is an element of F.
Let I_k = {i | X(i) = F(k)}. Let Q = A197819(n-1, ...).
Then I_k = {Q(k) XOR f | f in F}.
Row lengths are 2, 2, 4, 16, 256, 65536, ..., i.e., A001146(n-1) for n > 0.
Row sums are 1, 2, 28, 2032, 8388352, ..., i.e., A147537(A000225) for n > 0.

Examples

			Triangle begins:
     k  0    1    2   3    4   5   6    7    8    9   10   11   12   13   14   15
  n
  0     0,   1
  1     0,   2
  2     0,   6,   8, 14
  3     0,  30,  40, 54,  72, 86, 96, 126, 128, 158, 168, 182, 200, 214, 224, 254
  4     0, 510, 680...
A197819(3, 168) = a(3, 10) = 168.
How to calculate the term for n=3, k=10:
  p = A197819(n-1, k) = A197819(2, 10) = 2
  p XOR k = 2 XOR 10 = 8
  shifted_k = 2^(2^(n-1)) * k = 2^(2^2) * 10 = 160
  (p XOR k) + shifted_k = 8 + 160 = 168
168 in little-endian binary is 00010101. The corresponding algebraic normal form is XOR(AND(x0, x1), AND(x0, x2), AND(x0, x1, x2)). (Its ANDs correspond to the 3 binary 1s.) The truth table of this Boolean function is again 00010101.
  (With x0 = 01010101, x1 = 00110011, x2 = 00001111.)
Example for the second relationship with A197819, as described in COMMENTS:
  Let R = A197819(3, 0..255), F = a(3, 0..15), Q = A197819(2, 0..15).
  I_3 = {i | R(i) XOR i = F(3)}
      = {Q(3) XOR f | f in F} = {5 XOR f | f in F}
      = {5, 27, 45, 51, 77, 83, 101, 123, 133, 155, 173, 179, 205, 211, 229, 251}
  R(5) XOR 5  =  R(27) XOR 27  =  R(45) XOR 45  =  R(51) XOR 51  =  ...  =  F(3)
   51  XOR 5  =    45  XOR 27  =    27  XOR 45  =     5  XOR 51  =  ...  =   54
		

Crossrefs

Programs

  • Python
    def a(n, k):
        if n == 0:
            assert k < 2
            return k
        else:
            row_length = 1 << (1 << (n-1))  # 2 ** 2 ** (n-1)
            assert k < row_length
        p = a197819(n-1, k)
        p_xor_k = p ^ k
        shifted_k = row_length * k
        return p_xor_k + shifted_k

Formula

For n>0: T(n, k) = [A197819(n-1, k) XOR k] + [2^(2^(n-1)) * k].
(On this page "XOR" always is the bitwise exclusive or.)
For n>0: T(n, A058891(n)) = A058891(n+1) is the unique power of 2 in row n.

A358126 Replace 2^k in binary expansion of n with 2^(2^k).

Original entry on oeis.org

0, 2, 4, 6, 16, 18, 20, 22, 256, 258, 260, 262, 272, 274, 276, 278, 65536, 65538, 65540, 65542, 65552, 65554, 65556, 65558, 65792, 65794, 65796, 65798, 65808, 65810, 65812, 65814, 4294967296, 4294967298, 4294967300
Offset: 0

Author

Tilman Piesk, Oct 30 2022

Keywords

Comments

Sums of distinct terms of A001146.
The name "ballooned integers" is proposed for this sequence.
a(n) is the index of the first occurrence of n in A253315.

Examples

			Let    n   =     25  =  1 +   8 +    16  =     2^0  +    2^3  +    2^4.
Then a(n)  =  65794  =  2 + 256 + 65536  =  2^(2^0) + 2^(2^3) + 2^(2^4).
The binary indices of n are {0, 3, 4}. Those of a(n) are {1, 8, 16}.
		

Programs

  • Maple
    a := proc(n) select(d -> d[2] <> 0, ListTools:-Enumerate(convert(n,base,2))):
    add(2^(2^(%[j][1] - 1)), j = 1..nops(%)) end: seq(a(n), n = 0..34); # Peter Luschny, Oct 31 2022
  • Mathematica
    a[n_] := Total[2^(2^Range[If[n == 0, 1, IntegerLength[n,2]] - 1, 0, -1]) * IntegerDigits[n, 2]]; Array[a, 35, 0] (* Amiram Eldar, Oct 31 2022 *)
  • PARI
    a(n) = my(d=Vecrev(digits(n,2))); for (k=1, #d, d[k] *= 2^(2^(k-1))); vecsum(d); \\ Michel Marcus, Oct 31 2022
  • Python
    def a(n):
        binary_string = "{0:b}".format(n)[::-1]  # little-endian
        result = 0
        for i, binary_digit in enumerate(binary_string):
            if binary_digit == '1':
                result += 1 << (1 << i)  # 2 ** (2 ** i)
        return result
    

Formula

If n = Sum_{i=0..k} 2^s_i, then a(n) = Sum_{i=0..k} 2^(2^s_i).
a(n) = 2 * A253317(n+1).
a(2^n-1) = A060803(n-1) for n >= 1.
a(2^n) = A001146(n).
A197819[m, a(n)] = A228539[m, n]. (Compare link about Boolean Walsh functions.)

A300693 a(n) = number of edges in a concertina n-cube.

Original entry on oeis.org

0, 1, 6, 42, 344, 3230, 34452
Offset: 0

Author

Tilman Piesk, Apr 03 2018

Keywords

Comments

n-place formulas in first-order logic like Ax Ey P(x, y) can be ordered by implication. This Hasse diagram has A000629(n) vertices and a(n) edges.
This is the second diagonal on the right in A300700, the triangle of faces in the concertina n-cube.
The corresponding sequence for cocoon concertina n-cubes, which have more internal vertices and edges, is A300694.

Crossrefs

Formula

a(n) = A300700(n, n-1).

A300701 a(n) = number of faces in a concertina n-cube.

Original entry on oeis.org

1, 3, 13, 87, 805, 9303, 128533
Offset: 0

Author

Tilman Piesk, Mar 11 2018

Keywords

Examples

			A concertina 3-cube has 26 0-faces (vertices), 42 1-faces (edges), 18 2-faces and 1 3-face (the polyhedron itself). Together this makes a(3) = 87 faces.
		

Crossrefs

Row sums of A300700.