%I #10 Oct 31 2019 14:32:32
%S 3,7,10,15,31,36,42,45,54,63,127,136,153,170,187,204,221,238,255,292,
%T 365,438,511,528,561,594,627,660,682,693,726,759,792,825,858,891,924,
%U 957,990,1023,2047,2080,2145,2184,2210,2275,2340,2405,2457,2470,2535
%N Numbers whose binary expansion is properly periodic.
%C A finite sequence is aperiodic if its cyclic rotations are all different. - _Gus Wiseman_, Oct 31 2019
%H Charles R Greathouse IV, <a href="/A121016/b121016.txt">Table of n, a(n) for n = 1..10000</a>
%e For example, 204=(1100 1100)_2 and 292=(100 100 100)_2 belong to the sequence, but 30=(11110)_2 cannot be split into repeating periods.
%e From _Gus Wiseman_, Oct 31 2019: (Start)
%e The sequence of terms together with their binary expansions and binary indices begins:
%e 3: 11 ~ {1,2}
%e 7: 111 ~ {1,2,3}
%e 10: 1010 ~ {2,4}
%e 15: 1111 ~ {1,2,3,4}
%e 31: 11111 ~ {1,2,3,4,5}
%e 36: 100100 ~ {3,6}
%e 42: 101010 ~ {2,4,6}
%e 45: 101101 ~ {1,3,4,6}
%e 54: 110110 ~ {2,3,5,6}
%e 63: 111111 ~ {1,2,3,4,5,6}
%e 127: 1111111 ~ {1,2,3,4,5,6,7}
%e 136: 10001000 ~ {4,8}
%e 153: 10011001 ~ {1,4,5,8}
%e 170: 10101010 ~ {2,4,6,8}
%e 187: 10111011 ~ {1,2,4,5,6,8}
%e 204: 11001100 ~ {3,4,7,8}
%e 221: 11011101 ~ {1,3,4,5,7,8}
%e 238: 11101110 ~ {2,3,4,6,7,8}
%e 255: 11111111 ~ {1,2,3,4,5,6,7,8}
%e 292: 100100100 ~ {3,6,9}
%e (End)
%t PeriodicQ[n_, base_] := Block[{l = IntegerDigits[n, base]}, MemberQ[ RotateLeft[l, # ] & /@ Most@ Divisors@ Length@l, l]]; Select[ Range@2599, PeriodicQ[ #, 2] &]
%o (PARI) is(n)=n=binary(n);fordiv(#n,d,for(i=1,#n/d-1, for(j=1,d, if(n[j]!=n[j+i*d], next(3)))); return(d<#n)) \\ _Charles R Greathouse IV_, Dec 10 2013
%Y A020330 is a subsequence.
%Y Numbers whose binary expansion is aperiodic are A328594.
%Y Numbers whose reversed binary expansion is Lyndon are A328596.
%Y Numbers whose binary indices have equal run-lengths are A164707.
%Y Cf. A000120, A003714, A014081, A065609, A069010, A275692, A328595.
%K base,easy,nonn
%O 1,1
%A _Jacob A. Siehler_, Sep 08 2006
|