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

A328596 Numbers whose reversed binary expansion is a Lyndon word (aperiodic necklace).

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 44, 48, 52, 56, 58, 60, 62, 64, 72, 80, 84, 88, 92, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 128, 144, 152, 160, 164, 168, 172, 176, 180, 184, 188, 192, 200, 208, 212, 216, 218, 220, 224
Offset: 1

Views

Author

Gus Wiseman, Oct 22 2019

Keywords

Comments

First differs from A091065 in lacking 50.
A Lyndon word is a finite sequence that is lexicographically strictly less than all of its cyclic rotations.

Examples

			The sequence of terms together with their binary expansions and binary indices begins:
   1:      1 ~ {1}
   2:     10 ~ {2}
   4:    100 ~ {3}
   6:    110 ~ {2,3}
   8:   1000 ~ {4}
  12:   1100 ~ {3,4}
  14:   1110 ~ {2,3,4}
  16:  10000 ~ {5}
  20:  10100 ~ {3,5}
  24:  11000 ~ {4,5}
  26:  11010 ~ {2,4,5}
  28:  11100 ~ {3,4,5}
  30:  11110 ~ {2,3,4,5}
  32: 100000 ~ {6}
  40: 101000 ~ {4,6}
  44: 101100 ~ {3,4,6}
  48: 110000 ~ {5,6}
  52: 110100 ~ {3,5,6}
  56: 111000 ~ {4,5,6}
  58: 111010 ~ {2,4,5,6}
		

Crossrefs

A similar concept is A275692.
Aperiodic words are A328594.
Necklaces are A328595.
Binary Lyndon words are A001037.
Lyndon compositions are A059966.

Programs

  • Mathematica
    aperQ[q_]:=Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Select[Range[100],aperQ[Reverse[IntegerDigits[#,2]]]&&neckQ[Reverse[IntegerDigits[#,2]]]&]

Formula

Intersection of A328594 and A328595.

A275692 Numbers k such that every rotation of the binary digits of k is less than k.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 14, 16, 20, 24, 26, 28, 30, 32, 40, 48, 50, 52, 56, 58, 60, 62, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 128, 144, 160, 164, 168, 192, 194, 196, 200, 202, 208, 210, 212, 216, 218, 224, 226, 228
Offset: 1

Views

Author

Robert Israel, Aug 05 2016

Keywords

Comments

0, and terms of A065609 that are not in A121016.
Number of terms with d binary digits is A001037(d).
Take the binary representation of a(n), reverse it, add 1 to each digit. The result is the decimal representation of A102659(n).
From Gus Wiseman, Apr 19 2020: (Start)
Also numbers k such that the k-th composition in standard order (row k of A066099) is a Lyndon word. For example, the sequence of all Lyndon words begins:
0: () 52: (1,2,3) 118: (1,1,2,1,2)
1: (1) 56: (1,1,4) 120: (1,1,1,4)
2: (2) 58: (1,1,2,2) 122: (1,1,1,2,2)
4: (3) 60: (1,1,1,3) 124: (1,1,1,1,3)
6: (1,2) 62: (1,1,1,1,2) 126: (1,1,1,1,1,2)
8: (4) 64: (7) 128: (8)
12: (1,3) 72: (3,4) 144: (3,5)
14: (1,1,2) 80: (2,5) 160: (2,6)
16: (5) 84: (2,2,3) 164: (2,3,3)
20: (2,3) 96: (1,6) 168: (2,2,4)
24: (1,4) 98: (1,4,2) 192: (1,7)
26: (1,2,2) 100: (1,3,3) 194: (1,5,2)
28: (1,1,3) 104: (1,2,4) 196: (1,4,3)
30: (1,1,1,2) 106: (1,2,2,2) 200: (1,3,4)
32: (6) 108: (1,2,1,3) 202: (1,3,2,2)
40: (2,4) 112: (1,1,5) 208: (1,2,5)
48: (1,5) 114: (1,1,3,2) 210: (1,2,3,2)
50: (1,3,2) 116: (1,1,2,3) 212: (1,2,2,3)
(End)

Examples

			6 is in the sequence because its binary representation 110 is greater than all the rotations 011 and 101.
10 is not in the sequence because its binary representation 1010 is unchanged under rotation by 2 places.
From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
    1:       1 ~ {1}
    2:      10 ~ {2}
    4:     100 ~ {3}
    6:     110 ~ {2,3}
    8:    1000 ~ {4}
   12:    1100 ~ {3,4}
   14:    1110 ~ {2,3,4}
   16:   10000 ~ {5}
   20:   10100 ~ {3,5}
   24:   11000 ~ {4,5}
   26:   11010 ~ {2,4,5}
   28:   11100 ~ {3,4,5}
   30:   11110 ~ {2,3,4,5}
   32:  100000 ~ {6}
   40:  101000 ~ {4,6}
   48:  110000 ~ {5,6}
   50:  110010 ~ {2,5,6}
   52:  110100 ~ {3,5,6}
   56:  111000 ~ {4,5,6}
   58:  111010 ~ {2,4,5,6}
(End)
		

Crossrefs

A similar concept is A328596.
Numbers whose binary expansion is aperiodic are A328594.
Numbers whose reversed binary expansion is a necklace are A328595.
Binary necklaces are A000031.
Binary Lyndon words are A001037.
Lyndon compositions are A059966.
Length of Lyndon factorization of binary expansion is A211100.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
Length of co-Lyndon factorization of reversed binary expansion is A329326.
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.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692 (this sequence).
- Co-Lyndon compositions are A326774.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Co-Lyndon factorizations are counted by A333765.
- Lyndon factorizations are counted by A333940.
- Reversed necklaces are A333943.

Programs

  • Maple
    filter:= proc(n) local L, k;
      L:= convert(convert(n,binary),string);
      for k from 1 to length(L)-1 do
        if lexorder(L,StringTools:-Rotate(L,k)) then return false fi;
      od;
      true
    end proc:
    select(filter, [$0..1000]);
  • Mathematica
    filterQ[n_] := Module[{bits, rr}, bits = IntegerDigits[n, 2]; rr = NestList[RotateRight, bits, Length[bits]-1] // Rest; AllTrue[rr, FromDigits[#, 2] < n&]];
    Select[Range[0, 1000], filterQ] (* Jean-François Alcover, Apr 29 2019 *)
  • Python
    def ok(n):
        b = bin(n)[2:]
        return all(b[i:] + b[:i] < b for i in range(1, len(b)))
    print([k for k in range(230) if ok(k)]) # Michael S. Branicky, May 26 2022

A328594 Numbers whose binary expansion is aperiodic.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 37, 38, 39, 40, 41, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77
Offset: 1

Views

Author

Gus Wiseman, Oct 22 2019

Keywords

Comments

A finite sequence is aperiodic if all of its cyclic rotations are distinct. See A000740 or A027375 for details.
Also numbers k such that the k-th composition in standard order is aperiodic. 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. - Gus Wiseman, Apr 28 2020

Examples

			The sequence of terms together with their binary expansions and binary indices begins:
   0:     0 ~ {}
   1:     1 ~ {1}
   2:    10 ~ {2}
   4:   100 ~ {3}
   5:   101 ~ {1,3}
   6:   110 ~ {2,3}
   8:  1000 ~ {4}
   9:  1001 ~ {1,4}
  11:  1011 ~ {1,2,4}
  12:  1100 ~ {3,4}
  13:  1101 ~ {1,3,4}
  14:  1110 ~ {2,3,4}
  16: 10000 ~ {5}
  17: 10001 ~ {1,5}
  18: 10010 ~ {2,5}
  19: 10011 ~ {1,2,5}
  20: 10100 ~ {3,5}
  21: 10101 ~ {1,3,5}
  22: 10110 ~ {2,3,5}
  23: 10111 ~ {1,2,3,5}
  24: 11000 ~ {4,5}
		

Crossrefs

The complement is A121016.
The version for prime indices is A085971.
Numbers without proper integer roots are A007916.
Necklaces are A328595.
Lyndon words are A328596.
Aperiodic compositions are A000740.
Aperiodic binary sequences are A027375.

Programs

  • Mathematica
    aperQ[q_]:=Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    Select[Range[0,100],aperQ[IntegerDigits[#,2]]&]

A328592 Numbers whose binary expansion has all different lengths of runs of 1's.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 11, 12, 13, 14, 15, 16, 19, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 35, 38, 39, 44, 46, 47, 48, 49, 50, 52, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 67, 70, 71, 76, 78, 79, 88, 92, 94, 95, 96, 97, 98, 100, 103, 104, 110, 111, 112, 113, 114
Offset: 1

Views

Author

Gus Wiseman, Oct 20 2019

Keywords

Comments

Also numbers whose binary indices have different lengths of runs of successive parts. A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
The complement is {5, 9, 10, 17, 18, 20, 21, 27, ...}.

Examples

			The sequence of terms together with their binary expansions and binary indices begins:
   0:     0 ~ {}
   1:     1 ~ {1}
   2:    10 ~ {2}
   3:    11 ~ {1,2}
   4:   100 ~ {3}
   6:   110 ~ {2,3}
   7:   111 ~ {1,2,3}
   8:  1000 ~ {4}
  11:  1011 ~ {1,2,4}
  12:  1100 ~ {3,4}
  13:  1101 ~ {1,3,4}
  14:  1110 ~ {2,3,4}
  15:  1111 ~ {1,2,3,4}
  16: 10000 ~ {5}
  19: 10011 ~ {1,2,5}
  22: 10110 ~ {2,3,5}
  23: 10111 ~ {1,2,3,5}
  24: 11000 ~ {4,5}
  25: 11001 ~ {1,4,5}
  26: 11010 ~ {2,4,5}
		

Crossrefs

The version for prime indices is A130091.
The binary expansion of n has A069010(n) runs of 1's.
The lengths of runs of 1's in the binary expansion of n are row n of A245563.
Numbers whose binary expansion has equal lengths of runs of 1's are A164707.

Programs

  • Mathematica
    Select[Range[0,100],UnsameQ@@Length/@Split[Join@@Position[Reverse[IntegerDigits[#,2]],1],#2==#1+1&]&]

A178472 Number of compositions (ordered partitions) of n where the gcd of the part sizes is not 1.

Original entry on oeis.org

0, 1, 1, 2, 1, 5, 1, 8, 4, 17, 1, 38, 1, 65, 19, 128, 1, 284, 1, 518, 67, 1025, 1, 2168, 16, 4097, 256, 8198, 1, 16907, 1, 32768, 1027, 65537, 79, 133088, 1, 262145, 4099, 524408, 1, 1056731, 1, 2097158, 16636, 4194305, 1, 8421248, 64, 16777712, 65539
Offset: 1

Views

Author

Keywords

Comments

Of course, all part sizes must be greater than 1; that condition alone gives the Fibonacci numbers, which is thus an upper bound.
Also the number of periodic compositions of n, where a sequence is periodic if its cyclic rotations are not all different. Also compositions with non-relatively prime run-lengths. - Gus Wiseman, Nov 10 2019

Examples

			For n=6, we have 5 compositions: <6>, <4,2>, <2,4>, <2,2,2>, and <3,3>.
From _Gus Wiseman_, Nov 10 2019: (Start)
The a(2) = 1 through a(9) = 4 non-relatively prime compositions:
  (2)  (3)  (4)    (5)  (6)      (7)  (8)        (9)
            (2,2)       (2,4)         (2,6)      (3,6)
                        (3,3)         (4,4)      (6,3)
                        (4,2)         (6,2)      (3,3,3)
                        (2,2,2)       (2,2,4)
                                      (2,4,2)
                                      (4,2,2)
                                      (2,2,2,2)
The a(2) = 1 through a(9) = 4 periodic compositions:
  11  111  22    11111  33      1111111  44        333
           1111         222              1313      121212
                        1212             2222      212121
                        2121             3131      111111111
                        111111           112112
                                         121121
                                         211211
                                         11111111
The a(2) = 1 through a(9) = 4 compositions with non-relatively prime run-lengths:
  11  111  22    11111  33      1111111  44        333
           1111         222              1133      111222
                        1122             2222      222111
                        2211             3311      111111111
                        111111           111122
                                         112211
                                         221111
                                         11111111
(End)
		

Crossrefs

Periodic binary words are A152061.

Programs

  • Maple
    A178472 := n -> (2^n - add(mobius(n/d)*2^d, d in divisors(n)))/2:
    seq(A178472(n), n=1..51); # Peter Luschny, Jan 21 2018
  • Mathematica
    Table[2^(n - 1) - DivisorSum[n, MoebiusMu[n/#]*2^(# - 1) &], {n, 51}] (* Michael De Vlieger, Jan 20 2018 *)
  • PARI
    vector(60,n,2^(n-1)-sumdiv(n,d,2^(d-1)*moebius(n/d)))
    
  • Python
    from sympy import mobius, divisors
    def A178472(n): return -sum(mobius(n//d)<Chai Wah Wu, Sep 21 2024

Formula

a(n) = Sum_{d|n & d
a(n) = 2^(n-1) - A000740(n).
a(n) = A152061(n)/2. - George Beck, Jan 20 2018
a(p) = 1 for p prime. - Chai Wah Wu, Sep 21 2024

Extensions

Ambiguous term a(0) removed by Max Alekseyev, Jan 02 2012

A020330 Numbers whose base-2 representation is the juxtaposition of two identical strings.

Original entry on oeis.org

3, 10, 15, 36, 45, 54, 63, 136, 153, 170, 187, 204, 221, 238, 255, 528, 561, 594, 627, 660, 693, 726, 759, 792, 825, 858, 891, 924, 957, 990, 1023, 2080, 2145, 2210, 2275, 2340, 2405, 2470, 2535, 2600, 2665, 2730, 2795, 2860, 2925, 2990, 3055, 3120, 3185, 3250
Offset: 1

Author

David W. Wilson, Melia Aldridge (ma38(AT)spruce.evansville.edu)

Keywords

Comments

All differences are in union of A000051 and A001576. - Vladimir Shevelev, Dec 07 2013

Examples

			36 is a term because 36 = 100100_2, which is 100 followed by 100.
		

Crossrefs

Subsequence of A121016.
Column k=0 of A246830, column k=1 of A246834.

Programs

  • Haskell
    a020330 n = foldr (\d v -> 2 * v + d) 0 (bs ++ bs) where
       bs = a030308_row n
    -- Reinhard Zumkeller, Feb 19 2013
    
  • Magma
    [n+2*n*2^Floor(Log(2, n)): n in [1..50]]; // Vincenzo Librandi, Apr 05 2018
    
  • Maple
    a:= n-> (l-> Bits[Join]([l[],l[]]))(Bits[Split](n)):
    seq(a(n), n=1..50);  # Alois P. Heinz, Aug 24 2024
  • Mathematica
    Table[n + 2 n 2^Floor[Log[2, n]], {n, 50}] (* T. D. Noe, Dec 10 2013 *)
    FromDigits[#, 2] & /@ (# <> # & /@ IntegerString[Range@100, 2]) (* Hans Rudolf Widmer, Aug 24 2024 *)
  • PARI
    a(n)=n+n<<#binary(n) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    is(n)=my(L=#binary(n)\2); n>>L==bitand(n,2^L-1) \\ Charles R Greathouse IV, Mar 29 2013
    
  • Python
    def a(n): return int(bin(n)[2:]*2, 2)
    print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Mar 10 2021
    
  • Python
    def A020330(n): return (n<Chai Wah Wu, Feb 28 2023

Formula

a(n) = n + 2*n*2^floor(log_2(n)). - Ralf Stephan, Dec 07 2004
Sum_{n>=1} 1/a(n) = A330157. - Amiram Eldar, Oct 22 2020
a(n) = n * (2^A070939(n) + 1). - Jianing Song, Apr 10 2021

A164707 A positive integer n is included if all runs of 1's in binary n are of the same length.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 24, 27, 28, 30, 31, 32, 33, 34, 36, 37, 40, 41, 42, 48, 51, 54, 56, 60, 62, 63, 64, 65, 66, 68, 69, 72, 73, 74, 80, 81, 82, 84, 85, 96, 99, 102, 108, 112, 119, 120, 124, 126, 127, 128, 129, 130, 132, 133, 136
Offset: 1

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.
This sequence contains in part positive integers that each contain one run of 1's. For those members of this sequence each with at least two runs of 1's, see A164709.

Examples

			From _Gus Wiseman_, Oct 31 2019: (Start)
The sequence of terms together with their binary expansions and binary indices begins:
   1:      1 ~ {1}
   2:     10 ~ {2}
   3:     11 ~ {1,2}
   4:    100 ~ {3}
   5:    101 ~ {1,3}
   6:    110 ~ {2,3}
   7:    111 ~ {1,2,3}
   8:   1000 ~ {4}
   9:   1001 ~ {1,4}
  10:   1010 ~ {2,4}
  12:   1100 ~ {3,4}
  14:   1110 ~ {2,3,4}
  15:   1111 ~ {1,2,3,4}
  16:  10000 ~ {5}
  17:  10001 ~ {1,5}
  18:  10010 ~ {2,5}
  20:  10100 ~ {3,5}
  21:  10101 ~ {1,3,5}
  24:  11000 ~ {4,5}
  27:  11011 ~ {1,2,4,5}
(End)
		

Crossrefs

The version for prime indices is A072774.
The binary expansion of n has A069010(n) runs of 1's.
Numbers whose runs are all of different lengths are A328592.
Partitions with equal multiplicities are A047966.
Numbers whose binary expansion is aperiodic are A328594.
Numbers whose reversed binary expansion is a necklace are A328595.
Numbers whose reversed binary expansion is a Lyndon word are A328596.

Programs

  • Maple
    isA164707 := proc(n) local bdg,arl,lset ; bdg := convert(n,base,2) ; lset := {} ; arl := -1 ; for p from 1 to nops(bdg) do if op(p,bdg) = 1 then if p = 1 then arl := 1 ; else arl := arl+1 ; end if; else if arl > 0 then lset := lset union {arl} ; end if; arl := 0 ; end if; end do ; if arl > 0 then lset := lset union {arl} ; end if; return (nops(lset) <= 1 ); end proc: for n from 1 to 300 do if isA164707(n) then printf("%d,",n) ; end if; end do; # R. J. Mathar, Feb 27 2010
  • Mathematica
    Select[Range@ 140, SameQ @@ Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 1 &]] &] (* Michael De Vlieger, Aug 20 2017 *)
  • Perl
    foreach(1..140){
        %runs=();
        $runs{$}++ foreach split /0+/, sprintf("%b",$);
        print "$_, " if 1==keys(%runs);
    }
    # Ivan Neretin, Nov 09 2015

Extensions

Extended beyond 42 by R. J. Mathar, Feb 27 2010

A329313 Length of the Lyndon factorization of the reversed binary expansion of n.

Original entry on oeis.org

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

Author

Gus Wiseman, Nov 11 2019

Keywords

Comments

We define the Lyndon product of two or more finite sequences to be the lexicographically maximal sequence obtainable by shuffling the sequences together. For example, the Lyndon product of (231) with (213) is (232131), the product of (221) with (213) is (222131), and the product of (122) with (2121) is (2122121). A Lyndon word is a finite sequence that is prime with respect to the Lyndon product. Every finite sequence has a unique (orderless) factorization into Lyndon words, and if these factors are arranged in lexicographically decreasing order, their concatenation is equal to their Lyndon product. For example, (1001) has sorted Lyndon factorization (001)(1).

Examples

			The sequence of reversed binary expansions of the nonnegative integers together with their Lyndon factorizations begins:
   0:      () = ()
   1:     (1) = (1)
   2:    (01) = (01)
   3:    (11) = (1)(1)
   4:   (001) = (001)
   5:   (101) = (1)(01)
   6:   (011) = (011)
   7:   (111) = (1)(1)(1)
   8:  (0001) = (0001)
   9:  (1001) = (1)(001)
  10:  (0101) = (01)(01)
  11:  (1101) = (1)(1)(01)
  12:  (0011) = (0011)
  13:  (1011) = (1)(011)
  14:  (0111) = (0111)
  15:  (1111) = (1)(1)(1)(1)
  16: (00001) = (00001)
  17: (10001) = (1)(0001)
  18: (01001) = (01)(001)
  19: (11001) = (1)(1)(001)
  20: (00101) = (00101)
		

Crossrefs

The non-reversed version is A211100.
Positions of 1's are A328596.
The "co" version is A329326.
Binary Lyndon words are counted by A001037 and ranked by A102659.
Numbers whose reversed binary expansion is a necklace are A328595.
Numbers whose reversed binary expansion is a aperiodic are A328594.
Length of the co-Lyndon factorization of the binary expansion is A329312.

Programs

  • Mathematica
    lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And];
    lynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[lynfac[Drop[q,i]],Take[q,i]]][Last[Select[Range[Length[q]],lynQ[Take[q,#1]]&]]]];
    Table[If[n==0,0,Length[lynfac[Reverse[IntegerDigits[n,2]]]]],{n,0,30}]

A326774 For any number m, let m* be the bi-infinite string obtained by repetition of the binary representation of m; this sequence lists the numbers n such that for any k < n, n* does not equal k* up to a shift.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 11, 16, 17, 18, 19, 21, 23, 32, 33, 34, 35, 37, 38, 39, 43, 47, 64, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 77, 78, 79, 85, 87, 91, 95, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 146, 147, 149, 150, 151, 154
Offset: 0

Author

Rémy Sigrist, Jul 27 2019

Keywords

Comments

This sequence contains every power of 2.
No term belongs to A121016.
Every terms belongs to A004761.
For any k > 0, there are A001037(k) terms with binary length k.
From Gus Wiseman, Apr 19 2020: (Start)
Also numbers k such that the k-th composition in standard order (row k of A066099) is a co-Lyndon word (regular Lyndon words being A275692). For example, the sequence of all co-Lyndon words begins:
0: () 37: (3,2,1) 79: (3,1,1,1,1)
1: (1) 38: (3,1,2) 85: (2,2,2,1)
2: (2) 39: (3,1,1,1) 87: (2,2,1,1,1)
4: (3) 43: (2,2,1,1) 91: (2,1,2,1,1)
5: (2,1) 47: (2,1,1,1,1) 95: (2,1,1,1,1,1)
8: (4) 64: (7) 128: (8)
9: (3,1) 65: (6,1) 129: (7,1)
11: (2,1,1) 66: (5,2) 130: (6,2)
16: (5) 67: (5,1,1) 131: (6,1,1)
17: (4,1) 68: (4,3) 132: (5,3)
18: (3,2) 69: (4,2,1) 133: (5,2,1)
19: (3,1,1) 70: (4,1,2) 134: (5,1,2)
21: (2,2,1) 71: (4,1,1,1) 135: (5,1,1,1)
23: (2,1,1,1) 73: (3,3,1) 137: (4,3,1)
32: (6) 74: (3,2,2) 138: (4,2,2)
33: (5,1) 75: (3,2,1,1) 139: (4,2,1,1)
34: (4,2) 77: (3,1,2,1) 140: (4,1,3)
35: (4,1,1) 78: (3,1,1,2) 141: (4,1,2,1)
(End)

Examples

			3* = ...11... equals 1* = ...1..., so 3 is not a term.
6* = ...110... equals up to a shift 5* = ...101..., so 6 is not a term.
11* = ...1011... only equals up to a shift 13* = ...1101... and 14* = ...1110..., so 11 is a term.
		

Crossrefs

Necklace compositions are counted by A008965.
Lyndon compositions are counted by A059966.
Length of Lyndon factorization of binary expansion is A211100.
Numbers whose reversed binary expansion is a necklace are A328595.
Length of co-Lyndon factorization of binary expansion is A329312.
Length of Lyndon factorization of reversed binary expansion is A329313.
Length of co-Lyndon factorization of reversed binary expansion is A329326.
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.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Lyndon compositions are A275692.
- Co-Lyndon compositions are A326774 (this sequence).
- Aperiodic compositions are A328594.
- Reversed co-necklaces are A328595.
- Rotational period is A333632.
- Co-necklaces are A333764.
- Co-Lyndon factorizations are counted by A333765.
- Lyndon factorizations are counted by A333940.
- Reversed necklaces are A333943.
- Length of co-Lyndon factorization is A334029.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    colynQ[q_]:=Length[q]==0||Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    Select[Range[0,100],colynQ[stc[#]]&] (* Gus Wiseman, Apr 19 2020 *)
  • PARI
    See Links section.

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

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).
Showing 1-10 of 29 results. Next