A Friedman number is an integer, which represented in a given numeral system, is the result of a non-trivial expression using all its own digits in combination with any of the four basic arithmetic operators (+, −, ×, ÷), additive inverses, parentheses, exponentiation, and concatenation. Here, non-trivial means that at least one operation besides concatenation is used. Leading zeros cannot be used, since that would also result in trivial Friedman numbers, such as 024 = 20 + 4. For example, 347 is a Friedman number in the decimal numeral system, since 347 = 7<sup>3</sup> + 4. The decimal Friedman numbers are:

:25, 121, 125, 126, 127, 128, 153, 216, 289, 343, 347, 625, 688, 736, 1022, 1024, 1206, 1255, 1260, 1285, 1296, 1395, 1435, 1503, 1530, 1792, 1827, 2048, 2187, 2349, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2592, 2737, 2916, ... .

Friedman numbers are named after Erich Friedman, a now-retired mathematics professor at Stetson University and recreational mathematics enthusiast.

A Friedman prime is a Friedman number that is also prime. The decimal Friedman primes are:

:127, 347, 2503, 12101, 12107, 12109, 15629, 15641, 15661, 15667, 15679, 16381, 16447, 16759, 16879, 19739, 21943, 27653, 28547, 28559, 29527, 29531, 32771, 32783, 35933, 36457, 39313, 39343, 43691, 45361, 46619, 46633, 46643, 46649, 46663, 46691, 48751, 48757, 49277, 58921, 59051, 59053, 59263, 59273, 64513, 74353, 74897, 78163, 83357, ... .

Results in base 10

The expressions of the first few Friedman numbers are:

{|class="wikitable"

|number

|expression

|number

|expression

|number

|expression

|number

|expression

|-

|25

|5<sup>2</sup>

|127

|2<sup>7</sup>−1

|289

|(8+9)<sup>2</sup>

|688

|8×86

|-

|121

|11<sup>2</sup>

|128

|2<sup>(8−1)</sup>

|343

|(3+4)<sup>3</sup>

|736

|3<sup>6</sup>+7

|-

|125

|5<sup>(1+2)</sup>

|153

|3×51

|347

|7<sup>3</sup>+4

|1022

|2<sup>10</sup>−2

|-

|126

|6×21

|216

|6<sup>(2+1)</sup>

|625

|5<sup>(6−2)</sup>

|1024

|(4−2)<sup>10</sup>

|}

A nice Friedman number is a Friedman number where the digits in the expression can be arranged to be in the same order as in the number itself. For example, we can arrange 127 = 2<sup>7</sup> − 1 as 127 = −1 + 2<sup>7</sup>. The first nice Friedman numbers are:

:127, 343, 736, 1285, 2187, 2502, 2592, 2737, 3125, 3685, 3864, 3972, 4096, 6455, 11264, 11664, 12850, 13825, 14641, 15552, 15585, 15612, 15613, 15617, 15618, 15621, 15622, 15623, 15624, 15626, 15632, 15633, 15642, 15645, 15655, 15656, 15662, 15667, 15688, 16377, 16384, 16447, 16875, 17536, 18432, 19453, 19683, 19739 .

A nice Friedman prime is a nice Friedman number that's also prime. The first nice Friedman primes are:

:127, 15667, 16447, 19739, 28559, 32771, 39343, 46633, 46663, 117619, 117643, 117763, 125003, 131071, 137791, 147419, 156253, 156257, 156259, 229373, 248839, 262139, 262147, 279967, 294829, 295247, 326617, 466553, 466561, 466567, 585643, 592763, 649529, 728993, 759359, 786433, 937577 .

Michael Brand proved that the density of Friedman numbers among the naturals is 1, which is to say that the probability of a number chosen randomly and uniformly between 1 and n to be a Friedman number tends to 1 as n tends to infinity. This result extends to Friedman numbers under any base of representation. He also proved that the same is true also for binary, ternary and quaternary nice Friedman numbers. The case of base-10 nice Friedman numbers is still open.

Vampire numbers are a subset of Friedman numbers where the only operation is a multiplication of two numbers with the same number of digits, for example 1260 = 21 × 60.

Finding 2-digit Friedman numbers

There usually are fewer 2-digit Friedman numbers than 3-digit and more in any given base, but the 2-digit ones are easier to find. If we represent a 2-digit number as mb + n, where b is the base and m, n are integers from 0 to b−1, we need only check each possible combination of m and n against the equalities mb + n = m<sup>n</sup>, and mb + n = n<sup>m</sup> to see which ones are true. We need not concern ourselves with m + n or m × n, since these will always be smaller than mb + n when n < b. The same clearly holds for m − n and m / n.

Other bases

Friedman numbers also exist for bases other than base 10. For example, 11001<sub>2</sub> = 25 is a Friedman number in the binary numeral system, since 11001 = 101<sup>10</sup>.

The first few known Friedman numbers in other small bases are shown below, written in their respective bases. Numbers shown in bold are nice Friedman numbers.

{|class="wikitable"

! base !! Friedman numbers

|-

|2

|11001, 11011, 111111, 1001111, 1010001, ...

|-

|3

|121, 221, 1022, 1122, 1211, ...

|-

|4

|121, 123, 1203, 1230, 1321, ...

|-

|5

|121, 224, 1232, 1241, 1242, ...

|-

|6

|24, 52, 121, 124, 133, ...

|-

|7

|121, 143, 144, 264, 514, ...

|-

|8

|33, 121, 125, 143, 251, ...

|-

|9

|121, 134, 314, 628, 1304, ...

|-

|11

|121, 2A9, 603, 1163, 1533, ...

|-

|12

|121, 127, 135, 144, 163, ...

|-

|13

|121, 237, 24A, 1245, 1246, ...

|-

|14

|121, 128, 135, 144, 173, ...

|-

|15

|26, 121, 136, 154, 336, ...

|-

|16

|121, 129, 145, 183, 27D, ...

|}

General results

In base <math>b = mk - m</math>,

: <math>b^2 + mb + k = (mk - m + m)b + k = mbk + k = k(mb + 1)</math>

is a Friedman number (written in base <math>b</math> as 1mk = k × m1).

In base <math>b > 2</math>,

: <math>{(b^n + 1)}^2 = b^{2n} + 2{b^n} + 1</math>

is a Friedman number (written in base <math>b</math> as 100...00200...001 = 100..001<sup>2</sup>, with <math>n - 1</math> zeroes between each nonzero number).