[Question]
  [
My userid is 100664. In binary this is `11000100100111000`.
An interesting property of this number is that it can be created entirely by concatenating strings which are repeated at least twice:
```
11  000  100100  111  000
```
The first few such numbers are \$3,7,10,12,15,24,28,31,36,40,42, 43, 45,48,51,53,54,56,58,60,63,80,87,96,99,103,112,115,117,120,122,124,127\$ (let me know if I've missed any as I worked these out by hand).
Your challenge is to calculate these. (Leading zeros don't count, e.g. `9 = 001001` is not part of the sequence.)
As with all [sequence](/questions/tagged/sequence "show questions tagged 'sequence'") challenges, you may either:
* Take a number \$n\$ and output the nth term
* Take a number \$n\$ and output the first n terms
* Take no input and output these forever
[Here's a reference implementation courtesy of Bubbler](https://tio.run/##hVDNaoQwEL7nKQZ6SKYrEpVehDyJyBLZaLO1MUQPWei7u6NZLfRSQhj45vtj/GP5nFy1rm8@WLeI7fOikPR4ViKyPuhhBgVNZ52w2FR1@36HfgpgwToI2g1GlFkhJe7ofUMJqLBN2nyewiK@zEON@ru7aYi1GI0TEbNI/q/cnYqsM4N1e1zc3eLmlirYHmIjW6V4wdtDlvjIdBJRJImuv8U@JNYMNO0SM/eTFxIZJLnOII0SMzDupjj8AKc1@eXae4LEQSD01e5CSRou8LdiezIUjHZexGzOhqf6n3OkXsekGriuTw)
# Scoring
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), shortest wins!
# Testcases
These are 0-indexed.
```
0 => 3
1 => 7
3 => 12
5 => 24
10 => 42
15 => 53
20 => 63
25 => 103
```
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~12~~ 11 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
BŒṖŒɠṂ’ƊƇµ#
```
A full program that accepts a positive integer, \$n\$, from STDIN and prints a list of the first \$n\$ emanresu numbers.
**[Try it online!](https://tio.run/##ASIA3f9qZWxsef//QsWS4bmWxZLJoOG5guKAmcaKxofCtSP//zMz "Jelly – Try It Online")**
### How?
```
BŒṖŒɠṂ’ƊƇµ# - Main Link: no arguments
          # - start with k=0 and count up, collecting the first n (from STDIN) k
              which are truthy under:
         µ  -   the monadic chain, f(k):
B           -     convert (k) to binary
 ŒṖ         -     all partitions (of the binary representation of k)
        Ƈ   -     filter - keep those (partitions) which are truthy under:
       Ɗ    -       last three links as a monad, f(partition):
   Œɠ       -         run-lengths of equal elements (e.g. 101,101,1,1,1,0 -> 2,3,1)
     Ṃ      -         minimum
      ’     -         decrement (vectorises) -> 0 is falsey, other numbers are truthy
                (a result of f(k) which is non-empty is truthy)
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~78~~ 71 bytes
-7 thanks to m90, wasif, and ovs
```
import re
i=1
while[re.match('..((.+)\\2+)+$',bin(i))and print(i)]:i+=1
```
[Try it online!](https://tio.run/##K6gsycjPM/7/PzO3IL@oRKEolSvT1pCrPCMzJzW6KFUvN7EkOUNDXU9PQ0NPWzMmxkhbU1tFXScpM08jU1MzMS9FoaAoM68EyIm1ytS2Nfz/HwA "Python 3 – Try It Online")
I feel like manually setting the index isn't optimal but idk how to avoid it in this situation.
Further optimizations:
Since bin(i) always prepends 0b to our string, and match always checks from the start, we can remove the slicing from [2:] and instead embed that in the regex.
By combining the match statement with an `and` for the print, it short circuits and only prints i if re.match returns something other than None.
And by wrapping the and statement in a list, it forces it to always be evaluated as true in our while condition.
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 56 bytes
```
{T`d`10`.1*$
^0*$
1$&
/^((.+)\2+)+$/&*\(`1
01
+`10
011
1
```
[Try it online!](https://tio.run/##K0otycxLNPz/vzokISXB0CBBz1BLhSvOAEgYqqhx6cdpaOhpa8YYaWtqq@iracVoJBhyGRhyaQOVAmlDLqBOAA "Retina – Try It Online") Link is to verbose version of code. Outputs the infinite sequence. Explanation:
```
{
```
Repeat forever.
```
T`d`10`.1*$
```
Increment the current binary value.
```
^0*$
1$&
```
If it overflows, carry the `1`.
```
/^((.+)\2+)+$/&
```
Is this an Emanresu number?
```
*\(`
```
If so then print the result of the rest of the program but then restore the current binary value.
```
1
01
+`10
011
1
```
Convert from binary to decimal.
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 13 bytes
```
ℕ≜{ḃ~cḅ∋₁ᵐ&!}
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/qG3Do6bGh7s6H3Ut/f@oZeqjzjnVD3c01yU/3NH6qKMbJLd1gppi7f//AA "Brachylog – Try It Online")
[Generates](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods/10753#10753) numbers infinitely.
```
ℕ≜               Choose a nonnegative integer.
   ḃ             Its binary representation
    ~c           can be partitioned such that
      ḃ          if runs of equal partitions are grouped,
         ᵐ       each group
       ∋₁        has a second element.
  {       & }    Output that integer
           !     once.
```
I had hoped to use `j` here, but it can't even get close.
[Answer]
# JavaScript, 63 bytes
```
for(n=1;;n++)/^((.+)\2+)+$/.test(n.toString(2))&&console.log(n)
```
[Try it online!](https://tio.run/##BcFRCoAgDADQy4RsjIz8CqRT9BuBiIkhW@jo@vbeE77QYyuvzt82xi0NeF@9ZyJcLgBLeDpCmharqSuwVTm0Fc7gEI2Jwl1qslUyMI7xAw)
[Answer]
# [Perl 5](https://www.perl.org/), 45 bytes
```
/^((.+)\2+)+$/&&say$.while$_=sprintf"%b",++$.
```
[Try it online!](https://tio.run/##K0gtyjH9/18/TkNDT1szxkhbU1tFX02tOLFSRa88IzMnVSXetrigKDOvJE1JNUlJR1tbRe///3/5BSWZ@XnF/3V9TfUMDAE "Perl 5 – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~17~~ 15 bytes
*Saved 2 bytes thanks to @Dudecoinheringaahing*
Takes an integer \$n\$ from STDIN and generates the first \$n\$ terms.
This is probably twice as long as it should be...
```
BŒṖ‘ḄŒɠ€ỊẸ€ẠṆø#
```
[Try it online!](https://tio.run/##y0rNyan8/9/p6KSHO6c9apjxcEfL0UknFzxqWvNwd9fDXTtAjF0LHu5sO7xD@f9/YwMA "Jelly – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), ~~16~~ 12 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ï├1mìsM`0°ö≈
```
[Run and debug it](https://staxlang.xyz/#p=8bc3316d8d734d6030f894f7&i=)
Prints the sequence forever.
-4 bytes using the partitioning idea.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 20 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Outputs the first `n` terms. It's *really* annoying me that the RegEx takes up nearly ¾ of this solution but I can't seem to come up with a shorter, non-RegEx based one :\
```
È¤è"^((.+)%2+)+$"}jU
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yKToIl4oKC4rKSUyKykrJCJ9alU&input=MTA)
```
È¤è"^((.+)%2+)+$"}jU     :Implicit input of integer U
È                        :Function taking an integer as argument
 ¤                       :  To binary string
  è                      :  Count
   "^((.+)%2+)+$"        :    RegEx /^((.+)\2+)+$/
                 }       :End function
                  jU     :Get the first U integers that return a truthy value
```
[Answer]
# [R](https://www.r-project.org/), ~~85~~ 81 bytes
```
while(T<-T+1)grepl("^((.+)\\2+)+$",Reduce(paste0,T%/%2^(0:log2(T))%%2))&&print(T)
```
[Try it online!](https://tio.run/##DcdBCoAgEADAv0jKLlqZx@gV4TGEqMUEKTGj51tzm1zre4RIYKfWygF9phSBOYBO4rIYibJhaqb92QjSehfSyvKeGwd6jJc3YBE5N4hCpBzO8r/WDw "R – Try It Online")
A regex-based solution. Prints values indefinitely.
Thanks to @pajonk for saving 4 bytes!
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 16 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
∞ʒb.œ2ìεγ€g2@P}à
```
Outputs the infinite sequence.
[Try it online.](https://tio.run/##ASQA2/9vc2FiaWX//@KInsqSYi7FkzLDrM61zrPigqxnMkBQfcOg//8)
**Explanation:**
```
∞              # Push an infinite list of positive integers: [1,2,3,...]
 ʒ             # Filter this list by:
  b            #  Convert the current integer to binary
   .œ          #  Get all partitions of this binary string
     2ì        #  Prepend a 2 before each part (this is necessary because `γ` will
               #  ignore leading 0s, and thus incorrectly group "1" and "01" together)
       ε       #  Map each partition to:
        γ      #   Group adjacent equivalent elements together
         €g    #   Get the length of each group
           2@  #   Check for each length if it's >= 2
             P #   Check if all are truthy (by taking the product)
       }à      #  After the map: check if any partition is truthy (by taking the max)
               # (after which the filtered list is output implicitly as result)
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `r`, 23 bytes
```
λbvS∑`^((.+)\\2+)+$`r;ȯ
```
[Try it Online!](https://lyxal.pythonanywhere.com?flags=r&code=%CE%BBbvS%E2%88%91%60%5E%28%28.%2B%29%5C%5C2%2B%29%2B%24%60r%3B%C8%AF&inputs=9&header=&footer=)
A juicy port of JavaScript. Man I do love me some regex in golfing languages. Takes `n` and outputs the first n terms.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 10 bytes
```
ΠøṖ'ĠvḢA)ȯ
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2&c=1#WyIiLCIiLCLOoMO44bmWJ8SgduG4okEpyK8iLCIiLCIxMCJd)
Port of Jelly.
-2 bytes thanks to emanresu A and lyxal
[Answer]
# [Julia 1.0](http://julialang.org/), 65 bytes
```
!i=replace(bitstring(i+=1),r"((.+)\2+)"=>"")>""||println(i),!i;!1
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/XzHTtii1ICcxOVUjKbOkuKQoMy9dI1Pb1lBTp0hJQ0NPWzPGSFtTydZOSUkTiGtqCoAqSnLyNDI1dRQzrRUN//8HAA "Julia 1.0 – Try It Online")
]