Problem 1175 · Easy

Prime Arrangements

Count the orderings of the numbers one through n in which every prime value sits at a prime-numbered position, reported modulo one billion and seven. The visual separates primes from non-primes and multiplies the two independent arrangements.

Open the interactive visualisation