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.

Showing 1-1 of 1 results.

A294022 Sum of the differences of the larger and smaller parts in the partitions of n into two parts with the larger part prime.

Original entry on oeis.org

0, 0, 1, 2, 1, 4, 3, 8, 6, 4, 3, 12, 10, 20, 18, 16, 14, 28, 25, 40, 36, 32, 29, 48, 44, 40, 37, 34, 31, 56, 52, 78, 73, 68, 64, 60, 56, 88, 84, 80, 76, 112, 107, 144, 138, 132, 127, 168, 162, 156, 150, 144, 138, 184, 177, 170, 163, 156, 150, 202, 195, 248
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 21 2017

Keywords

Comments

Sum of the slopes of the tangent lines along the left side of the parabola b(x) = n*x-x^2 such that n-x is prime for x in 0 < x <= floor(n/2). For example, d/dx n*x-x^2 = n-2x. So for a(12), the integer values of x which make 12-x prime are x=1,5 and so a(12) = 12-2*1 + 12-2*5 = 10 + 2 = 12. - Wesley Ivan Hurt, Mar 24 2018

Examples

			There are two ways to partition n = 9 into a prime and a smaller positive integer: 7 + 2 and 5 + 4. So a(9) = (7 - 2) + (5 - 4) = 6. - _Michael B. Porter_, Mar 26 2018
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[(n - 2 i) (PrimePi[n - i] - PrimePi[n - i - 1]), {i, Floor[n/2]}], {n, 60}]
  • PARI
    a(n) = sum(i=1, n\2, (n - 2*i)*isprime(n-i)); \\ Michel Marcus, Mar 24 2018

Formula

a(n) = Sum_{i=1..floor(n/2)} (n - 2i) * A010051(n - i).
Showing 1-1 of 1 results.