login
Perfect powers equal to the sum of 2 factorial numbers.
10

%I #23 Nov 05 2020 06:48:29

%S 4,8,25,121,144,5041

%N Perfect powers equal to the sum of 2 factorial numbers.

%C a(7), if it exists, is greater than 10^100.

%C a(7), if it exists, is greater than 10000!. - _Filip Zaludek_, Jul 18 2017

%C a(7), if it exists, is greater than 11750!. - _Filip Zaludek_, Sep 07 2018

%C a(7), if it exists, is greater than 20000!. - _Filip Zaludek_, Nov 04 2020

%H Giovanni Resta, <a href="/A227644/a227644.txt">Decompositions of a(1)-a(6)</a>

%e 5041 = 71^2 = 1! + 7!.

%o (C)

%o /* To compile: gcc -Wall -O2 A227644.c -o A227644 -lgmp */

%o #include <stdio.h>

%o #include <stdlib.h>

%o #include <gmp.h>

%o int main()

%o {

%o int bsz=256, a=0;

%o mpz_t *f, t;

%o f = malloc(sizeof(mpz_t) * bsz);

%o mpz_init(t); mpz_init(f[0]); mpz_set_ui(f[0], 1);

%o while (1)

%o {

%o a += 1;

%o if (a == bsz)

%o {

%o bsz *= 2;

%o f = (mpz_t *) realloc(f, sizeof(mpz_t) * bsz);

%o }

%o mpz_init(f[a]);

%o mpz_mul_ui(f[a], f[a-1], a);

%o for (int i=1; i<=a; i++)

%o {

%o mpz_add(t, f[a], f[i]);

%o if (mpz_perfect_power_p(t))

%o {

%o gmp_printf("%Zd, ", t);

%o fflush(stdout);

%o }

%o }

%o }

%o return 0;

%o }

%Y Cf. A114377, A227645, A227646, A227647, A227648, A227649, A227650, A227651, A065433, A085692.

%K nonn,more

%O 1,1

%A _Giovanni Resta_, Jul 19 2013