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.

A179835 Smallest k > 0 such that prime(n-k) + prime(n+k) = 2*prime(n), or 0 if there is no such k.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 2, 0, 0, 3, 3, 6, 3, 0, 0, 1, 7, 4, 8, 3, 0, 0, 7, 4, 6, 6, 2, 2, 0, 0, 6, 8, 7, 12, 0, 2, 1, 0, 6, 1, 2, 4, 8, 15, 15, 0, 1, 0, 0, 0, 6, 0, 0, 2, 1, 1, 0, 0, 6, 0, 0, 0, 19, 7, 0, 0, 17, 5, 29, 3, 15, 15, 5, 1, 5, 20, 20, 4, 7, 2, 21, 2, 21, 4, 3, 5, 4, 27, 3, 0, 0, 5, 28, 2, 0, 0, 0, 21, 0, 30
Offset: 1

Views

Author

T. D. Noe, Jan 10 2011

Keywords

Crossrefs

Cf. A178609 (largest k), A178670 (number of k)

Programs

  • Mathematica
    nn=1000; p=Prime[Range[2*nn]]; Table[s=Take[p,n-1] + Reverse[Take[p, {n+1,2n-1}]]; pos=Position[s,2*p[[n]]]; If[pos=={}, 0, n-pos[[-1,1]]], {n, nn}]