Mathwords logoMathwords

Repfigit Number — Definition, Formula & Example

A repfigit number is a whole number with at least two digits that shows up again in a Fibonacci-like sequence that starts with its own digits. The name is short for "repetitive Fibonacci-like digit," and these numbers are also called Keith numbers.

Let NN be a natural number with n≥2n \ge 2 digits d1d2…dnd_1 d_2 \ldots d_n in base 10. Define a sequence by Sk=dkS_k = d_k for 1≤k≤n1 \le k \le n, and for k>nk > n let each term be the sum of the nn terms before it. Then NN is a repfigit (Keith) number if Sm=NS_m = N for some index m>nm > n.

Key Formula

Sk=dk  (1≤k≤n),Sk=∑i=1nSk−i  (k>n)S_k = d_k \ \ (1 \le k \le n), \qquad S_k = \sum_{i=1}^{n} S_{k-i} \ \ (k > n)
Where:
  • NN = The number being tested, with at least two digits
  • nn = The number of digits in N, which is also how many previous terms you add
  • dkd_k = The k-th digit of N, read from left to right
  • SkS_k = The k-th term of the sequence; N is a repfigit if some term equals N

Worked Example

Problem: Is 197 a repfigit number?
Step 1: Count the digits. 197 has 3 digits, so each new term is the sum of the previous 3 terms. Start the sequence with the digits 1, 9, 7.
S1=1,S2=9,S3=7S_1 = 1,\quad S_2 = 9,\quad S_3 = 7
Step 2: Build new terms by adding the last three terms each time.
1+9+7=17,9+7+17=33,7+17+33=57,17+33+57=1071+9+7 = 17,\quad 9+7+17 = 33,\quad 7+17+33 = 57,\quad 17+33+57 = 107
Step 3: Add the last three terms once more. The result is 197, the number you started with, so you can stop.
33+57+107=19733 + 57 + 107 = 197
Answer: Yes. The sequence 1, 9, 7, 17, 33, 57, 107, 197 reaches 197, so 197 is a repfigit number.

Why It Matters

Repfigits appear in number-puzzle collections and in math competitions as exercises in following a recursive rule exactly. The only two-digit repfigits are 14, 19, 28, 47, 61, and 75, and the next one after those is 197. They also make good first coding projects, because a short loop can test every number up to a million. Mathematicians still do not know whether infinitely many repfigits exist.

Common Mistakes

Mistake: Always adding just the previous two terms, as in the Fibonacci sequence, no matter how many digits the number has.
Correction: The number of terms you add must match the number of digits. For 197, adding only two terms gives 1, 9, 7, 16, 23, 39, 62, 101, 163, 264. That sequence skips past 197 and leads to the wrong conclusion. Add three terms for a three-digit number, four terms for a four-digit number, and so on.

Related Terms

  • Carmichael Number — Another rare class of special whole numbers
  • Digit — Digits supply the starting terms of the sequence
  • Natural Numbers — Repfigits form a small, special subset of these
  • Integers — Broader set; negative integers cannot be repfigits
  • Fibonacci Sequence — Repfigit sequences extend the Fibonacci addition rule
  • Recursive — Each sequence term is defined from previous terms