I am sure that this is not the most elegant code you will have seen, but I am trying to loop through an expression to see if FultonHarrisn] produces any outputs that are equal to a prime squared.
My function FultonHarris is defined as follows:
FultonHarris[n_] := Product[(Sum[a[k], {k, i, j - 1}] + j - i)/(j - i), {j, 1, n}, {i, 1,
j - 1}]
and my for loop runs as follows, looping through n from 3 to 9, and j from 1 to n, and i from 1 to j-1:
numPoints = 10; For[n = 3, n < 10, n++,
For[j = 1, j <= n, j++,
For[i = 1, i < j, i++,
a[i] := x; a[j] := y; a[k_] /; k != {i, j} := 0;
dd[x_, y_, p_] := FultonHarris[n] - p^2;
FindInstance[
dd[xx, yy, pp] == 0 && xx > 0 && yy > 0 && PrimeQ[pp], {xx, yy,
pp}, Integers, numPoints]
]
]
]
However, when I run this, it doesn't return anything, not even empty braces. Do I need to put a Print statement in there?
For,Do, andWhiledo not return anything, tryTable, instead. – rcollyer Jun 18 '13 at 15:44FindInstance. – rcollyer Jun 18 '13 at 17:30a[i] := xin the beginning of theiloop, and settinga[j] := yin the beginning of thejloop? Regards – Moderat Jun 19 '13 at 17:07