Friedman numbers are positive integers that can be written as an expression of its own digits and basic arithmetic operations. While Friedman numbers don’t have much practical use, they can be fun and creative puzzles for all ages!

## Rules of Friedman Numbers

- The expression must use the same number of digits as they occur in the Friedman number itself (e.g., an expression for 343 must use exactly two 3’s and one 4)
- Only these operations are allowed:
- addition +
- subtraction –
- multiplication × or *
- division ÷ or /
- parentheses ()
- exponents ^
- concatenation (putting together multiple digits to make one number, such as using 1 and 2 to make 12)

- Trivial expressions are excluded (i.e., simply writing the number as itself)

## Examples

Here are some of the smallest Friedman numbers and their expressions:

- 25 = 5
^{2} - 121 = 11
^{2} - 125 = 5
^{(1+2)}

The Online Encyclopedia of Integer Sequences (OEIS) has a more comprehensive list of Friedman numbers and variations.

## Challenges

Try to find expressions for these Friedman numbers:

1435 (easy)

#### Solution to 1435

35 × 41

2502 (easy)

#### Solution to 2502

2 + 50^{2}

28547 (hard)

#### Solution to 28547

(5 + 8)^{4} – (2 × 7)

123456789 (very hard)

#### Solution to 123456789

((2 × 7 + 86)^{5} – 91) / 3^{4}