Skip to main content
Typos and formatting
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

Input: ###Input:

An integer

Output: ###Output:

Sum of the input itself + the length of the input + each individual digit of the iteminput.

nr + nr-length + {sum of individual digits} = output

For example: ###Examples:

Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) -> 119

Input: 123
Output: 123 + 3 + (1 + 2 + 3) -> 132

Challenge rules: ###Challenge rules:

  • The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.
    For example:

    Input: -123
    Output: -123 + 4 + (-1 + 2 + 3) -> -115

  • You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

General rules: ###General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
  • Default loopholesLoopholes are forbidden.
  • If possible, please add a link with a test for your code.
  • Also, please add an explanation if necessary.

Test cases: ###Test cases:

87901 -> 87931
123 -> 132
99 -> 119
5 -> 11
1 -> 3
0 -> 1
-3 -> -4
-123 -> -115
-900 -> -905
-87901 -> -87886

Semi-related: Count Sum of all Digits

Input:

An integer

Output:

Sum of the input itself + the length of the input + each individual digit of the item.

nr + nr-length + {sum of individual digits} = output

For example:

Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) -> 119

Input: 123
Output: 123 + 3 + (1 + 2 + 3) -> 132

Challenge rules:

  • The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.
    For example:

    Input: -123
    Output: -123 + 4 + (-1 + 2 + 3) -> -115

  • You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
  • Default loopholes are forbidden.
  • If possible, please add a link with a test for your code.

Test cases:

87901 -> 87931
123 -> 132
99 -> 119
5 -> 11
1 -> 3
0 -> 1
-3 -> -4
-123 -> -115
-900 -> -905
-87901 -> -87886

Semi-related: Count Sum of all Digits

###Input:

An integer

###Output:

Sum of the input itself + the length of the input + each individual digit of the input.

nr + nr-length + {sum of digits} = output

###Examples:

Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) 119

Input: 123
Output: 123 + 3 + (1 + 2 + 3) 132

###Challenge rules:

  • The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.
    For example:

    Input: -123
    Output: -123 + 4 + (-1 + 2 + 3) -115

  • You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

###General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
  • Default Loopholes are forbidden.
  • If possible, please add a link with a test for your code.
  • Also, please add an explanation if necessary.

###Test cases:

87901  87931
123  132
99  119
5  11
1  3
0  1
-3  -4
-123  -115
-900  -905
-87901  -87886

Semi-related: Count Sum of all Digits

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Input:

An integer

Output:

Sum of the input itself + the length of the input + each individual digit of the item.

nr + nr-length + {sum of individual digits} = output

For example:

Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) -> 119

Input: 123
Output: 123 + 3 + (1 + 2 + 3) -> 132

Challenge rules:

  • The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.
    For example:

    Input: -123
    Output: -123 + 4 + (-1 + 2 + 3) -> -115

  • You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
  • Default loopholes are forbidden.
  • If possible, please add a link with a test for your code.

Test cases:

87901 -> 87931
123 -> 132
99 -> 119
5 -> 11
1 -> 3
0 -> 1
-3 -> -4
-123 -> -115
-900 -> -905
-87901 -> -87886

Semi-related: Count Sum of all DigitsCount Sum of all Digits

Input:

An integer

Output:

Sum of the input itself + the length of the input + each individual digit of the item.

nr + nr-length + {sum of individual digits} = output

For example:

Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) -> 119

Input: 123
Output: 123 + 3 + (1 + 2 + 3) -> 132

Challenge rules:

  • The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.
    For example:

    Input: -123
    Output: -123 + 4 + (-1 + 2 + 3) -> -115

  • You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
  • Default loopholes are forbidden.
  • If possible, please add a link with a test for your code.

Test cases:

87901 -> 87931
123 -> 132
99 -> 119
5 -> 11
1 -> 3
0 -> 1
-3 -> -4
-123 -> -115
-900 -> -905
-87901 -> -87886

Semi-related: Count Sum of all Digits

Input:

An integer

Output:

Sum of the input itself + the length of the input + each individual digit of the item.

nr + nr-length + {sum of individual digits} = output

For example:

Input: 99
Output: 99 (nr) + 2 (nr-length) + (9 + 9) (digits) -> 119

Input: 123
Output: 123 + 3 + (1 + 2 + 3) -> 132

Challenge rules:

  • The input can also contain negative input, which are resolved special. The -/minus-sign is also +1 for the length, and is part of the first digit.
    For example:

    Input: -123
    Output: -123 + 4 + (-1 + 2 + 3) -> -115

  • You can assume that the input nor output will ever be outside the range of an (32-bit) integer.

General rules:

  • This is , so shortest answer in bytes wins.
    Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
  • Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
  • Default loopholes are forbidden.
  • If possible, please add a link with a test for your code.

Test cases:

87901 -> 87931
123 -> 132
99 -> 119
5 -> 11
1 -> 3
0 -> 1
-3 -> -4
-123 -> -115
-900 -> -905
-87901 -> -87886

Semi-related: Count Sum of all Digits

replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/
Source Link
replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/
Source Link
Loading
replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/
Source Link
Loading
replaced http://meta.codegolf.stackexchange.com/ with https://codegolf.meta.stackexchange.com/
Source Link
Loading
double contradiction fixed..
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
Tweeted twitter.com/StackCodeGolf/status/749694257288609796
deleted 39 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
added 100 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading