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.

A114231 Smallest number m such that prime(n) + 2*prime(n-m) is a prime.

This page as a plain text file.
%I A114231 #5 Oct 31 2013 17:39:46
%S A114231 1,1,1,3,3,1,1,1,2,1,3,2,4,4,2,9,1,3,2,4,5,1,5,2,8,3,1,3,1,1,3,8,2,6,
%T A114231 1,4,3,8,2,7,7,14,9,7,1,4,3,1,1,1,5,1,1,2,8,4,1,8,2,4,1,8,3,9,5,3,2,1,
%U A114231 4,1,4,4,2,3,2,4,2,12,3,1,1,3,12,2,1,2,5,5,3,3,10,4,19,1,6,4,8,7,2,5,9,2,3
%N A114231 Smallest number m such that prime(n) + 2*prime(n-m) is a prime.
%H A114231 Reinhard Zumkeller, <a href="/A114231/b114231.txt">Table of n, a(n) for n = 2..10000</a>
%e A114231 n=2, prime(2)+2*prime(2-1)=3+2*2=7 is prime, so a(2)=1;
%e A114231 n=3, prime(3)+2*prime(3-1)=5+2*3=11 is prime, so a(3)=1;
%e A114231 ...
%e A114231 n=17, prime(17)+2*prime(17-9)=59+2*19=97 is prime, so a(17)=9.
%t A114231 Table[p1 = Prime[n1]; n2 = n1 - 1; p2 = Prime[n2]; While[cp = p1 + 2*p2; ! PrimeQ[cp], n2--; If[n2 == 0, Print[n1]]; p2 = Prime[n2]]; n1 - n2, {n1, 2, 201}]
%o A114231 (Haskell)
%o A114231 a114231 n = head [m | m <- [1..],
%o A114231                       a010051 (a000040 n + 2 * a000040 (n - m)) == 1]
%o A114231 -- _Reinhard Zumkeller_, Oct 31 2013
%Y A114231 Cf. A114231, A114227, A114228.
%Y A114231 Cf. A010051, A000040.
%K A114231 easy,nonn
%O A114231 2,4
%A A114231 _Lei Zhou_, Nov 18 2005
%E A114231 Edited definition to conform to OEIS style. - _Reinhard Zumkeller_, Oct 31 2013