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.

This page as a plain text file.
%I A262138 #11 Nov 01 2015 23:57:58
%S 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,6,
%T A262138 -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,
%U A262138 4,2,6,-4,2,8,10,-8,2,4,6,0,6,-2,4,2,6,0,6
%N A262138 Interleaved first and second differences of the prime numbers.
%C A262138 a(2*n-1) = A001223(n); a(2*n) = A036263(n+2);
%C A262138 a(2*n-1) = prime(n+1) - prime(n);
%C A262138 a(2*n) = prime(n+2) - 2*prime(n+1) + prime(n);
%C A262138 a(2*A064113(n)) = 0.
%H A262138 Reinhard Zumkeller, <a href="/A262138/b262138.txt">Table of n, a(n) for n = 1..10000</a>
%e A262138 A000040: 2  3   5   7   11  13  17   19  23  29   31  37   41   43  47  53
%e A262138 A001223:  1   2   2   4    2   4    2   4   6    2   6    4    2   4   6
%e A262138 A036263:    1   0   2   -2   2   -2   2   2   -4   4   -2   -2   2   2   0
%e A262138 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
%t A262138 With[{nn=50},Riffle[Differences[Prime[Range[nn]]],Differences[ Prime[ Range[ nn]],2]]] (* _Harvey P. Dale_, Nov 01 2015 *)
%o A262138 (Haskell)
%o A262138 import Data.List (transpose)
%o A262138 a262138 n = a262138_list !! (n-1)
%o A262138 a262138_list = concat $ transpose [a001223_list, a036263_list]
%Y A262138 Cf. A036263, A001223, A000040.
%Y A262138 Cf. A064113.
%K A262138 sign
%O A262138 1,3
%A A262138 _Reinhard Zumkeller_, Sep 12 2015