Problem 61147. Determine whether a number is a repfigit number

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

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Jan 03, 2026

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers2

Suggested Problems

More from this Author319

Community Treasure Hunt

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

Start Hunting!