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.

A294113 Sum of the smaller parts of the partitions of 2n into two parts with larger part prime.

Original entry on oeis.org

0, 3, 4, 4, 8, 6, 11, 8, 13, 20, 28, 24, 32, 25, 32, 41, 51, 42, 51, 40, 49, 60, 72, 60, 72, 84, 97, 111, 125, 109, 124, 107, 121, 136, 152, 169, 188, 169, 187, 206, 226, 204, 224, 199, 218, 238, 258, 229, 248, 268, 289, 312, 336, 306, 331, 357, 384, 412
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 22 2017

Keywords

Examples

			For n=7, 2n = 14 can be partitioned into two parts with the larger part prime as 13 + 1, 11 + 3, and 7 + 7. So a(7) = 1 + 3 + 7 = 11. - _Michael B. Porter_, Mar 14 2018
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get a(1)..a(n)
    P:= select(isprime, [2,seq(i,i=3..2*N,2)]):
    S:= ListTools:-PartialSums(P):
    f:= proc(n) local k1,k2;
         k1:= numtheory:-pi(2*n);
         k2:= numtheory:-pi(n-1);
         2*n*(k1-k2) - S[k1] + S[k2]
    end proc:
    f(1):= 0:
    seq(f(n),n=1..N); # Robert Israel, Mar 13 2018
  • Mathematica
    Table[Sum[i (PrimePi[2 n - i] - PrimePi[2 n - i - 1]), {i, n}], {n, 80}]
  • PARI
    a(n) = sum(k=1, n, k*isprime(2*n-k)); \\ Michel Marcus, Oct 24 2017
    
  • PARI
    a(n) = my(res = 0); forprime(p = n, 2*n, res+=(2*n - p)); res \\ David A. Corneth, Oct 24 2017

Formula

a(n) = Sum_{i=1..n} i * A010051(2n-i).
a(n) = 2*n*(A000720(2*n)-A000720(n-1)) - A034387(2*n) + A034387(n-1) for n >= 2. - Robert Israel, Mar 13 2018
Showing 1-1 of 1 results.