Skip to main content
Notice removed Reward existing answer by Razetime
Bounty Ended with hyperneutrino's answer chosen by Razetime
Notice added Reward existing answer by Razetime
Bounty Started worth 100 reputation by Razetime
Question Unprotected by caird coinheringaahin g
Question Protected by CommunityBot
Tweeted twitter.com/StackCodeGolf/status/702092794563846144
edited tags
Link
Conor O'Brien
  • 40.2k
  • 3
  • 91
  • 180
added 9 characters in body
Source Link
Lamaro
  • 949
  • 7
  • 10

Given a number > 0, output the sum with all digits (1 .. n) concatenated and reversed and add them up. For example, with n = 6:

The numbers 1 to 6 concatenated:

123456

Reversed:

654321

Adding them up together will result in: 777777. Another example is n = 11:

1 2 3 4 5 6 7 8 9 10 11 > 1234567891011

and

11 10 9 8 7 6 5 4 3 2 1 > 1110987654321

Adding them up together will result in 2345555545332. This is also known as A078262.

Shortest code wins!

Given a number > 0, output the sum with all digits concatenated and reversed and add them up. For example, with n = 6:

The numbers 1 to 6 concatenated:

123456

Reversed:

654321

Adding them up together will result in: 777777. Another example is n = 11:

1 2 3 4 5 6 7 8 9 10 11 > 1234567891011

and

11 10 9 8 7 6 5 4 3 2 1 > 1110987654321

Adding them up together will result in 2345555545332. This is also known as A078262.

Shortest code wins!

Given a number > 0, output the sum with all digits (1 .. n) concatenated and reversed and add them up. For example, with n = 6:

The numbers 1 to 6 concatenated:

123456

Reversed:

654321

Adding them up together will result in: 777777. Another example is n = 11:

1 2 3 4 5 6 7 8 9 10 11 > 1234567891011

and

11 10 9 8 7 6 5 4 3 2 1 > 1110987654321

Adding them up together will result in 2345555545332. This is also known as A078262.

Shortest code wins!

Source Link
Lamaro
  • 949
  • 7
  • 10

Adding up the digits and the digits reversed

Given a number > 0, output the sum with all digits concatenated and reversed and add them up. For example, with n = 6:

The numbers 1 to 6 concatenated:

123456

Reversed:

654321

Adding them up together will result in: 777777. Another example is n = 11:

1 2 3 4 5 6 7 8 9 10 11 > 1234567891011

and

11 10 9 8 7 6 5 4 3 2 1 > 1110987654321

Adding them up together will result in 2345555545332. This is also known as A078262.

Shortest code wins!