Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def next_pythagorean_triples(previous):
matrices = np.array(
[[-1, 2, 2],
[-2, 1, 2],
[-2, 2, 3],
[1, 2, 2],
[2, 1, 2],
[2, 2, 3],
[1, -2, 2],
[2, -1, 2],
[2, -2, 3]])
next_triples = np.transpose(matrices @ np.transpose(previous))
next_triples = next_triples.reshape((3 * previous.shape[0], previous.shape[1]))
return next_triples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.