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.

A328595 Numbers whose reversed binary expansion is a necklace.

This page as a plain text file.
%I A328595 #16 May 24 2024 16:22:37
%S A328595 1,2,3,4,6,7,8,10,12,14,15,16,20,24,26,28,30,31,32,36,40,42,44,48,52,
%T A328595 54,56,58,60,62,63,64,72,80,84,88,92,96,100,104,106,108,112,116,118,
%U A328595 120,122,124,126,127,128,136,144,152,160,164,168,170,172,176,180
%N A328595 Numbers whose reversed binary expansion is a necklace.
%C A328595 A necklace is a finite sequence that is lexicographically minimal among all of its cyclic rotations.
%H A328595 John Tyler Rascoe, <a href="/A328595/b328595.txt">Table of n, a(n) for n = 1..10000</a>
%e A328595 The sequence of terms together with their binary expansions and binary indices begins:
%e A328595    1:      1 ~ {1}
%e A328595    2:     10 ~ {2}
%e A328595    3:     11 ~ {1,2}
%e A328595    4:    100 ~ {3}
%e A328595    6:    110 ~ {2,3}
%e A328595    7:    111 ~ {1,2,3}
%e A328595    8:   1000 ~ {4}
%e A328595   10:   1010 ~ {2,4}
%e A328595   12:   1100 ~ {3,4}
%e A328595   14:   1110 ~ {2,3,4}
%e A328595   15:   1111 ~ {1,2,3,4}
%e A328595   16:  10000 ~ {5}
%e A328595   20:  10100 ~ {3,5}
%e A328595   24:  11000 ~ {4,5}
%e A328595   26:  11010 ~ {2,4,5}
%e A328595   28:  11100 ~ {3,4,5}
%e A328595   30:  11110 ~ {2,3,4,5}
%e A328595   31:  11111 ~ {1,2,3,4,5}
%e A328595   32: 100000 ~ {6}
%e A328595   36: 100100 ~ {3,6}
%t A328595 neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
%t A328595 Select[Range[100],neckQ[Reverse[IntegerDigits[#,2]]]&]
%o A328595 (Python)
%o A328595 from itertools import count, islice
%o A328595 from sympy.utilities.iterables import necklaces
%o A328595 def a_gen():
%o A328595     for n in count(1):
%o A328595         t = []
%o A328595         for i in necklaces(n,2):
%o A328595             if sum(i)>0:
%o A328595                 t.append(sum(2**j for j in range(len(i)) if i[j] > 0))
%o A328595         yield from sorted(t)
%o A328595 A328595_list = list(islice(a_gen(), 100)) # _John Tyler Rascoe_, May 24 2024
%Y A328595 A similar concept is A065609.
%Y A328595 The version with the most significant digit ignored is A328607.
%Y A328595 Lyndon words are A328596.
%Y A328595 Aperiodic words are A328594.
%Y A328595 Binary necklaces are A000031.
%Y A328595 Necklace compositions are A008965.
%Y A328595 Cf. A000120, A000740, A001037, A032153, A059966, A275692, A328668.
%K A328595 nonn,base
%O A328595 1,2
%A A328595 _Gus Wiseman_, Oct 22 2019