Lably
Skip to content

Narcissistic number

Concept in number theory

  • 2 min read
  • 3 chapters

Related on Lably

Through Fixed point (mathematics), Integer and Linear function (calculus)

Definition

Let n be a natural number. We define the narcissistic function for base b>1 Fb:N→N to be the following:

Fb(n)=∑i=0k−1dik.

where k=⌊logb⁡n⌋+1 is the number of digits in the number in base b, and

di=nmodbi+1−nmodbibi

is the value of each digit of the number. A natural number n is a narcissistic number if it is a fixed point for Fb, which occurs if Fb(n)=n. The natural numbers 0≤n<b are trivial narcissistic numbers for all b, all other narcissistic numbers are nontrivial narcissistic numbers.

For example, the number 153 in base b=10 is a narcissistic number, because k=3 and 153=13+53+33.

A natural number n is a sociable narcissistic number if it is a periodic point for Fb, where Fbp(n)=n for a positive integer p (here Fbp is the pth iterate of Fb), and forms a cycle of period p. A narcissistic number is a sociable narcissistic number with p=1, and an amicable narcissistic number is a sociable narcissistic number with p=2.

All natural numbers n are preperiodic points for Fb, regardless of the base. This is because for any given digit count k, the minimum possible value of n is bk−1, the maximum possible value of n is bk−1≤bk, and the narcissistic function value is Fb(n)=k(b−1)k. Thus, any narcissistic number must satisfy the inequality bk−1≤k(b−1)k≤bk. Multiplying all sides by b(b−1)k, we get (bb−1)k≤bk≤b(bb−1)k, or equivalently, k≤(bb−1)k≤bk. Since bb−1≥1, this means that there will be a maximum value k where (bb−1)k≤bk, because of the exponential nature of (bb−1)k and the linearity of bk. Beyond this value k, Fb(n)≤n always. Thus, there are a finite number of narcissistic numbers, and any natural number is guaranteed to reach a periodic point or a fixed point less than bk−1, making it a preperiodic point. Setting b equal to 10 shows that the largest narcissistic number in base 10 must be less than 1060.

The number of iterations i needed for Fbi(n) to reach a fixed point is the narcissistic function's persistence of n, and undefined if it never reaches a fixed point.

A base b has at least one two-digit narcissistic number if and only if b2+1 is not prime, and the number of two-digit narcissistic numbers in base b equals τ(b2+1)−2, where τ(n) is the number of positive divisors of n.

Every base b≥3 that is not a multiple of nine has at least one three-digit narcissistic number. The bases that do not are

2, 72, 90, 108, 153, 270, 423, 450, 531, 558, 630, 648, 738, 1044, 1098, 1125, 1224, 1242, 1287, 1440, 1503, 1566, 1611, 1620, 1800, 1935, ... (sequence A248970 in the OEIS)

There are only 88 narcissistic numbers in base 10, of which the largest is

115,132,219,018,763,992,565,095,597,973,971,522,401

with 39 digits.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in From Lably lessons