DIM U0%(2,2), U1%(2,2), U2%(2,2), seed%(2) U0%() = 1, -2, 2, 2, -1, 2, 2, -2, 3 U1%() = 1, 2, 2, 2, 1, 2, 2, 2, 3 U2%() = -1, 2, 2, -2, 1, 2, -2, 2, 3 seed%() = 3, 4, 5 FOR power% = 1 TO 7 all% = 0 : prim% = 0 PROCtri(seed%(), 10^power%, all%, prim%) PRINT "Up to 10^"; power%, ": " all% " triples" prim% " primitives" NEXT END DEF PROCtri(i%(), mp%, RETURN all%, RETURN prim%) LOCAL t%() : DIM t%(2) IF SUM(i%()) > mp% ENDPROC prim% += 1 all% += mp% DIV SUM(i%()) t%() = U0%() . i%() PROCtri(t%(), mp%, all%, prim%) t%() = U1%() . i%() PROCtri(t%(), mp%, all%, prim%) t%() = U2%() . i%() PROCtri(t%(), mp%, all%, prim%) ENDPROC