# Mathematical golfing

You have probably heard of code golfing? There the task is to find the shortest computer program that produces the required output. Here we want to perform math golfing - find the shortest formula that produces a given number. The length of a formula is measured as the number of characters. The format must be as follows:

• Contain only digits '0' to '9' and characters '+' (addition), '-' (subtraction), '*' (multiplication), '^' (exponentiation), brackets '(' and ')'.
• Digits can be concatenated such as 567.
• Operations have precedence, like in BODMAS. Brackets are done first, followed by exponentiation, followed by multiplication, followed by addition/subtraction (from left to right).
• For example (10^2+1)*2^5 is equivalent to (100+1)*32 = 3232. The formula uses 12 characters, so it is not a compact representation of the result that has 4 characters.

Find the shortest formulas that represent the following numbers:

1. 99999999999
2. 41601569625
3. 61917364165
4. 82644187136
5. 33059881770
6. 12345678901234
7. 10101010101010
8. 33333333333333
9. 68945723674934237482
10. 5782934283492912347898237400000
11. 34828517376
• Partial answers are accepted too! Commented Jun 3, 2020 at 4:49
• "from left to right" breaks the default priority of $a^{b^c} = a^{(b^c)}$, though. Commented Jun 3, 2020 at 5:42
• Is a unary minus allowed?
– Jens
Commented Jun 4, 2020 at 19:48
• Jens yeah why not. Any attempts at the missing numbers? Commented Jun 5, 2020 at 0:48
• I have decided to add brackets to make things a bit more interesting, especially for those larger terms. The current answer is still valid. Commented Jun 5, 2020 at 2:26

I'm still missing a few of the answers.

99999999999 = (7 characters)

10^11-1

41601569625 = (6 characters)

3465^3

61917364165 = (8 characters)

12^10-59

82644187136 = (6 characters)

4*14^9

33059881770 = (9 characters)

3*18^8+42

12345678901234 = ?

10101010101010 = ?

33333333333333 = ?
I had an 11-character solution but that used division (10^14/3-1/3).

68945723674934237482 = ?

5782934283492912347898237400000 = ?

34828517376 = (5 characters, Thanks to Ben J in the comments)

432^4

• Very nice Jaap! You have matched my best results and improved some of them. Commented Jun 3, 2020 at 6:18
• For the last number, it's possible to golf another 2 characters by rearranging to remove an operator. Commented Jun 4, 2020 at 15:11
• Great observation Ben! Commented Jun 5, 2020 at 0:47