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.

A114557 a(2n-1) = 2*(p-1) and a(2n) = p + 3, where p=prime(n).

Original entry on oeis.org

2, 5, 4, 6, 8, 8, 12, 10, 20, 14, 24, 16, 32, 20, 36, 22, 44, 26, 56, 32, 60, 34, 72, 40, 80, 44, 84, 46, 92, 50, 104, 56, 116, 62, 120, 64, 132, 70, 140, 74, 144, 76, 156, 82, 164, 86, 176, 92, 192, 100, 200, 104, 204, 106, 212, 110, 216, 112, 224, 116, 252, 130, 260, 134
Offset: 1

Views

Author

Roger L. Bagula, Feb 15 2006

Keywords

Programs

  • Magma
    [((3-(-1)^n)*NthPrime(Floor((n+1)/2)) + (1+5*(-1)^n))/2: n in [1..70]]; // G. C. Greubel, May 20 2019
    
  • Mathematica
    Flatten[Table[Abs[Coefficient[Expand[(x+2)(x -(1 +Sqrt[Prime[n]]))*(x - (1 - Sqrt[Prime[n]]))], x, m]], {n, 1, 50}, {m, 0, 1}]]
    With[{p = Prime[Floor[(n+1)/2]]}, Table[If[OddQ[n], 2*(p-1), p+3], {n, 1, 70}]] (* G. C. Greubel, May 20 2019 *)
  • PARI
    {a(n) = ((3-(-1)^n)*prime(floor((n+1)/2)) + (1+5*(-1)^n))/2}; \\ G. C. Greubel, May 20 2019
    
  • Sage
    [( (3-(-1)^n)*nth_prime(floor((n+1)/2))+ (1+5*(-1)^n))/2 for n in (1..70)] # G. C. Greubel, May 20 2019

Formula

a(2n-1) = A037168(n). a(2n) = A113935(n).
a(n) = ( (3 - (-1)^n)*prime(floor((n+1)/2)) + (1 + 5*(-1)^n) )/2. - G. C. Greubel, May 20 2019