Given a natural number , its arithmetic derivative is defined as follows:
.
If is prime, then .
Let , with . Then .
For instance, , and . It can be proven that this definition is consistent. For example, , and also .
We say that is a fixed point of if . For instance, 0 and 4 are fixed points. Given and , can you compute the number of fixed points of in ?
Input consists of several cases, each one with and , with .
For each case, print the number of fixed points of in .
Author: Salvador Roura
Generation: 2026-01-25T12:08:07.407Z
© Jutge.org, 2006–2026.
https://jutge.org