← Complete problem index

PROJECT EULER · #0971

Modular Polynomial Composition

Statement only · SolvedOriginal problem ↗

Let p be a prime of the form 5k4 and define fp(x)=(xk+x)modp.

Let C(p) be the number of values 0x<p such that fp(m)(x)=x for some positive integer m, that is, x can be obtained by iteratively applying fp on itself starting at x.

For example, C(11)=7, due to x=0,1,2,3,8,9,10.

Let S(N) be the sum of C(p) for all primes of the form 5k4 not exceeding N. For example S(100)=127.

Find S(108).

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.