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.

A065609 Positive m such that when written in binary, no rotated value of m is greater than m.

This page as a plain text file.
%I A065609 #29 May 27 2022 01:35:10
%S A065609 1,2,3,4,6,7,8,10,12,14,15,16,20,24,26,28,30,31,32,36,40,42,48,50,52,
%T A065609 54,56,58,60,62,63,64,72,80,84,96,98,100,104,106,108,112,114,116,118,
%U A065609 120,122,124,126,127,128,136,144,160,164,168,170,192,194,196,200,202
%N A065609 Positive m such that when written in binary, no rotated value of m is greater than m.
%C A065609 Rotated values of m are defined as the numbers which occur when m is shifted 1, 2, ... bits to the right with the last bits added to the front; e.g., the rotated values of 1011 are 1011, 1101, 1110 and 0111.
%C A065609 The number of k-bit binary numbers in this sequence is A008965. This gives the row lengths when the sequence is regarded as a table.
%C A065609 If m is in the sequence, then so is 2m. All odd terms are of the form 2^k - 1. - _Ivan Neretin_, Aug 04 2016
%C A065609 First differs from A328595 in lacking 44, with binary expansion {1, 0, 1, 1, 0, 0}, and 92, with binary expansion {1, 0, 1, 1, 1, 0, 0}. - _Gus Wiseman_, Oct 31 2019
%H A065609 Ivan Neretin, <a href="/A065609/b065609.txt">Table of n, a(n) for n = 1..10000</a>
%e A065609 14 is included because 14 in binary is 1110. 1110 has the rotated values of 0111, 1011 and 1101 -- 7, 11 and 13 -- which are all smaller than 14.
%p A065609 filter:= proc(n) local L, k;
%p A065609   if n::odd then return evalb(n+1 = 2^ilog2(n+1)) fi;
%p A065609   L:= convert(convert(n,binary),string);
%p A065609   for k from 1 to length(L)-1 do
%p A065609     if not lexorder(StringTools:-Rotate(L,k),L) then return false fi;
%p A065609   od;
%p A065609   true
%p A065609 end proc:
%p A065609 select(filter, [$1..1000]); # _Robert Israel_, Aug 05 2016
%t A065609 Select[Range[200], # == Max[FromDigits[#, 2] & /@ NestList[RotateLeft, dg = IntegerDigits[#, 2], Length@dg]] &] (* _Ivan Neretin_, Aug 04 2016 *)
%o A065609 (Python)
%o A065609 def ok(n):
%o A065609     b = bin(n)[2:]
%o A065609     return b > "0" and all(b[i:] + b[:i] <= b for i in range(1, len(b)))
%o A065609 print([k for k in range(203) if ok(k)]) # _Michael S. Branicky_, May 26 2022
%Y A065609 A similar concept is A328595.
%Y A065609 The version with the most significant digit ignored is A328668 or A328607.
%Y A065609 Numbers whose reversed binary expansion is a Lyndon word are A328596.
%Y A065609 Numbers whose binary expansion is aperiodic are A328594.
%Y A065609 Binary necklaces are A000031.
%Y A065609 Necklace compositions are A008965.
%Y A065609 Cf. A000031, A000120, A000740, A001037, A032153, A059966, A163381, A275692.
%K A065609 base,nonn,tabf
%O A065609 1,2
%A A065609 Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Nov 06 2001
%E A065609 Edited by _Franklin T. Adams-Watters_, Apr 09 2010