

A162535


A positive integer n is included if every length of the runs of 0's and 1's in the binary representation of n is coprime to n.


3



1, 2, 3, 5, 7, 8, 9, 10, 11, 13, 14, 15, 17, 19, 21, 23, 25, 27, 29, 31, 32, 33, 34, 35, 37, 40, 41, 42, 43, 45, 46, 47, 49, 51, 53, 55, 56, 58, 59, 61, 62, 67, 71, 73, 75, 77, 79, 83, 85, 89, 91, 97, 101, 103, 105, 107, 109, 111, 113, 115, 119, 121, 123, 127, 128, 131, 133
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

By "run" of 0's or 1's, it is meant: Think of binary n as a string of 0's and 1's. A single run of the digit b (0 or 1) is made up completely of consecutive digits all equal to b, and is bounded on its ends by either the digit 1b or by the edge of the string.


LINKS

Jasper Mulder, Table of n, a(n) for n=1..20000


EXAMPLE

103 in binary is 1100111. There is a run of two 1's in this representation, and a run of two 0's and a run of three 1's. Since 103 is coprime to each of these lengths (2 and 3), then 103 is in the sequence.


MATHEMATICA

lst = {}; For[n = 1, n <= 10000, n++, If[Fold[And, True, CoprimeQ[ #, n] & /@ (Length /@ Split[IntegerDigits[n, 2]])], Print[n]]] (* Jasper Mulder (jasper.mulder(AT)planet.nl), Jul 15 2009 *)
Select[Range[2^7], AllTrue[Length /@ Split@ IntegerDigits[#, 2], Function[k, CoprimeQ[#, k]]] &] (* Michael De Vlieger, Nov 04 2017 *)


CROSSREFS

Cf. A162534, A162537.
Sequence in context: A039103 A228082 A153088 * A279814 A047490 A039072
Adjacent sequences: A162532 A162533 A162534 * A162536 A162537 A162538


KEYWORD

base,nonn


AUTHOR

Leroy Quet, Jul 05 2009


EXTENSIONS

Terms < 10000 from Jasper Mulder (jasper.mulder(AT)planet.nl), Jul 15 2009


STATUS

approved



