Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Mathematica, 38 54 bytes

FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answerMartin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). IntegerDigits converts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, and FromDigits reassembles them into an integer. Oh well.

Mathematica, 38 54 bytes

FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). IntegerDigits converts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, and FromDigits reassembles them into an integer. Oh well.

Mathematica, 38 54 bytes

FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). IntegerDigits converts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, and FromDigits reassembles them into an integer. Oh well.

added 122 characters in body
Source Link
Greg Martin
  • 16.2k
  • 4
  • 21
  • 72

Mathematica, 3838 54 bytes

FromDigits@*Join@@Range[Range@#FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). Join@@IntegerDigits flattens them into aconverts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, whichand FromDigits convertsreassembles them into a singlean integer. Oh well.

Mathematica, 38 bytes

FromDigits@*Join@@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). Join@@ flattens them into a single list, which FromDigits converts into a single integer.

Mathematica, 38 54 bytes

FromDigits@*Flatten@IntegerDigits@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). IntegerDigits converts the multi-digit numbers in the result to lists of single digits, Flatten removes all the list nesting, and FromDigits reassembles them into an integer. Oh well.

added 33 characters in body
Source Link
Greg Martin
  • 16.2k
  • 4
  • 21
  • 72

Mathematica, 4138 bytes

FromDigits@*Join@@Reverse@*Range~Array~#&FromDigits@*Join@@Range[Range@#,1,-1]&

I stole Reverse@*RangeRange[Range@#,1,-1] is a function that lists the numbers from its inputMartin Ender's (still shorter) answer to 1 in descending order.save three bytes ~Array~# returns a list of all those lists(dammit, with inputs from 1 to the main function's argumentI gotta start remembering that some functions are Listable). Join@@ flattens them into a single list, which FromDigits converts into a single integer.

Mathematica, 41 bytes

FromDigits@*Join@@Reverse@*Range~Array~#&

Reverse@*Range is a function that lists the numbers from its input to 1 in descending order. ~Array~# returns a list of all those lists, with inputs from 1 to the main function's argument. Join@@ flattens them into a single list, which FromDigits converts into a single integer.

Mathematica, 38 bytes

FromDigits@*Join@@Range[Range@#,1,-1]&

I stole Range[Range@#,1,-1] from Martin Ender's (still shorter) answer to save three bytes (dammit, I gotta start remembering that some functions are Listable). Join@@ flattens them into a single list, which FromDigits converts into a single integer.

Source Link
Greg Martin
  • 16.2k
  • 4
  • 21
  • 72
Loading