login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Number of ways writing n! as sums of a prime and a nonprime.
0

%I #20 Jul 17 2024 08:48:31

%S 0,0,2,3,6,50,307,2329,19907,181263,1736542,19044663,220730823,

%T 2845615949,39412442640

%N Number of ways writing n! as sums of a prime and a nonprime.

%F a(n) = A062602(n!).

%F a(n) = n!/2 - A062310(n) - A062311(n) for n >= 2. - _Amiram Eldar_, Jul 17 2024

%e For n = 4: 4! = 24 = 23+1 = 2+22 = 3+21, so a(4) = 3.

%o (PARI) a(n) = {my(c = 0, m = n!); forprime(p = 2, m-1, if(!isprime(m - p), c++)); c;} \\ _Amiram Eldar_, Jul 17 2024

%Y Cf. A000142, A062310, A062311, A062602.

%K nonn,more

%O 1,3

%A _Labos Elemer_, Jul 05 2001

%E a(9)-a(13) from _Sean A. Irvine_, Mar 26 2023

%E a(14)-a(15) from _Amiram Eldar_, Jul 17 2024