A sequence of numbers is constructed from a number x with the following steps:
  1. List the n digits of x.
  2. Compute the ()st term as the sum of the digits of x.
  3. Compute the remaining terms as the sum of the previous n terms.
A repfigit (or Keith) number is a starting number greater than 9 that reappears in the sequence. For example, starting with 14, one gets 1, 4, 5, 9, 14. Starting with 197, one gets 1, 9, 7, 17, 33, 57, 107, 197. Thus, both 14 and 197 are repfigit numbers.
Write a function to determine whether the input number (given as a character string) is a repfigit number.

Solution Stats

9 Solutions

5 Solvers

Last Solution submitted on Jan 14, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers5

Suggested Problems

More from this Author321

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!