Is there a way to nest for loops inside other for loops in Pari/GP (2.7.6) since the following error always appears:
*** at top-level: read("prog.txt")
*** ^----------------
*** read: sorry, embedded braces (in parser) is not yet implemented.
Code:
(12:14) gp > n = 12
%12 = 12
(12:14) gp > k = 10
%13 = 10
(12:14) gp > g = [1..10]
%14 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
{
forprime(p = 1, 16,
rn = n%p
rk = k%p
{
for(i=1, #g,
if( (rn*(g[i]+rk)+1)%p!=0,
h = concat(h, g[i])
}
g = h
}
Thanks for help. The question where I posted and got the code from got deleted, so I'm kind of stuck at this point.