Created
April 3, 2024 17:31
-
-
Save dpiponi/c75a39dbaa8e875c74f25e0e20d7fbad to your computer and use it in GitHub Desktop.
Print the tribonacci numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// See https://arxiv.org/abs/2404.01483 | |
long p(long x, long y, long z) | |
{ | |
return x*x*x + 2*x*x*y + x*x*z + 2*x*y*y - 2*x*y*z - x*z*z + 2*y*y*y - 2*y*z*z + z*z*z; | |
} | |
const int N = 505; | |
int main() | |
{ | |
for (long x = 1; x < N; ++x) | |
{ | |
for (long y = x + 1; y < N; ++y) | |
{ | |
for (long z = y + 1; z < N; ++z) | |
{ | |
if (p(x, y, z) == 1) | |
{ | |
std::cout << x << ' ' << y << ' ' << z << std::endl; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment