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.

A239731 Difference between sum of first n primes and prime(prime(n)).

Original entry on oeis.org

-1, 0, -1, 0, -3, 0, -1, 10, 17, 20, 33, 40, 59, 90, 117, 140, 163, 218, 237, 286, 345, 390, 443, 502, 551, 614, 701, 784, 881, 976, 1011, 1112, 1215, 1330, 1417, 1550, 1665, 1780, 1923, 2056, 2203, 2360, 2485, 2660, 2827, 3010, 3141, 3252, 3455, 3670, 3879, 4090, 4307, 4484, 4717, 4932, 5147, 5400, 5631, 5876, 6135, 6362, 6555, 6830, 7125, 7424, 7633, 7922
Offset: 1

Views

Author

Lear Young, Mar 30 2014

Keywords

Examples

			For n = 2 the a(2) = 0 solutions are prime(1) + prime(2) - prime(prime(2)) = 5 - 5 = 0.
		

Crossrefs

Programs

  • Maple
    A239731:=n->sum(ithprime(i), i=1..n) - ithprime(ithprime(n)); seq(A239731(n), n=1..50); # Wesley Ivan Hurt, Mar 30 2014
  • Mathematica
    Table[Sum[Prime[i], {i, n}] - Prime[Prime[n]], {n, 50}] (* Wesley Ivan Hurt, Mar 30 2014 *)
    #[[1]]-#[[2]]&/@Module[{nn=70,prs},prs=Accumulate[Prime[Range[nn]]];Thread[{prs,Prime[Prime[Range[nn]]]}]] (* Harvey P. Dale, Apr 10 2025 *)
  • PARI
    for(i = 1, 100, print1(sum(k = 1, i, prime(k)) - prime(prime(i))", ")) \\ Lear Young, Mar 30 2014
  • Sage
    [a - b for a, b in zip(oeis(7504)[1:], oeis(6450))] # Lear Young, Mar 30 2014
    

Formula

a(n) = A007504(n + 1) - A006450(n) = A007504(n + 1) - A000040(A000040(n)). - Wesley Ivan Hurt, Mar 30 2014
a(n) ~ (n^2 log n)/2. - Charles R Greathouse IV, Apr 08 2014