From Jon E. Schoenfield, Jun 07 2019 a(8) > 23 (if such a number k exists). Proof: p^8 == 1 (mod 480) for all primes p > 5. (A079612(8)=480.) There are 3 primes <= 5, so there are 2^3 = 8 subsets of the 8th powers of those primes, i.e., {}, {2^8}, {3^8}, {5^8}, {2^8, 3^8}, {2^8, 5^8}, {3^8, 5^8} and {2^8, 3^8, 5^8}. The corresponding sums 0, 2^8, 3^8, 5^8, 2^8 + 3^8, 2^8 + 5^8, 3^8 + 5^8, and 2^8 + 3^8 + 5^8, have modulo-480 residues 0, 256, 321, 385, 97, 161, 226, and 2, respectively, the largest of which is 385 = 480 - 95 (which occurs for the subset consisting only of 5^8). Therefore, since 480 divides k! for all k >= 8 (and it is easily shown that a(8) is not a positive number < 8), any set of distinct primes whose 8th powers sum to k! must include at least 95 primes p > 5. However, the sum of the 8th powers of the smallest 95 such primes exceeds 23!, so a(8) > 23. QED (By a similar argument using residues of p^12 mod 65520 -- i.e., p^12 mod A079612(12) -- a(12) > 43 if such a number k exists for n=12.) In the above list of modulo-480 residues, the largest value other than 385 is 321, so a set of distinct primes whose 8th powers sum to a factorial that includes more than 95 primes p > 5 would have to include at least 480 - 321 = 159 such primes. However, the sum of their 8th powers would necessarily exceed 24!; thus, if a(8)=24, then the set of included primes consists of p=5 and exactly 95 primes p > 5. Additionally, since p^8 == 1 or 16 (mod 17) for all primes p except 17, and since 24! == 0 (mod 17), if we let n0, n1, and n16 be the number of primes (among the 96 whose 8th powers sum to 24!) whose 8th powers are congruent to 0, 1, or 16 modulo 17, respectively, then 0*n0 + 1*n1 + 16*n16 == 0 (mod 17) and since n0 + n1 + n16 = 96, the possible cases are n0 = 0, n1 = 14, n16 = 82 n0 = 0, n1 = 31, n16 = 65 n0 = 0, n1 = 48, n16 = 48 n0 = 0, n1 = 65, n16 = 31 n0 = 0, n1 = 82, n16 = 14 and n0 = 1, n1 = 5, n16 = 90 n0 = 1, n1 = 22, n16 = 73 n0 = 1, n1 = 39, n16 = 56 n0 = 1, n1 = 56, n16 = 39 n0 = 1, n1 = 73, n16 = 22 n0 = 1, n1 = 90, n16 = 5 However, the 96 primes cannot include 2 or 3, and the sum of the 8th powers of the 63 smallest primes p > 3 for which p^8 == 1 (mod 17) exceeds 24!, so n1 < 63; likewise, the sum of the 8th powers of the 67 smallest primes p > 3 for which p^8 == 16 (mod 17) exceeds 24!, so n16 < 67. This leaves as possibilities only the cases n0 = 0, n1 = 31, n16 = 65 n0 = 0, n1 = 48, n16 = 48 n0 = 1, n1 = 39, n16 = 56 n0 = 1, n1 = 56, n16 = 39 and, in each, the primes included among the 96 in the solution include neither 2 nor 3, but must include 5. Clearly, none of the 96 included primes can exceed prime(160) = 941, since prime(161)^8 = 947^8 > 24!. Furthermore, it can be shown that none of the 96 primes can exceed prime(158) = 929: For r=1 and r=16, let P_r(j) be the sum of the 8th powers of the j smallest primes p > 3 that satisfy p^8 mod 17 = r. Then the largest included prime p satisfying p^8 mod 17 = 1 cannot exceed t_1 = (24! - (n0*17^8 + P_1(n1 - 1) + P_16(n16)))^(1/8) and, similarly, the largest included prime p satisfying p^8 mod 17 = 16 cannot exceed t_16 = (24! - (n0*17^8 + P_1(n1) + P_16(n16 - 1)))^(1/8). For each of the four cases above, if, for r = 1 and 16, we define q_r as the largest prime p such that p^8 mod 17 = r and p <= t_r, then we get Case | n0 n1 n16 q_1 q_16 =====+======================= 1 | 0 31 65 773 823 2 | 0 48 48 919 929 3 | 1 39 56 883 911 4 | 1 56 39 883 887 (In each case, the smallest prime included in the solution is p=5, which is included in the count for n16, since 5^8 mod 17 = 16.) For each of the four cases, let S_r (for r = 1 and 16) be the set of primes p in [5, q_r] such that p^8 mod 17 = r. Of the four cases, the one with the smallest values of q_1 and q_16 is Case 1 (whose requirement of 65 primes from S_16 necessitates the inclusion of a significant number of relatively large such primes). It would seem that, if there is any one of the four cases for which it might be practical to carry out an exhaustive search, it would be Case 1. Since, for Case 1, S_1 contains only 66 primes {13, 19, 43, ..., 773}, and S_16 contains only 73 primes {5, 7, 11, 23, ..., 823}, the set of 96 primes for a Case 1 solution would have to consist of exactly 31 of the 66 primes in S_1 and exactly 65 of the 73 primes in S_16 (one of those 65 would have to be p=5) -- i.e., p=5 and exactly 64 of the 72 primes (not including p=5) in S_16. There are C(72,64) = 11,969,016,345 subsets consisting of 64 of the 72 primes (other than p=5) in S_16, but only 1805 of those subsets have a sum of 8th powers that does not exceed 24! - 5^8 - P_1(31), and it would not be difficult to generate, and store in ascending order, a list of those 1805 sums, to be checked against sums s1 of the 8th powers of 31 of the 66 primes in S_1. However, from a quick check, it seems likely that are are billions (trillions?) of such sums s1 that do not exceed 24! - 5^8 - P_16(65).