g | x | w | all
Bytes Lang Time Link
052Python250312T224802Zxnor
007Nekomata250313T020729Zalephalp
1961250313T205203ZGaner
028x8664 machine code250313T173149Zm90
036Ruby250313T073741ZG B
102APLNARS250313T073434ZRosario
008Jelly250312T152153ZJonathan
028Charcoal250312T225751ZNeil
01005AB1E250312T145454ZKevin Cr
094Python250312T202126ZUsername
065Retina 0.8.2250312T200938ZNeil
079R250312T192412Zpajonk
100Maple250312T191918Zdharr
044Perl 5250312T162151ZXcali
054JavaScript V8250312T131438ZArnauld

Python, 52 bytes

n=1
while s:=f"{n:b}":s in(s*2)[1:-1]!=print(n);n+=1

Try it online!

Prints A121016 forever.

Nekomata, 7 bytes

Ňᵗ{ƂJŁ≡

Attempt This Online!

Takes no input and outputs every number in the sequence A328594. You can use the flag -l to limit the number of outputs. For example, -l 20 will output the first 20 terms.

Ňᵗ{ƂJŁ≡
Ň           Find a natural number
 ᵗ{         that does not satisfy the following:
   Ƃ            Binary representation
    J           Non-deterministic split into a list of lists
     Ł          Check if there are more than one list
      ≡         Check if all lists are equal

The original answer that printed A121016 (Ňᵖ{ƂJŁ≡) was incorrect, because when a number can satisfy the condition in multiple ways, the program will output the number multiple times.I fixed this by changing to , and printing A328594 instead.

, 19 chars (61 bytes)

Solution

⋁○󷺹󷹜²ᑀ🃌¶⁺󷸹󷰾󰈲󰲡⟞ₓᚤſⴴ

Note: ☾ uses a custom font, but you can run this code in the Web UI

Diagram

x86-64 machine code, 28 bytes

31 C0 FF C0 89 C2 0F BD F0 8D 4E 01 0F B3 F2 11 D2 39 D0 E0 F7 E3 EB FF CF 79 E7 C3

Try it online!

Following the standard calling convention for Unix-like systems (from the System V AMD64 ABI), this takes a number n in EDI and returns the 1-indexed nth properly periodic number in EAX.

In assembly:

f:  xor eax, eax    # Set EAX to 0. EAX will hold the number being tried.
n:  inc eax         # Add 1 to EAX.
    mov edx, eax    # Set EDX to the same number as EAX.
    bsr esi, eax    # Set ESI to the highest position of a 1 bit in EAX.
    lea ecx, [rsi + 1]  # Set RCX to 1 more than that: the number of bits.
r:  btr edx, esi    # Set the bit at position ESI in EDX to 0.
                    #  Set CF to the previous value of that bit.
    adc edx, edx    # Add EDX+CF to EDX, reinserting the bit at the end.
    cmp eax, edx    # Compare EAX and EDX.
    loopne r        # Decrease RCX by 1, and jump back if
                    #  it is nonzero and the comparison was not equal.
    jrcxz n         # Jump if RCX=0 (no equal rotation).
    dec edi         # Subtract 1 from EDI, counting down from the index.
    jns n           # Jump if the result is nonnegative.
    ret             # Return.

Ruby, 36 bytes

1.step{|x|/^(.+)\1+$/=~"%b"%x&&p(x)}

Try it online!

APL(NARS), 102 chars

r←f w;i;c
i←3⋄r←⍬⋄c←0
→0×⍳c≥w⋄→3×⍳∼{l←≢a←{⍵⊤⍨2⍴⍨1+⌊2⍟⍵}⍵⋄∨/{a≡⍵⌽a}¨b/⍨0=l∣⍨b←⍳l-1}i⋄c+←1⋄r,←i
i+←1⋄→2

//10+12+72+8 =102

The function f would return the array of lenght its argument, of numbers that are 'periodic'. This function {⍵⊤⍨2⍴⍨1+⌊2⍟⍵} traslate in binary the number of its argument. The 3th line would search for each number i in the divirsors of ≢a the one q that is true a≡q⌽a,if that number exist return 1 else return 0.

  f 19
3 7 10 15 31 36 42 45 54 63 127 136 153 170 187 204 221 238 255 

Jelly, 8 bytes

BṙJ$QƑƊ#

A full program that reads a positive integer, \$n\$, from stdin and prints Jelly's list representation of the first \$n\$ nonnegative integers whose binary expansion is aperiodic (A328594).

Try it online!

How?

BṙJ$QƑƊ# - Main Link: no arguments
       # - count up from K=0 to find the first {N = stdin} K for which:
      Ɗ  -   last three links as a monad - f(K):
B        -     convert {K} to binary -> B
   $     -     last two links as a monad - f(B):
  J      -       indices of B -> [1..length(B)]
 ṙ       -       rotate {B} left by {those}
     Ƒ   -     is {that list of lists} invariant under?
    Q    -       deduplicate

A121016, 8 bytes

BṙJṖiƲ$#

Similar to the above. Makes the non-identity rotations and checks for existence with i (first 1-indexed index, or zero) TIO

Charcoal, 34 28 bytes

MN↓Wⅉ«→≔⍘ⅈ²θ¿№✂×²θ¹±¹¦¹θ↑»Iⅈ

Try it online! Link is to verbose version of code. Outputs the 1-indexed nth term of A121016. Explanation:

MN↓Wⅉ«

Use the y-coordinate of the canvas to track how many terms have been found.

Increment the candidate value, using the x-coordinate of the canvas.

≔⍘ⅈ²θ

Convert it to binary.

¿№✂×²θ¹±¹¦¹θ↑

If it's properly periodic then decrement the number of remaining terms to find. Edit: Now uses @xnor's periodicity test.

»Iⅈ

Output the found term.

05AB1E, 10 bytes

∞ʒ2в.œ¨€Ëà

Outputs a lazy infinite list of A121016.

Try it online.

Outputting the other sequence is apparently 10 bytes as well, by porting @JonathanAllan's Jelly answer:

Outputting the first second on separated newlines is also possible in 10 bytes by changing the Q to Ê in the third program: [Nbā._DÙÊ–: Try it online - Outputs the infinite sequence of A121016 on separated lines.

Explanation:

∞          # Push an infinite positive list: [1,2,3,...]
 ʒ         # Filter it by:
  2в       #  Convert the current integer to a binary list†
    .œ     #  Get all partitions of this list
      ¨    #  Remove the last partition, containing the unmodified list with 1 part
       €   #  Map over each other partition:
        Ë  #   Check that all parts are the same
         à #  Check that this is truthy for any part by taking the maximum
           # (after which the filtered infinite list is output implicitly as result)

† Note: b for a binary-string doesn't work here, since the Ë will ignore leading 0s in its comparison (e.g. "1" equals "01" in 05AB1E). This could be countered by adding a leading 1 before the Ë check (1ì€Ë), but just using a binary-list instead of binary-string b is a byte shorter.

∞          # Push an infinite positive list: [1,2,3,...]
 <         # Decrease each by 1 to make it non-negative: [0,1,2,...]
  ʒ        # Filter it by:
   b       #  Convert the current integer to a binary-string
    ā      #  Push a list in the range [1,length] (without popping the string)
     ._    #  Map each to the string, rotated that many times
       DÙQ #  Check whether all rotations are unique:
       D   #   Duplicate the list
        Ù  #   Uniquify the copy
         Q #   Check that both lists are the same
           # (after which the filtered infinite list is output implicitly as result)

[          # Start an infinite loop:
 N         #  Push the 0-based loop-index
  bā._DÙQ  #  Same as above
         – #  If the result is truthy: output the loop-index with trailing newline

Python, 94 bytes

a=0
while 1:
    a+=1;b=bin(a)[2:];c=len(b)
    if any([c//d*b[:d]==b for d in range(1,c)]):print(a)

Prints A121016 forever

Try it online (stops at 4096)

Retina 0.8.2, 65 bytes

.+
$*
{r`\b(.*)@?(#*)$
$1#$.2$*@
}`1((.+)\2+)$
$1
#
@#
+`#@
@##
#

Try it online! Link includes test cases. Outputs the 1-indexed nth term of A121016. Explanation:

.+
$*

Convert n to unary.

r`\b(.*)@?(#*)$
$1#$.2$*@

If n is positive, increment the suffix, which is a binary number represented using @ for 0 and # for 1.

1((.+)\2+)$
$1

If the suffix is periodic then decrement n.

{`
}`

Repeat until n is zero.

#
@#
+`#@
@##
#

Convert (the suffix) from binary to decimal.

R, 79 bytes

while(F<-F+1)if(grepl("^(.*)\\1+$",Reduce(paste0,F%/%2^(0:log2(F))%%2)))show(F)

Attempt This Online!

Prints A121016 indefinitely.

Maple, 100 bytes

for i do`if`(nops({seq(ListTools:-Rotate((s:=convert(i,base,2)),k),k=1..(d:=nops(s)))})=d,i,NULL)od;

Outputs A328594 indefinitely.

Perl 5, 44 bytes

Prints A121016 indefinitely.

(sprintf'%b',$_)=~/^(.+)\1+$/&&say while++$_

Try it online!

JavaScript (V8), 54 bytes

Prints A121016 indefinitely.

for(n=1;++n;)/^(.*)\1+$/.test(n.toString(2))&&print(n)

Try it online!