login
A062305
Number of ways writing 2^n as a sum of a prime and a nonprime.
2
0, 0, 1, 2, 2, 7, 8, 25, 38, 75, 128, 259, 458, 876, 1598, 3024, 5672, 10753, 20372, 38656, 73547, 140669, 268537, 514307, 986379, 1896755, 3650109, 7036061, 13580371, 26241380, 50765806, 98317489, 190597373, 369832498, 718266991, 1396138085, 2715823187, 5287080080
OFFSET
0,4
LINKS
FORMULA
a(n) = A062602(2^n) = number of prime+nonprime partitions of 2^n.
a(n) = 2^(n-1) - A006307(n) - A062306(n) for n >= 1. - Amiram Eldar, Jul 17 2024
EXAMPLE
For n = 5: 2^5 = 32 = 31+1 = 2+30 = 5+27 = 7+25 = 11+21 = 17+15 = 23+9 so a(5) = 7.
PROG
(PARI) a(n) = {my(c = 0, m = 1 << n); forprime(p = 2, m-1, if(!isprime(m - p), c++)); c; } \\ Amiram Eldar, Jul 17 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 05 2001
EXTENSIONS
More terms from Dean Hickerson, Jul 23 2001
a(28)-a(32) from Sean A. Irvine, Mar 25 2023
a(33)-a(37) from Amiram Eldar, Jul 17 2024
STATUS
approved