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.

A288726 a(n) = Sum_{i=floor((n-1)/2)..n-1} i * c(i), where c is the prime characteristic (A010051).

Original entry on oeis.org

0, 0, 0, 2, 5, 5, 10, 8, 15, 12, 12, 12, 23, 18, 31, 31, 31, 24, 41, 41, 60, 60, 60, 60, 83, 72, 72, 72, 72, 59, 88, 88, 119, 119, 119, 119, 119, 102, 139, 139, 139, 120, 161, 161, 204, 204, 204, 204, 251, 228, 228, 228, 228, 228, 281, 281, 281, 281, 281, 281, 340, 311, 372, 372, 372, 341, 341, 341, 408
Offset: 0

Views

Author

Wesley Ivan Hurt, Jun 14 2017

Keywords

Comments

Sum of the primes in the n-th column of the example in A258087.

Crossrefs

Programs

  • Maple
    with(numtheory): A288726:=n->add(i*(pi(i)-pi(i-1)), i=floor((n-1)/2)..n-1): seq(A288726(n), n=0..100);
    # Alternative:
    M:= 100: # to get a(0) to a(2*M+1)
    A:= Array(0..2*M+1):
    A[3]:= 2:
    for k from 2 to M do
       if isprime(2*k-1) then A[2*k]:= A[2*k-1]+2*k-1 else A[2*k]:=A[2*k-1] fi;
       if isprime(k-1) then A[2*k+1]:= A[2*k]-(k-1) else A[2*k+1]:= A[2*k] fi;
    od:
    convert(A,list); # Robert Israel, Jun 16 2017
  • Mathematica
    Table[Sum[i (PrimePi[i] - PrimePi[i - 1]), {i, Floor[(n - 1)/2], n - 1}], {n, 0, 68}] (* Michael De Vlieger, Jun 14 2017 *)
  • PARI
    a(n) = sum(i=floor((n-1)/2), n-1, i*isprime(i)) \\ Felix Fröhlich, Jun 16 2017

Formula

From Robert Israel, Jun 16 2017: (Start)
For k >= 2, a(2*k+1) - a(2*k) = 1-k if k-1 is prime, otherwise 0.
a(2*k+2) - a(2*k+1) = 2*k+1 if 2*k+1 is prime, otherwise 0. (End)
a(n) = A288656(n) - A288656(n-1), n>=1. - Wesley Ivan Hurt, Dec 26 2023