Skip to main content
added 16 characters in body
Source Link
S.S. Anne
  • 3.4k
  • 11
  • 31

C (gcc), 80 bytes

r,m,n;b(h){for(r=0,m=1;h;h/=2)r+=h%2*m,m*=10;h=r;}f(k){for(n=1;b(++n)%k;);b(n);} 

This can probably be improved some but I have yet to find a way.

Converts the integer into binary and checks if it's a multiple.

Brute-force.

Try it online!

C (gcc), 80 bytes

r,m,n;b(h){for(r=0,m=1;h;h/=2)r+=h%2*m,m*=10;h=r;}f(k){for(n=1;b(++n)%k;);b(n);} 

This can probably be improved some but I have yet to find a way.

Converts the integer into binary and checks if it's a multiple.

Try it online!

C (gcc), 80 bytes

r,m,n;b(h){for(r=0,m=1;h;h/=2)r+=h%2*m,m*=10;h=r;}f(k){for(n=1;b(++n)%k;);b(n);} 

This can probably be improved some but I have yet to find a way.

Converts the integer into binary and checks if it's a multiple.

Brute-force.

Try it online!

Source Link
S.S. Anne
  • 3.4k
  • 11
  • 31

C (gcc), 80 bytes

r,m,n;b(h){for(r=0,m=1;h;h/=2)r+=h%2*m,m*=10;h=r;}f(k){for(n=1;b(++n)%k;);b(n);} 

This can probably be improved some but I have yet to find a way.

Converts the integer into binary and checks if it's a multiple.

Try it online!