# Please Resolve Interesting Mathematical Equation

As noted in the title can you find the mathematical expression for the following sequence of numbers?

1, 2, 2, 4, 1, 1, 3, 3, 4, 9, 1, 1, 3, 5, 9

From time to time hints will be updated.

Note: this sequence cannot be found in The On-Line Encyclopedia of Integer Sequences

• (Not sure why the downvote; this definitely doesn't deserve it.)
– Rubio
Mar 22, 2018 at 1:27

The formula is:

P(n+1) modulo the digit-sum of P(n), where P(n) is the nth prime

The clue that gave it away was that the first few terms are

The difference between consecutive primes, which agrees with the modulo function whenever the numbers are close enough (the larger one is less than twice the smaller one).

Also,

Since the behaviour changes when the primes reach two digits, this points to some kind of operation that depends on the number of digits (and since things that involve the decimal number system are not very relevant to mathematics in general, this may explain why such a simple sequence is not found on the OEIS)

• great job, well done.
– tom
Mar 22, 2018 at 7:32