8 added 66 characters in body
source | link

Java (JDK), 142 138 124 123 132 130130 98 bytes

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.

Saved 2 more bytes using (slow) Stack vs. HashSet.

n->{var s=newint java.util.Stack();ints[]=new i=0int[9*n],j,k=0;for(;i++<n;s.add(k=j);n-->0;s[k=j]++){for(j=0;s.contains(++j)|Integerj=0;s[++j]>0|n.bitCount(j^k)>1;);}return;return k;}

Try it online!Try it online!

Java (JDK), 123 132 130 bytes

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.

Saved 2 more bytes using (slow) Stack vs. HashSet.

n->{var s=new java.util.Stack();int i=0,j,k=0;for(;i++<n;s.add(k=j)){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);}return k;}

Try it online!

Java (JDK), 142 138 124 123 132 130 98 bytes

n->{int s[]=new int[9*n],j,k=0;for(;n-->0;s[k=j]++)for(j=0;s[++j]>0|n.bitCount(j^k)>1;);return k;}

Try it online!

7 added 66 characters in body
source | link

Java (JDK), 123 132132 130 bytes

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.  

Saved 2 more bytes using (slow) Stack vs. HashSet.

n->{var s=new java.util.HashSetStack();int i=0,j,k=0;for(;i++<n;s.add(k=j)){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);}return k;}

Try it online!Try it online!

Java (JDK), 123 132 bytes

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.  

n->{var s=new java.util.HashSet();int i=0,j,k=0;for(;i++<n;s.add(k=j)){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);}return k;}

Try it online!

Java (JDK), 123 132 130 bytes

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.

Saved 2 more bytes using (slow) Stack vs. HashSet.

n->{var s=new java.util.Stack();int i=0,j,k=0;for(;i++<n;s.add(k=j)){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);}return k;}

Try it online!

6 added 171 characters in body
source | link

Java (JDK), 123123 132 bytes

 

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.

n->{Setvar s=new java.util.HashSet();int i=0,j,k=0;for(;i++<n;;i++<n;s.add(k=j)){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);s.add(k=j);}return k;}

Try it online!Try it online!

Java (JDK), 123 bytes

 
n->{Set s=new HashSet();int i=0,j,k=0;for(;i++<n;){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);s.add(k=j);}return k;}

Try it online!

Java (JDK), 123 132 bytes

(increased to account for import, saved a byte thanks to @kevin-cruijssen suggestion.

n->{var s=new java.util.HashSet();int i=0,j,k=0;for(;i++<n;s.add(k=j)){for(j=0;s.contains(++j)|Integer.bitCount(j^k)>1;);}return k;}

Try it online!

5 edited body
source | link
4 added 56 characters in body
source | link
3 deleted 27 characters in body
source | link
2 deleted 6 characters in body
source | link
1
source | link