Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #27 Jun 27 2022 16:20:48
%S 0,4,6,8,16,20,21,40,45,47,52,64,67,71,72,74,88
%N Numbers n such that 2^n + n! is the sum of 2 squares.
%C Integers n such that the equation 2^n + n! = x^2 + y^2 where x and y are integers is solvable.
%C 4, 8, 16 and 64 are powers of 2. What is the next power of 2 (if any) in this sequence?
%C 103 <= a(18) <= 108. 108, 117, 144, 176, 254, 537 are terms. - _Chai Wah Wu_, Jul 22 2020
%e 6 is a term because 2^6 + 6! = 28^2.
%e 8 is a term because 2^8 + 8! = 24^2 + 200^2.
%e 21 is a term because 2^21 + 21! = 1222129664^2 + 7042537984^2.
%t Select[Range[0, 64], SquaresR[2, 2^# + #!] > 0 &] (* _Michael De Vlieger_, Mar 07 2016 *)
%o (PARI) isA001481(n) = #bnfisintnorm(bnfinit(z^2+1), n);
%o for(n=0, 1e2, if(isA001481(n!+2^n), print1(n, ", ")));
%o (Python)
%o from math import factorial
%o from itertools import count, islice
%o from sympy import factorint
%o def A269833_gen(): # generator of terms
%o return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint((1<<n)+factorial(n)).items()),count(0))
%o A269833_list = list(islice(A269833_gen(),9)) # _Chai Wah Wu_, Jun 27 2022
%Y Cf. A001481, A007611.
%K nonn,more
%O 1,2
%A _Altug Alkan_, Mar 06 2016
%E a(17) from _Chai Wah Wu_, Jul 22 2020