cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 05 2001

Keywords

Examples

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

Crossrefs

Programs

  • 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

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

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