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.

A262138 Interleaved first and second differences of the prime numbers.

Original entry on oeis.org

1, 1, 2, 0, 2, 2, 4, -2, 2, 2, 4, -2, 2, 2, 4, 2, 6, -4, 2, 4, 6, -2, 4, -2, 2, 2, 4, 2, 6, 0, 6, -4, 2, 4, 6, -2, 4, -2, 2, 4, 6, -2, 4, 2, 6, 2, 8, -4, 4, -2, 2, 2, 4, -2, 2, 2, 4, 10, 14, -10, 4, 2, 6, -4, 2, 8, 10, -8, 2, 4, 6, 0, 6, -2, 4, 2, 6, 0, 6
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 12 2015

Keywords

Comments

a(2*n-1) = A001223(n); a(2*n) = A036263(n+2);
a(2*n-1) = prime(n+1) - prime(n);
a(2*n) = prime(n+2) - 2*prime(n+1) + prime(n);
a(2*A064113(n)) = 0.

Examples

			A000040: 2  3   5   7   11  13  17   19  23  29   31  37   41   43  47  53
A001223:  1   2   2   4    2   4    2   4   6    2   6    4    2   4   6
A036263:    1   0   2   -2   2   -2   2   2   -4   4   -2   -2   2   2   0
A262138:  1 1 2 0 2 2 4 -2 2 2 4 -2 2 2 4 2 6 -4 2 4 6 -2 4 -2 2 2 4 2 6 0
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a262138 n = a262138_list !! (n-1)
    a262138_list = concat $ transpose [a001223_list, a036263_list]
  • Mathematica
    With[{nn=50},Riffle[Differences[Prime[Range[nn]]],Differences[ Prime[ Range[ nn]],2]]] (* Harvey P. Dale, Nov 01 2015 *)