The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A302291 a(n) is the period of the binary expansion of n. 9
 1, 1, 2, 1, 3, 3, 3, 1, 4, 4, 2, 4, 4, 4, 4, 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 2, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS Zero is assumed to be represented as 0; otherwise, leading zeros are ignored. See A302295 for the variant where leading zeros are allowed. LINKS Rémy Sigrist, Table of n, a(n) for n = 0..10000 Index entries for sequences related to binary expansion of n FORMULA a(n) = A070939(n) / A138904(n). a(2^n) = n + 1 for any n >= 0. a(2^n - 1) = 1 for any n >= 0. a(A020330(n)) = a(n) for any n > 0. EXAMPLE 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 3 (101) 6 3 (110) 7 1 (1)(1)(1) 8 4 (1000) 9 4 (1001) 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 5 (10001) 18 5 (10010) 19 5 (10011) 20 5 (10100) MATHEMATICA Table[If[n==0, 1, Length[Union[Array[RotateRight[IntegerDigits[n, 2], #]&, IntegerLength[n, 2]]]]], {n, 0, 50}] (* Gus Wiseman, Apr 19 2020 *) PROG (PARI) a(n) = my (l=max(1, #binary(n))); fordiv (l, w, if (#Set(digits(n, 2^w))<=1, return (w))) 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. 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. - 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. - Co-necklaces are A333764. - Reversed necklaces are A333943. Cf. A000031, A001037, A008965, A019536, A020330, A211100, A302295, A328595, A328596, A329312, A329313, A329326. Sequence in context: A303119 A039775 A373953 * A300510 A361079 A302439 Adjacent sequences: A302288 A302289 A302290 * A302292 A302293 A302294 KEYWORD nonn,base,easy AUTHOR Rémy Sigrist, Apr 04 2018 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified July 21 12:49 EDT 2024. Contains 374474 sequences. (Running on oeis4.)