login
Number of ways writing 2^n as a sum of a prime and a nonprime.
2

%I #19 Jul 17 2024 08:59:07

%S 0,0,1,2,2,7,8,25,38,75,128,259,458,876,1598,3024,5672,10753,20372,

%T 38656,73547,140669,268537,514307,986379,1896755,3650109,7036061,

%U 13580371,26241380,50765806,98317489,190597373,369832498,718266991,1396138085,2715823187,5287080080

%N Number of ways writing 2^n as a sum of a prime and a nonprime.

%H Amiram Eldar, <a href="/A062305/b062305.txt">Table of n, a(n) for n = 0..40</a>

%F a(n) = A062602(2^n) = number of prime+nonprime partitions of 2^n.

%F a(n) = 2^(n-1) - A006307(n) - A062306(n) for n >= 1. - _Amiram Eldar_, Jul 17 2024

%e For n = 5: 2^5 = 32 = 31+1 = 2+30 = 5+27 = 7+25 = 11+21 = 17+15 = 23+9 so a(5) = 7.

%o (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

%Y Cf. A061358, A062602, A062306, A006307, A062610.

%K nonn

%O 0,4

%A _Labos Elemer_, Jul 05 2001

%E More terms from _Dean Hickerson_, Jul 23 2001

%E a(28)-a(32) from _Sean A. Irvine_, Mar 25 2023

%E a(33)-a(37) from _Amiram Eldar_, Jul 17 2024