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-8 of 8 results.

A333764 Numbers k such that the k-th composition in standard order is a co-necklace.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 21, 23, 31, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 45, 47, 63, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 77, 78, 79, 85, 87, 91, 95, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140
Offset: 1

Views

Author

Gus Wiseman, Apr 12 2020

Keywords

Comments

A co-necklace is a finite sequence that is lexicographically greater than or equal to any cyclic rotation.
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. This gives a bijective correspondence between nonnegative integers and integer compositions

Examples

			The sequence together with the corresponding co-necklaces begins:
    1: (1)             32: (6)               69: (4,2,1)
    2: (2)             33: (5,1)             70: (4,1,2)
    3: (1,1)           34: (4,2)             71: (4,1,1,1)
    4: (3)             35: (4,1,1)           73: (3,3,1)
    5: (2,1)           36: (3,3)             74: (3,2,2)
    7: (1,1,1)         37: (3,2,1)           75: (3,2,1,1)
    8: (4)             38: (3,1,2)           77: (3,1,2,1)
    9: (3,1)           39: (3,1,1,1)         78: (3,1,1,2)
   10: (2,2)           42: (2,2,2)           79: (3,1,1,1,1)
   11: (2,1,1)         43: (2,2,1,1)         85: (2,2,2,1)
   15: (1,1,1,1)       45: (2,1,2,1)         87: (2,2,1,1,1)
   16: (5)             47: (2,1,1,1,1)       91: (2,1,2,1,1)
   17: (4,1)           63: (1,1,1,1,1,1)     95: (2,1,1,1,1,1)
   18: (3,2)           64: (7)              127: (1,1,1,1,1,1,1)
   19: (3,1,1)         65: (6,1)            128: (8)
   21: (2,2,1)         66: (5,2)            129: (7,1)
   23: (2,1,1,1)       67: (5,1,1)          130: (6,2)
   31: (1,1,1,1,1)     68: (4,3)            131: (6,1,1)
		

Crossrefs

The non-"co" version is A065609.
The reversed version is A328595.
Binary necklaces are A000031.
Necklace compositions are A008965.
Necklaces covering an initial interval are A019536.
Numbers whose prime signature is a necklace are A329138.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Length of Lyndon factorization is A329312.
- Rotational period is A333632.
- Reversed necklaces are A333943.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    coneckQ[q_]:=Array[OrderedQ[{RotateRight[q,#],q}]&,Length[q]-1,1,And];
    Select[Range[100],coneckQ[stc[#]]&]

A333632 Rotational period of the k-th composition in standard order; a(0) = 0.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Apr 12 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. 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 a(299) = 5 rotations:
  (1,1,3,2,2)
  (1,3,2,2,1)
  (3,2,2,1,1)
  (2,2,1,1,3)
  (2,1,1,3,2)
The a(9933) = 4 rotations:
  (1,2,1,3,1,2,1,3)
  (1,3,1,2,1,3,1,2)
  (2,1,3,1,2,1,3,1)
  (3,1,2,1,3,1,2,1)
		

Crossrefs

Aperiodic compositions are counted by A000740.
Aperiodic binary words are counted by A027375.
The orderless period of prime indices is A052409.
Numbers whose binary expansion is periodic are A121016.
Periodic compositions are counted by A178472.
The version for binary expansion is A302291.
Numbers whose prime signature is aperiodic are A329139.
Compositions by number of distinct rotations are A333941.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Equal runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Rotational period is A333632 (this sequence).
- Co-necklaces are A333764.
- Reversed necklaces are A333943.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Array[RotateRight[stc[n],#]&,DigitCount[n,2,1]]]],{n,0,100}]

Formula

a(n) = A000120(n)/A138904(n) = A302291(n) - A023416(n)/A138904(n).

A333943 Numbers k such that the k-th composition in standard order is a reversed necklace.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 19, 21, 23, 31, 32, 33, 34, 35, 36, 37, 39, 41, 42, 43, 45, 47, 63, 64, 65, 66, 67, 68, 69, 71, 73, 74, 75, 77, 79, 81, 83, 85, 87, 91, 95, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 141, 143
Offset: 1

Views

Author

Gus Wiseman, Apr 14 2020

Keywords

Comments

A necklace is a finite sequence that is lexicographically minimal among all of its cyclic rotations. Reversed necklaces are different from co-necklaces (A333764).
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. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The sequence together with the corresponding reversed necklaces begins:
    1: (1)             32: (6)               69: (4,2,1)
    2: (2)             33: (5,1)             71: (4,1,1,1)
    3: (1,1)           34: (4,2)             73: (3,3,1)
    4: (3)             35: (4,1,1)           74: (3,2,2)
    5: (2,1)           36: (3,3)             75: (3,2,1,1)
    7: (1,1,1)         37: (3,2,1)           77: (3,1,2,1)
    8: (4)             39: (3,1,1,1)         79: (3,1,1,1,1)
    9: (3,1)           41: (2,3,1)           81: (2,4,1)
   10: (2,2)           42: (2,2,2)           83: (2,3,1,1)
   11: (2,1,1)         43: (2,2,1,1)         85: (2,2,2,1)
   15: (1,1,1,1)       45: (2,1,2,1)         87: (2,2,1,1,1)
   16: (5)             47: (2,1,1,1,1)       91: (2,1,2,1,1)
   17: (4,1)           63: (1,1,1,1,1,1)     95: (2,1,1,1,1,1)
   18: (3,2)           64: (7)              127: (1,1,1,1,1,1,1)
   19: (3,1,1)         65: (6,1)            128: (8)
   21: (2,2,1)         66: (5,2)            129: (7,1)
   23: (2,1,1,1)       67: (5,1,1)          130: (6,2)
   31: (1,1,1,1,1)     68: (4,3)            131: (6,1,1)
		

Crossrefs

The non-reversed version is A065609.
The dual version is A328595.
Binary necklaces are A000031.
Necklace compositions are A008965.
Necklaces covering an initial interval are A019536.
Numbers whose prime signature is a necklace are A329138.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Length of Lyndon factorization is A329312.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Length of co-Lyndon factorization is A334029.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#1]}]&,Length[q]-1,1,And];
    Select[Range[100],neckQ[Reverse[stc[#]]]&]

A138904 Number of rotational symmetries in the binary expansion of a number.

Original entry on oeis.org

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

Views

Author

Max Sills, Apr 03 2008, Apr 04 2008

Keywords

Comments

Mersenne numbers of form (2^n - 1) have n rotational symmetries.
For prime length binary expansions these are the only nontrivial symmetries.
For composite length expansions it seems that when the number of symmetries is nontrivial it is equal to a factor of the length. We're working on an explicit formula.
Discovered in the context of random circulant matrices, examining if there's a correlation between degrees of freedom and number of symmetries in the first row.
When combined with A138954, these two sequences should give a full account of the number of redundant rows in a circulant square matrix with at most two distinct values, where a(n) is the encoding of the first row of the matrix into binary such that value a = 1 and value b = 0.
Discovered on the night of Apr 02, 2008 by Maxwell Sills and Gary Doran.
Conjecture: For binary expansions of length n, there are d(n) distinct values that will show up as symmetries, where d is the divisor function. The symmetry values will be precisely the divisors of n.
Example: for binary expansions of length 12, one sees that d(12) = 6 distinct values show up as symmetries (1, 2, 3, 4, 6, 12).
Conjecture: For numbers whose binary expansion has length n which has proper divisors which are all coprime: There will be only one number of length n with n symmetries. That number is 2^n - 1. For each proper divisor d (excluding 1), you can generate all numbers of length n that have n/d symmetries like so: (2^0 + 2^d + 2^2d ... 2^(n-d)) * a, where 2^(d-1) <= a < (2^d) - 1. The rest of the expansions of length n will have only the trivial symmetry.
Also the number of rotational symmetries of the n-th composition in standard order (graded reverse-lexicographic). This composition (row n of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of n, prepending 0, taking first differences, and reversing again. - Gus Wiseman, Apr 19 2020
From Gus Wiseman, Apr 19 2020: (Start)
Aperiodic compositions are counted by A000740.
Aperiodic binary words are counted by A027375.
The orderless period of prime indices is A052409.
Numbers whose binary expansion is periodic are A121016.
Periodic compositions are counted by A178472.
Period of binary expansion is A302291.
Compositions by sum and number of distinct rotations are A333941.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Reversed co-necklaces are A328595.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Reversed necklaces are A333943.
(End).

Examples

			a(10) = 2 because the binary expansion of 10 is 1010 and it has two rotational symmetries (including identity).
		

Crossrefs

Programs

  • Mathematica
    Table[IntegerLength[n,2]/Length[Union[Array[RotateRight[IntegerDigits[n,2],#]&,IntegerLength[n,2]]]],{n,100}] (* Gus Wiseman, Apr 19 2020 *)

Formula

a(n) = A070939(n)/A302291(n) = A000120(n)/A333632(n). - Gus Wiseman, Apr 19 2020

A333941 Triangle read by rows where T(n,k) is the number of compositions of n with rotational period k.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 0, 2, 2, 0, 0, 3, 2, 3, 0, 0, 2, 4, 6, 4, 0, 0, 4, 6, 9, 8, 5, 0, 0, 2, 6, 15, 20, 15, 6, 0, 0, 4, 8, 24, 32, 35, 18, 7, 0, 0, 3, 10, 27, 56, 70, 54, 28, 8, 0, 0, 4, 12, 42, 84, 125, 120, 84, 32, 9, 0, 0, 2, 10, 45, 120, 210, 252, 210, 120, 45, 10, 0
Offset: 0

Views

Author

Gus Wiseman, Apr 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			Triangle begins:
   1
   0   1
   0   2   0
   0   2   2   0
   0   3   2   3   0
   0   2   4   6   4   0
   0   4   6   9   8   5   0
   0   2   6  15  20  15   6   0
   0   4   8  24  32  35  18   7   0
   0   3  10  27  56  70  54  28   8   0
   0   4  12  42  84 125 120  84  32   9   0
   0   2  10  45 120 210 252 210 120  45  10   0
   0   6  18  66 168 335 450 462 320 162  50  11   0
Row n = 6 counts the following compositions (empty columns indicated by dots):
  .  (6)       (15)    (114)  (1113)  (11112)  .
     (33)      (24)    (123)  (1122)  (11121)
     (222)     (42)    (132)  (1131)  (11211)
     (111111)  (51)    (141)  (1221)  (12111)
               (1212)  (213)  (1311)  (21111)
               (2121)  (231)  (2112)
                       (312)  (2211)
                       (321)  (3111)
                       (411)
		

Crossrefs

Column k = 1 is A000005.
Row sums are A011782.
Diagonal T(2n,n) is A045630(n).
The strict version is A072574.
A version counting runs is A238279.
Column k = n - 1 is A254667.
Aperiodic compositions are counted by A000740.
Aperiodic binary words are counted by A027375.
The orderless period of prime indices is A052409.
Numbers whose binary expansion is periodic are A121016.
Periodic compositions are counted by A178472.
Period of binary expansion is A302291.
Numbers whose prime signature is aperiodic are A329139.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Rotational symmetries are counted by A138904.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774.
- Aperiodic compositions are A328594.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Reversed necklaces are A333943.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Function[c,Length[Union[Array[RotateRight[c,#]&,Length[c]]]]==k]]],{n,0,10},{k,0,n}]
  • PARI
    T(n,k)=if(n==0, k==0, sumdiv(n, m, sumdiv(gcd(k,m), d, moebius(d)*binomial(m/d-1, k/d-1)))) \\ Andrew Howroyd, Jan 19 2023

Formula

T(n,k) = Sum_{m|n} Sum_{d|gcd(k,m)} mu(d)*binomial(m/d-1, k/d-1) for n > 0. - Andrew Howroyd, Jan 19 2023

A366140 Fixed points of the binary rotations A336953 and A366139: numbers k >= 0 such that A336953(k) = A366139(k) = k.

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 10, 12, 15, 20, 25, 30, 31, 36, 42, 45, 48, 54, 60, 63, 70, 77, 84, 91, 98, 105, 112, 119, 126, 127, 128, 136, 144, 152, 160, 168, 170, 176, 184, 192, 200, 204, 208, 216, 224, 232, 240, 248, 255, 261, 270, 279, 288, 297, 306, 315, 324, 333
Offset: 1

Views

Author

Paolo Xausa, Sep 30 2023

Keywords

Comments

If a number is a fixed point of A336953, then it's also a fixed point of A366139, and vice versa.
k is a term iff A302291(k)|k.

Crossrefs

Programs

  • Mathematica
    A366140Q[n_]:=FromDigits[RotateLeft[IntegerDigits[n,2],n],2]==n;
    Select[Range[0,500],A366140Q]

A302295 a(n) is the period of the binary expansion of n (with leading zeros allowed).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 04 2018

Keywords

Comments

Equivalently, a(n) is the least positive k such that n is a repdigit number in base 2^k.
See A302291 for the variant where leading zeros are not allowed.

Examples

			The first terms, alongside the binary expansion of n with periodic part in parentheses, are:
  n  a(n)    bin(n)
  -- ----    ------
   0    1    (0)
   1    1    (1)
   2    2    (10)
   3    1    (1)(1)
   4    3    (100)
   5    2    (01)(01)
   6    3    (110)
   7    1    (1)(1)(1)
   8    4    (1000)
   9    3    (001)(001)
  10    2    (10)(10)
  11    4    (1011)
  12    4    (1100)
  13    4    (1101)
  14    4    (1110)
  15    1    (1)(1)(1)(1)
  16    5    (10000)
  17    4    (0001)(0001)
  18    3    (10)(10)
  19    5    (10011)
  20    5    (10100)
		

Crossrefs

Programs

  • PARI
    a(n) = for (k=1, oo, if (#Set(digits(n, 2^k))<=1, return (k)))

Formula

a(2^n) = n + 1 for any n >= 0.
a(2^n - 1) = 1 for any n >= 0.
a(n) <= A302291(n).
A059711(n) <= 2^a(n).

A361942 For any number n >= 0 with binary expansion (b_1, ..., b_w), a(n) is the least p > 0 such that b_i = b_{p+i} for i = 1..w-p.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 31 2023

Keywords

Comments

Leading zeros in binary expansions of positive integers are ignored.
This sequence is a variant of A302291 related to fractional powers of words.
For any k > 0, the value k appears A045690(k) times in a(2^(k-1)), ..., a(2^k-1).

Examples

			The first terms, alongside the binary expansion of n split into chunks of length a(n), are:
  n   a(n)  bin(n)
  --  ----  ------
   0     1  0
   1     1  1
   2     2  10
   3     1  1|1
   4     3  100
   5     2  10|1
   6     3  110
   7     1  1|1|1
   8     4  1000
   9     3  100|1
  10     2  10|10
  11     3  101|1
  12     4  1100
  13     3  110|1
  14     4  1110
  15     1  1|1|1|1
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 23.

Crossrefs

Programs

  • PARI
    a(n) = { my (b = if (n, binary(n), [0])); for (p = 1, oo, if (b[1..#b-p] == b[1+p..#b], return (p););); }

Formula

a(n) <= A302291(n).
a(n) <= A070939(n) with equality iff n belongs to A091065.
a(2^k-1) = 1 for any k >= 0.
a(2^k) = k+1 for any k >= 0.
Showing 1-8 of 8 results.