Is there any way to simplify or to find pattern in:
$$\mod(P_{k-1}\# \cdot J , \; P_k ) \quad with\quad J=0:P_k-1 $$ Sorry for not being clear at notaion, i will try to do it by example:
$P_k=kthprime(k)\quad$ (Example: $P_1=2\,,\quad P_2=3\,,\quad P_3=5\,, \quad etc...)$
$P_{k}\#=\prod_{i=1}^{k}P_i\quad$ (Example: $P_1\#=2\,,\quad P_2\#=6\,,\quad P_3\#=30\,, \quad etc...)$
$J$ is integer running from $0$ to $P_k-1$
And matlab code example:
P=primes(7), Pk=P(end), prevprimorial=prod(P(1:end-1)), J=0:Pk-1, R=mod(prevprimorial*J,Pk)
Output:
P =
2 3 5 7
Pk =
7
prevprimorial =
30
J =
0 1 2 3 4 5 6
R =
0 2 4 6 1 3 5
And my question is about the residuals R, if we can find some rule for the pattern there. (Primorial inside $mod$ is with high growth of frequency and thats makes it look very chaotic)
What do i look for?
For different k we will have different $R$, the first element of $R$ (i.e. the result of $J=0$) will always be $0$.
Given $k$, i want a simple formula as a function of $k$ that will tell me what $J$ will result in residual $1$. (In the matlab example ($k=4$) the $R=1$ is result of $J=4$)
Or, alternatively, given $k$, what is the $R$ for $J=1$ . (In the matlab example ($k=4$) the $J=1$ results in $R=2$)
Or, other question, how easy it is to prove or disprove for example for $k=123456789$ the equation $\mod(P_{123456789-1}\# \cdot 987 , \; P_{123456789} ) = 123$ ?