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.

A237057 a(n) = smallest prime > a(n-1) such that a(n)+4n is also prime.

This page as a plain text file.
%I A237057 #20 Feb 26 2015 14:44:28
%S A237057 2,3,5,7,13,17,19,31,41,43,61,83,89,97,101,103,109,113,127,151,191,
%T A237057 193,223,239,241,283,293,311,331,347,359,367,419,431,433,461,463,499,
%U A237057 509,521,523,563,571,601,647,659,673,719,727,733,797,809,811,821,823,829
%N A237057 a(n) = smallest prime > a(n-1) such that a(n)+4n is also prime.
%C A237057 Many twin primes belong to the sequence, for example (41, 43) and (191, 193).
%C A237057 Many consecutive primes also appear such as (13, 17) and (83, 89).
%H A237057 Harvey P. Dale, <a href="/A237057/b237057.txt">Table of n, a(n) for n = 0..1000</a>
%e A237057 a(5)=17 since 17+4*5=17+20=37 is prime. 11+4*4=27 is not prime, so 11 is not in the sequence.
%t A237057 nxt[{n_,p_}]:=Module[{np=NextPrime[p]},While[!PrimeQ[np+4(n+1)],np = NextPrime[ np]];{n+1,np}]; Transpose[NestList[nxt,{0,2},60]][[2]] (* _Harvey P. Dale_, Feb 26 2015 *)
%o A237057 (PARI) a237057(maxp) = {my(a=[2], n=1); forprime(p=3, maxp, if(isprime(p+4*n), n++; a=concat(a, p)));  a} \\ _Colin Barker_, Feb 12 2014
%Y A237057 Cf. A108184.
%K A237057 nonn
%O A237057 0,1
%A A237057 _Carmine Suriano_, Feb 03 2014