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.

A158754 Courteous prime numbers.

This page as a plain text file.
%I A158754 #5 Nov 21 2013 12:49:35
%S A158754 31,41,101,109,137,191,193,239,283,311,313,569,641,659,661,821,1091,
%T A158754 1153,1289,1291,1301,1303,1319,1429,1453,1619,1667,1877,2027,2081,
%U A158754 2129,2239,2309,2341,2381,2591,2593,2711,2713,2971,3001,3121,3253,3299,3301
%N A158754 Courteous prime numbers.
%C A158754 Courteous prime numbers are twin prime numbers and can be written as the sum of two or more consecutive twin prime numbers. 7+11+13=31,11+13+17=41,..
%t A158754 lst={};Do[pp=Prime[m];If[PrimeQ[pp-2]||PrimeQ[pp+2],k=1;Do[k++;p=Prime[n];If[PrimeQ[p-2]||PrimeQ[p+2],pp+=p;If[PrimeQ[pp],If[PrimeQ[pp-2]||PrimeQ[pp+2],AppendTo[lst,pp]]]],{n,m+1,4*6!}]],{m,1,4*6!}];lst;(*Courteous Prime Numbers.*)Take[Union[lst],5! ]
%t A158754 upto=3400;With[{tps=Union[Flatten[Select[Partition[Prime[Range[ PrimePi[ upto]]], 2,1], Last[#]-First[#]==2&]]]}, Select[Union[Flatten[Table[ Total/@Partition[tps,n,1],{n,2,40}]]],MemberQ[tps,#]&&#<=upto&]] (* _Harvey P. Dale_, Sep 25 2011 *)
%Y A158754 Cf. A138591, A065867
%K A158754 nonn
%O A158754 1,1
%A A158754 _Vladimir Joseph Stephan Orlovsky_, Mar 25 2009