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.

A082244 Smallest odd prime that is the sum of 2n+1 consecutive primes.

This page as a plain text file.
%I A082244 #17 Jan 09 2025 18:56:19
%S A082244 3,23,53,197,127,233,691,379,499,857,953,1151,1259,1583,2099,2399,
%T A082244 2417,2579,2909,3803,3821,4217,4651,5107,5813,6829,6079,6599,14153,
%U A082244 10091,8273,10163,9521,12281,13043,11597,12713,13099,16763,15527,16823,22741
%N A082244 Smallest odd prime that is the sum of 2n+1 consecutive primes.
%H A082244 Robert Israel, <a href="/A082244/b082244.txt">Table of n, a(n) for n = 0..10000</a>
%F A082244 The sum of the reciprocals = 0.4304...
%e A082244 For n = 2,
%e A082244 2+3+5+7+11=28
%e A082244 3+5+7+11+13=39
%e A082244 5+7+11+13+17=53
%e A082244 so 53 is the first prime that is the sum of 5 consecutive primes
%p A082244 P:= select(isprime, [seq(i,i=3..3000,2)]):
%p A082244 S:= [0,op(ListTools:-PartialSums(P))]: nS:= nops(S):
%p A082244 R:= NULL:
%p A082244 for n from 1 do
%p A082244   found:= false;
%p A082244   for j from 1 to nS - 2*n + 1 while not found do
%p A082244     v:= S[j+2*n-1]-S[j];
%p A082244     if isprime(v) then R:= R,v; found:= true fi
%p A082244   od;
%p A082244   if not found then break fi;
%p A082244 od:
%p A082244 R; # _Robert Israel_, Jan 09 2025
%t A082244 Join[{3},Table[SelectFirst[Total/@Partition[Prime[Range[1000]],2n+1,1],PrimeQ],{n,50}]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 15 2016 *)
%o A082244 (PARI) \\ First prime that the sum of an odd number of consecutive primes
%o A082244 psumprm(n) = { sr=0; forstep(i=1,n,2, s=0; for(j=1,i, s+=prime(j); ); for(x=1,n, s = s - prime(x)+ prime(x+i); if(isprime(s),sr+=1.0/s; print1(s" "); break); ); ); print(); print(sr) }
%Y A082244 See A070934 for another version.
%Y A082244 Cf. A034962, A082246, A082251, A127340, A127341, A161612, A215991-A216020.
%K A082244 easy,nonn
%O A082244 0,1
%A A082244 _Cino Hilliard_, May 09 2003