Skip to main content
added 6 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Mathematica, 5353 49 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=n(2Mod[i/ni+=Mod[i,2]2n]2-1)]];in]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.

It defines an unnamed function which takes n as a single parameter and returns the nth Shotgun number.

Mathematica, 53 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=n(2Mod[i/n,2]-1)]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.

It defines an unnamed function which takes n as a single parameter and returns the nth Shotgun number.

Mathematica, 53 49 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=Mod[i,2n]2-n]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.

It defines an unnamed function which takes n as a single parameter and returns the nth Shotgun number.

added 110 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Mathematica, 53 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=n(2Mod[i/n,2]-1)]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.

It defines an unnamed function which takes n as a single parameter and returns the nth Shotgun number.

Mathematica, 53 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=n(2Mod[i/n,2]-1)]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.

Mathematica, 53 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=n(2Mod[i/n,2]-1)]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.

It defines an unnamed function which takes n as a single parameter and returns the nth Shotgun number.

Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Mathematica, 53 bytes

(For[i=n=#,n>1,--n,If[n∣i,i+=n(2Mod[i/n,2]-1)]];i)&

I decided to golf my reference implementation. The is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.