Skip to main content
deleted 22 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43

R, 8585 81 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",pasteReduce(paste0,T%/%2^(0:log2(T))%%2,collapse=""))&&print(T)

Try it online!Try it online!

A regex-based solution. Prints values indefinitely. I wish R had something more concise than paste(…,collapse=“”)

Thanks to @pajonk for saving 4 bytes!

R, 85 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",paste(T%/%2^(0:log2(T))%%2,collapse=""))&&print(T)

Try it online!

A regex-based solution. Prints values indefinitely. I wish R had something more concise than paste(…,collapse=“”)!

R, 85 81 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",Reduce(paste0,T%/%2^(0:log2(T))%%2))&&print(T)

Try it online!

A regex-based solution. Prints values indefinitely.

Thanks to @pajonk for saving 4 bytes!

added 87 characters in body
Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43

R, 85 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",paste(T%/%2^(0:log2(T))%%2,collapse=""))&&print(T)

Try it online!Try it online!

A regex-based solution. Prints values indefinitely. I wish R had something more concise than paste(…,collapse=“”)!

R, 85 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",paste(T%/%2^(0:log2(T))%%2,collapse=""))&&print(T)

Try it online!

A regex-based solution. Prints values indefinitely. I wish R had something more concise than paste(…,collapse=“”)!

R, 85 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",paste(T%/%2^(0:log2(T))%%2,collapse=""))&&print(T)

Try it online!

A regex-based solution. Prints values indefinitely. I wish R had something more concise than paste(…,collapse=“”)!

Source Link
Nick Kennedy
  • 21.2k
  • 3
  • 17
  • 43

R, 85 bytes

while(T<-T+1)grepl("^((.+)\\2+)+$",paste(T%/%2^(0:log2(T))%%2,collapse=""))&&print(T)

Try it online!

A regex-based solution. Prints values indefinitely. I wish R had something more concise than paste(…,collapse=“”)!