Sum equal to product in $\mathbb{Z}/n\mathbb{Z}$ under constraints

57 Views Asked by At

I need to solve the following problem.

Let $A=\{a_0,a_1,a_2,\cdots,a_k\}$

Find $a_i$ such that:

$|A|\geq 3$

$a_i\in \mathbb{N}$ and $a_i\in [32,127]$

$p=\sum_i a_i$ is prime

and $\sum_i a_i = \prod_i a_i \mod n$ for some $n\in\mathbb{N}$

I tried using the mixed integer linear programming solver in sage (Docs), but that clearly failed since the system is not linear.

I cannot seem to find any literature on this, does anyone know of any efficient solutions for problems like this? I wondered if this can be interpreted as a lattice problem like CVP(Closest vector problem) and solved that way, but I'm not sure where to start with this approach.