programm 2:
(int j=2; j*j<i; j++) checks if i is bigger than the j²
programm 1:
(int j=2; j<i; j++) checks if i is bigger than j
that's the difference, I would have to check
the equation by hand to see the difference ;D since I don't
have a good formal mathematical education :)