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.

A291564 Number of partitions of 2n into two parts such that one part is prime and the other is nonprime.

Original entry on oeis.org

0, 1, 2, 2, 1, 3, 3, 2, 3, 4, 3, 3, 4, 5, 4, 7, 4, 3, 9, 6, 5, 8, 7, 5, 7, 9, 6, 10, 9, 5, 13, 8, 6, 15, 9, 8, 12, 11, 7, 14, 13, 7, 14, 15, 6, 16, 15, 10, 19, 13, 10, 17, 16, 12, 17, 15, 10, 18, 19, 6, 23, 20, 10, 25, 17, 14, 21, 22, 17, 20, 19, 12, 23, 24
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 20 2017

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add(`if`(isprime(n+i) xor isprime(n-i), 1, 0), i=1..n-1):
    seq(a(n), n=1..80);  # Alois P. Heinz, Mar 05 2021
  • Mathematica
    Table[n - Sum[KroneckerDelta[(PrimePi[k] - PrimePi[k - 1]), (PrimePi[2 n - k] - PrimePi[2 n - 1 - k])], {k, n}], {n, 80}]

Formula

a(n) = n - Sum_{i=1..n} [A010051(i) = A010051(2n-i)], where [] is the Iverson bracket.
a(n) = n - A291563(n).