← Complete problem index

PROJECT EULER · #0871

Drifting Subsets

Statement only · UnsolvedOriginal problem ↗

Let f be a function from a finite set S to itself. A drifting subset for f is a subset A of S such that the number of elements in the union Af(A) is equal to twice the number of elements of A.
We write D(f) for the maximal number of elements among all drifting subsets for f.

For a positive integer n, define fn as the function from {0,1,,n1} to itself sending x to x3+x+1modn.
You are given D(f5)=1 and D(f10)=3.

Find i=1100D(f105+i).

Write-up coming later

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