4 deleted 11 characters in body
source | link

05AB1E, 21 20 1918 bytes

ÎFDˆ∞ÎFˆ∞.Δ¯θy^bSO¯yå_*

Pretty inefficient, so the larger the input, the longer it takes to get the result. Does work for input 0 as well, though.

Try it onlineTry it online or verify the first \$n\$ termsverify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
  ˆ              #  AddPop the current number and add it to the global_array (without popping)
  ∞.Δ            #   Inner loop starting at 1 to find the first number which is truthy for:
     ¯θy^        #    XOR the last number of the global_array with the loop-number `y`
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
     ¯yå_        #    Check if the loop-number `y` is NOT in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy), the inner loop will stop)
                 # (after the loops, output the top of the stack implicitly)

05AB1E, 21 20 19 bytes

ÎFDˆ∞.Δ¯θy^bSO¯yå_*

Pretty inefficient, so the larger the input, the longer it takes to get the result. Does work for input 0 as well, though.

Try it online or verify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
               #  Add the current number to the global_array (without popping)
  ∞.Δ            #   Inner loop starting at 1 to find the first number which is truthy for:
     ¯θy^        #    XOR the last number of the global_array with the loop-number
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
     ¯yå_        #    Check if the loop-number is NOT in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy) the inner loop will stop)
                 # (after the loops, output the top of the stack implicitly)

05AB1E, 21 20 18 bytes

ÎFˆ∞.Δ¯θy^bSO¯yå_*

Pretty inefficient, so the larger the input, the longer it takes to get the result. Does work for input 0 as well, though.

Try it online or verify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
  ˆ              #  Pop the current number and add it to the global_array
  ∞.Δ            #  Inner loop starting at 1 to find the first number which is truthy for:
     ¯θy^        #   XOR the last number of the global_array with the loop-number `y`
         b       #   Convert it to binary
          SO     #   Sum it's binary digits
     ¯yå_        #   Check if the loop-number `y` is NOT in the global_array yet
            *    #   Multiply both (only if this is 1 (truthy), the inner loop will stop)
                 # (after the loops, output the top of the stack implicitly)
3 added 846 characters in body
source | link

05AB1E, 21 2020 19 bytes

ÎF©∞ÎFDˆ∞.Δ®y^bSO¯yå_*}DˆΔ¯θy^bSO¯yå_*

Can definitely be golfed some more..

Pretty inefficient, so the larger the input, the longer it takes to get the result. Does work for input 0 as well, though.

Try it onlineTry it online or verify the first \$n\$ termsverify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
  ©              #  StoreAdd the current number into the registerglobal_array (without popping)
   ∞.Δ            #   Inner loop starting at 1 to find the first number which is truthy for:
      ®y^¯θy^        #    XOR the last number (fromof the register)global_array andwith the loop-number
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
      ¯yå_        #    Check if the loop-number is notNOT in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy) the inner loop will stop)
             }D  #  After the inner loop: duplicate the found number
               ˆ #  And pop and push it to the global_array
                 # (after the outer looploops, output the top of the stack implicitly)

05AB1E, 21 20 bytes

ÎF©∞.Δ®y^bSO¯yå_*}Dˆ

Can definitely be golfed some more..

Pretty inefficient, so the larger the input, the longer it takes to get the result.

Try it online or verify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
  ©              #  Store the current number in the register (without popping)
   ∞.Δ           #   Inner loop starting at 1 to find the first number which is truthy for:
      ®y^        #    XOR the last number (from the register) and loop-number
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
      ¯yå_       #    Check if the loop-number is not in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy) the loop will stop)
             }D  #  After the inner loop: duplicate the found number
               ˆ #  And pop and push it to the global_array
                 # (after the outer loop, output the top of the stack implicitly)

05AB1E, 21 20 19 bytes

ÎFDˆ∞.Δ¯θy^bSO¯yå_*

Pretty inefficient, so the larger the input, the longer it takes to get the result. Does work for input 0 as well, though.

Try it online or verify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
               #  Add the current number to the global_array (without popping)
  ∞.Δ            #   Inner loop starting at 1 to find the first number which is truthy for:
     ¯θy^        #    XOR the last number of the global_array with the loop-number
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
     ¯yå_        #    Check if the loop-number is NOT in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy) the inner loop will stop)
                 # (after the loops, output the top of the stack implicitly)
2 added 846 characters in body
source | link

05AB1E, 21 21 20 bytes

0ˆF∞ÎF©∞.Δ¯θy^bSO¯yå_*Δ®y^bSO¯yå_*}Dˆ

Try it online Can definitely be golfed some more..

Pretty inefficient, so the larger the input, the longer it takes to get the result.

Try it online or verify the first 100 termsverify the first \$n\$ terms.

Explanation:

TODO: Will golf it some more (and have my meeting at work first), and add an explanation later on.

Î                # Push 0 and the input
 F               # Loop the input amount of times:
  ©              #  Store the current number in the register (without popping)
   ∞.Δ           #   Inner loop starting at 1 to find the first number which is truthy for:
      ®y^        #    XOR the last number (from the register) and loop-number
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
      ¯yå_       #    Check if the loop-number is not in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy) the loop will stop)
             }D  #  After the inner loop: duplicate the found number
               ˆ #  And pop and push it to the global_array
                 # (after the outer loop, output the top of the stack implicitly)

05AB1E, 21 bytes

0ˆF∞.Δ¯θy^bSO¯yå_*}Dˆ

Try it online or verify the first 100 terms.

Explanation:

TODO: Will golf it some more (and have my meeting at work first), and add an explanation later on.

05AB1E, 21 20 bytes

ÎF©∞.Δ®y^bSO¯yå_*}Dˆ

Can definitely be golfed some more..

Pretty inefficient, so the larger the input, the longer it takes to get the result.

Try it online or verify the first \$n\$ terms.

Explanation:

Î                # Push 0 and the input
 F               # Loop the input amount of times:
  ©              #  Store the current number in the register (without popping)
   ∞.Δ           #   Inner loop starting at 1 to find the first number which is truthy for:
      ®y^        #    XOR the last number (from the register) and loop-number
         b       #    Convert it to binary
          SO     #    Sum it's binary digits
      ¯yå_       #    Check if the loop-number is not in the global_array yet
            *    #    Multiply both (only if this is 1 (truthy) the loop will stop)
             }D  #  After the inner loop: duplicate the found number
               ˆ #  And pop and push it to the global_array
                 # (after the outer loop, output the top of the stack implicitly)
1
source | link