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.

A135274 a(n) = prime(2*n) - prime(2*n-1) + prime(2*n+1).

Original entry on oeis.org

6, 13, 19, 25, 37, 47, 49, 65, 69, 77, 89, 103, 107, 113, 131, 141, 151, 159, 173, 185, 193, 199, 213, 239, 235, 247, 267, 275, 279, 287, 317, 317, 335, 353, 355, 373, 385, 393, 409, 427, 433, 441, 453, 469, 469, 499, 503, 513, 535, 565
Offset: 1

Views

Author

Cino Hilliard, Dec 02 2007

Keywords

Comments

Original name was: Difference and sum of staircase primes according to the rule: bottom - top + next top.
We list the primes in staircase fashion as follows.
2
3.5
..7.11
....13.17
.......19.23
..........29.31
.............37.41
.....................
....................n
....................n+1.n+2.
The right diagonal, RD(n), is the set of top primes and the left diagonal, LD(x), is the set of bottom primes. Then a(n) = LD(n+1) - RD(n) + RD(n+2).

Programs

  • Mathematica
    Join[{6},#[[3]]-#[[2]]+#[[4]]&/@Partition[Prime[Range[2,110]],4,2]] (* Harvey P. Dale, Nov 16 2011 *)
  • PARI
    g(n) = forstep(x=1,n,2,y=prime(x+1)-prime(x)+prime(x+2);print1(y","))
    
  • PARI
    a(n)=prime(2*n)-prime(2*n-1)+prime(2*n+1); \\ Joerg Arndt, Oct 08 2016

Formula

a(n) = A181428(2*n-1). - R. J. Mathar, Sep 10 2016

Extensions

New name from Joerg Arndt, Oct 08 2016