A227644 Perfect powers equal to the sum of 2 factorial numbers.
4, 8, 25, 121, 144, 5041
Offset: 1
Examples
5041 = 71^2 = 1! + 7!.
Links
- Giovanni Resta, Decompositions of a(1)-a(6)
Crossrefs
Programs
-
C
/* To compile: gcc -Wall -O2 A227644.c -o A227644 -lgmp */ #include
#include #include int main() { int bsz=256, a=0; mpz_t *f, t; f = malloc(sizeof(mpz_t) * bsz); mpz_init(t); mpz_init(f[0]); mpz_set_ui(f[0], 1); while (1) { a += 1; if (a == bsz) { bsz *= 2; f = (mpz_t *) realloc(f, sizeof(mpz_t) * bsz); } mpz_init(f[a]); mpz_mul_ui(f[a], f[a-1], a); for (int i=1; i<=a; i++) { mpz_add(t, f[a], f[i]); if (mpz_perfect_power_p(t)) { gmp_printf("%Zd, ", t); fflush(stdout); } } } return 0; }
Comments