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.

Previous Showing 11-20 of 40 results. Next

A060328 Primes which are the sum of three consecutive composite numbers.

Original entry on oeis.org

23, 31, 41, 59, 67, 71, 109, 113, 131, 139, 157, 199, 211, 239, 251, 269, 293, 311, 337, 379, 383, 409, 419, 487, 491, 499, 503, 521, 571, 599, 631, 701, 751, 769, 773, 787, 829, 877, 881, 919, 941, 953, 991, 1009, 1013, 1039, 1049, 1061, 1103, 1117, 1151
Offset: 1

Views

Author

Robert G. Wilson v, Mar 30 2001

Keywords

Comments

"Consecutive" necessarily means consecutive in the list of composite numbers as opposed to consecutive in the integers, as the sum of any 3 consecutive integers is a multiple of 3. - Peter Munn, Aug 20 2023

Examples

			a(3) = 41 is equal to 12+14+15.
		

Crossrefs

Primes that are the sum of other numbers of consecutive composite numbers: A060254 (2), A060329 (4), A060330 (5), A060331 (6), A060332 (7), A060333 (8). See also A037174.
Cf. A034962.
Complement within A166039\{5, 11} of A151741.

Programs

  • Mathematica
    composite[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k - PrimePi[ k ] - 1 != n, k++ ]; k); b = {}; Do[ p = composite[ n ] + composite[ n + 1 ] + composite[ n + 2 ]; If[ PrimeQ[ p ], b = Append[ b, p ] ], {n, 1, 1000} ]; b

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

Original entry on oeis.org

3, 23, 53, 197, 127, 233, 691, 379, 499, 857, 953, 1151, 1259, 1583, 2099, 2399, 2417, 2579, 2909, 3803, 3821, 4217, 4651, 5107, 5813, 6829, 6079, 6599, 14153, 10091, 8273, 10163, 9521, 12281, 13043, 11597, 12713, 13099, 16763, 15527, 16823, 22741
Offset: 0

Views

Author

Cino Hilliard, May 09 2003

Keywords

Examples

			For n = 2,
2+3+5+7+11=28
3+5+7+11+13=39
5+7+11+13+17=53
so 53 is the first prime that is the sum of 5 consecutive primes
		

Crossrefs

See A070934 for another version.

Programs

  • Maple
    P:= select(isprime, [seq(i,i=3..3000,2)]):
    S:= [0,op(ListTools:-PartialSums(P))]: nS:= nops(S):
    R:= NULL:
    for n from 1 do
      found:= false;
      for j from 1 to nS - 2*n + 1 while not found do
        v:= S[j+2*n-1]-S[j];
        if isprime(v) then R:= R,v; found:= true fi
      od;
      if not found then break fi;
    od:
    R; # Robert Israel, Jan 09 2025
  • Mathematica
    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 *)
  • PARI
    \\ First prime that the sum of an odd number of consecutive primes
    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) }

Formula

The sum of the reciprocals = 0.4304...

A342439 Let S(n,k) denote the set of primes < 10^n which are the sum of k consecutive primes, and let K = maximum k >= 2 such that S(n,k) is nonempty; then a(n) = max S(n,K).

Original entry on oeis.org

5, 41, 953, 9521, 92951, 997651, 9964597, 99819619, 999715711, 9999419621, 99987684473, 999973156643, 9999946325147, 99999863884699, 999999149973119, 9999994503821977, 99999999469565483, 999999988375776737, 9999999776402081701
Offset: 1

Views

Author

Bernard Schott, Mar 12 2021

Keywords

Comments

Inspired by the 50th problem of Project Euler (see link).
There must be at least two consecutive primes in the sum.
The corresponding number K of consecutive primes to get this largest prime is A342440(n) and the first prime of these A342440(n) consecutive primes is A342453(n).
It can happen that the sums of K = A342440(n) consecutive primes give two (or more) distinct n-digit primes. In that case, a(n) is the greatest of these primes. Martin Ehrenstein proved that there are only two such cases when 1 <= n <= 19, for n = 7 and n = 15 (see corresponding examples).
Solutions and Python program are proposed in Dreamshire and Archive.today links. - Daniel Suteu, Mar 12 2021

Examples

			a(1) = 5 = 2+3.
a(2) = 41 = 2 + 3 + 5 + 7 + 11 + 13; note that 97 = 29 + 31 + 37 is prime, sum of 3 consecutive primes, but 41 is obtained by adding 6 consecutive primes, so, 97 is not a term.
A342440(7) = 1587, and there exist two 7-digit primes that are sum of 1587 consecutive primes; as 9951191 = 5+...+13399 < 9964597 = 7+...+13411 hence a(7) = 9964597.
A342440(15) = 10695879 , and there exist two 15-digit primes that are sum of 10695879 consecutive primes; as 999998764608469 = 7+...+192682309 < 999999149973119 = 13+...+192682337, hence a(15) = 999999149973119.
		

Crossrefs

Extensions

Name improved by N. J. A. Sloane, Mar 12 2021
a(4)-a(17) from Daniel Suteu, Mar 12 2021
a(18)-a(19) from Martin Ehrenstein, Mar 13 2021
a(7) and a(15) corrected by Martin Ehrenstein, Mar 15 2021

A065867 Primes which are the sum of a prime number of consecutive primes.

Original entry on oeis.org

5, 23, 31, 41, 53, 59, 67, 71, 83, 97, 101, 109, 131, 139, 173, 181, 197, 199, 211, 223, 233, 251, 263, 269, 271, 281, 311, 331, 349, 353, 373, 401, 421, 431, 439, 443, 449, 457, 463, 487, 491, 499, 503, 523, 563, 587, 593, 607, 617, 631, 647, 659, 661, 677
Offset: 1

Views

Author

Henry Bottomley, Dec 07 2001

Keywords

Examples

			5 = 2 + 3.
23 = 5 + 7 + 11.
31 = 7 + 11 + 13.
41 = 11 + 13 + 17.
53 = 5 + 7 + 11 + 13 + 17.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[s=Prime[m];k=1;Do[p=Prime[n];s+=p;k++;If[PrimeQ[s]&&PrimeQ[k],If[s<=10837,AppendTo[lst,s]]],{n,m+1,5*5!}],{m,5*5!}];lst=Take[Union@lst,500] (* Vladimir Joseph Stephan Orlovsky, Sep 13 2009 *)
    Module[{nn=60,prs},prs=Prime[Range[nn]];Take[Select[Union[ Flatten[ Table[ Total/@ Partition[prs,n,1],{n,prs}]]],PrimeQ],nn]] (* Harvey P. Dale, Aug 12 2016 *)

A164129 Primes that are the sums of cubes of three consecutive primes.

Original entry on oeis.org

66347, 199081, 332207, 581237, 733123, 1047691, 2647943, 3612799, 7505063, 10620793, 22715029, 32180581, 36355409, 60621553, 76753387, 98784001, 116319367, 147594259, 162516943, 177616529, 216596449, 252725563, 343774313
Offset: 1

Views

Author

Keywords

Examples

			23^3+29^3+31^3=66347, 37^3+41^3+43^3=199081, 43^3+47^3+53^3=332207,..
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[p=Prime[n]^3+Prime[n+1]^3+Prime[n+2]^3;If[PrimeQ[p],AppendTo[lst,p]],{n,6!}];lst
    Select[Total[#^3]&/@Partition[Prime[Range[100]],3,1],PrimeQ] (* Harvey P. Dale, Nov 04 2015 *)

Extensions

Edited by Charles R Greathouse IV, Oct 12 2009

A174518 Sums of two consecutive primes and composite numbers in-between.

Original entry on oeis.org

5, 12, 18, 45, 36, 75, 54, 105, 182, 90, 238, 195, 126, 225, 350, 392, 180, 448, 345, 216, 532, 405, 602, 837, 495, 306, 525, 324, 555, 1800, 645, 938, 414, 1584, 450, 1078, 1120, 825, 1190, 1232, 540, 2046, 576, 975, 594, 2665, 2821, 1125, 684, 1155, 1652
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_,x_]:=n*x+x*(x+1)/2;Table[Prime[n]+f[Prime[n],Prime[n+1]-Prime[n]-1]+Prime[n+1],{n,5!}]

Formula

a(n) = Sum_{k=prime(n)..prime(n+1)} k. - Wesley Ivan Hurt, Apr 27 2021

A211170 Primes that are sum of both three and five consecutive primes.

Original entry on oeis.org

83, 199, 311, 941, 1151, 1381, 2357, 3121, 4337, 4363, 4957, 5059, 7039, 8069, 8117, 8161, 8389, 8627, 8819, 8971, 9011, 9349, 10211, 10253, 13127, 14813, 16249, 19207, 19717, 21377, 23143, 24329, 32983, 34807, 38113, 39623, 41141, 44279, 45061, 45979, 58403
Offset: 1

Views

Author

Zak Seidov, Jan 31 2013

Keywords

Comments

Intersection of A034962 and A034965.

Examples

			a(1) = 83 = A034962(6) = 23 + 29 + 31 = A034965(3) = 11 + 13 + 17 + 19 + 23.
		

Crossrefs

Programs

  • Mathematica
    Module[{prs=Prime[Range[3000]],pr3,pr5},pr3=Select[Total/@Partition[ prs, 3, 1], PrimeQ];pr5=Select[Total/@Partition[prs,5,1],PrimeQ];Intersection[ pr3,pr5]] (* Harvey P. Dale, Oct 24 2016 *)

A259772 Primes p such that p^3 + q^2 + r is also prime, where p,q,r are consecutive primes.

Original entry on oeis.org

3, 17, 19, 43, 53, 89, 107, 149, 293, 401, 439, 449, 659, 809, 821, 937, 1009, 1031, 1091, 1097, 1123, 1163, 1181, 1259, 1277, 1367, 1427, 1657, 1721, 1777, 1789, 1811, 1987, 2027, 2063, 2207, 2333, 2417, 2503, 2657, 2713, 3067, 3079, 3083, 3251, 3389, 3491, 3527
Offset: 1

Views

Author

K. D. Bajpai, Jul 05 2015

Keywords

Examples

			a(2) = 17 is prime: 17^3 + 19^2 + 23 = 5297 which is also prime.
a(3) = 19 is prime: 19^3 + 23^2 + 29 = 7417 which is also prime.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo (3000) | IsPrime(k) where k is (p^3 + NextPrime(p)^2 + NextPrime(NextPrime(p)))];
  • Maple
    select(n -> isprime(n) and isprime((n)^3+nextprime(n)^2+nextprime(nextprime((n)))), [seq(n, n=1..10000)]);
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[#^3 + NextPrime[#]^2 + NextPrime[NextPrime[#]]]&]
    Select[Partition[Prime[Range[500]],3,1],PrimeQ[#[[1]]^3+ #[[2]]^2+ #[[3]]]&][[All,1]] (* Harvey P. Dale, Dec 23 2021 *)
  • PARI
    forprime(p=1, 3000, q=nextprime(p+1); r=nextprime(q+1); k=(p^3 + q^2 + r); if(isprime(k), print1(p,", ")))
    

A050207 Primes of the form p + (smallest prime >= p+1) + (smallest prime >= p+3) where p is a prime.

Original entry on oeis.org

23, 29, 41, 47, 59, 97, 131, 137, 223, 283, 311, 317, 367, 389, 457, 563, 587, 607, 677, 743, 839, 857, 907, 929, 941, 947, 1031, 1049, 1093, 1283, 1303, 1453, 1489, 1847, 1867, 1913, 1931, 1993, 2027, 2347, 2381, 2441, 2477, 2579, 2617, 2657
Offset: 1

Views

Author

Cino Hilliard, May 08 2003

Keywords

Comments

Originally an erroneous version of A034962.

Examples

			p = 5: 23 = 5 + 7 + 11;
p = 7: 29 = 7 + 11 + 11;
p = 11: 41 = 11 + 13 + 17;
p = 13: 47 = 13 + 17 + 17;
p = 17: 59 = 17 + 19 + 23;
p = 19: 65 = 19 + 23 + 23 is not prime, so not in the sequence;
p = 23: 81 = 23 + 29 + 29 is not prime, so not in the sequence;
p = 29: 97 = 29 + 31 + 37.
		

Crossrefs

Cf. A034962.

Programs

  • Mathematica
    Select[Table[p+NextPrime[p]+NextPrime[p+2],{p,Prime[Range[300]]}],PrimeQ] (* Harvey P. Dale, Dec 04 2017 *)
  • PARI
    psumpr3(n) = { c1=0; c2=0; forprime(x=3, n, s = nextprime(x)+nextprime(x+1)+nextprime(x+3); c1++; if(isprime(s), c2++; print1(s" ")); ); print(); print(c2/c1+.0) }

Extensions

Edited by Joshua Zucker, Jan 27 2007
Definition clarified by Harvey P. Dale, Dec 04 2017

A127492 Indices m of primes such that Sum_{k=0..2, k

Original entry on oeis.org

2, 10, 17, 49, 71, 72, 75, 145, 161, 167, 170, 184, 244, 250, 257, 266, 267, 282, 286, 301, 307, 325, 343, 391, 405, 429, 450, 537, 556, 561, 584, 685, 710, 743, 790, 835, 861, 904, 928, 953
Offset: 1

Views

Author

Artur Jasinski, Jan 16 2007

Keywords

Comments

Let p_0 .. p_4 be five consecutive primes, starting with the m-th prime. The index m is in the sequence if the absolute value [x^0] of the polynomial (x-p_0)*[(x-p_1)*(x-p_2) + (x-p_2)*(x-p_3) + (x-p_3)*(x-p_4)] + (x-p_1)*[(x-p_2)*(x-p_3) + (x-p_3)*(x-p_4)] + (x-p_2)*(x-p_3)*(x-p_4) is two times a prime. The correspondence with A127491: the coefficient [x^2] of the polynomial (x-p_0)*(x-p_1)*..*(x-p_4) is the sum of 10 products of a set of 3 out of the 5 primes. Here the sum is restricted to the 6 products where the two largest of the 3 primes are consecutive. - R. J. Mathar, Apr 23 2023

Crossrefs

Programs

  • Maple
    isA127492 := proc(k)
        local x,j ;
        (x-ithprime(k))* mul( x-ithprime(k+j),j=1..2)
        +(x-ithprime(k))* mul( x-ithprime(k+j),j=2..3)
        +(x-ithprime(k))* mul( x-ithprime(k+j),j=3..4)
        +(x-ithprime(k+1))* mul( x-ithprime(k+j),j=2..3)
        +(x-ithprime(k+1))* mul( x-ithprime(k+j),j=3..4)
        +(x-ithprime(k+2))* mul( x-ithprime(k+j),j=3..4) ;
        p := abs(coeff(expand(%/2),x,0)) ;
        if type(p,'integer') then
            isprime(p) ;
        else
            false ;
        end if ;
    end proc:
    for k from 1 to 900 do
        if isA127492(k) then
            printf("%a,",k) ;
        end if ;
    end do: # R. J. Mathar, Apr 23 2023
  • Mathematica
    a = {}; Do[If[PrimeQ[(Prime[x] Prime[x + 1]Prime[x + 2] + Prime[x] Prime[x + 2]Prime[x + 3] + Prime[x] Prime[x + 3] Prime[x + 4] + Prime[x + 1] Prime[x + 2]Prime[x + 3] + Prime[x + 1] Prime[x + 3]Prime[x + 4] + Prime[x + 2] Prime[x + 3] Prime[x + 4])/2], AppendTo[a, x]], {x, 1, 1000}]; a
    prQ[{a_,b_,c_,d_,e_}]:=PrimeQ[(a b c+a c d+a d e+b c d+b d e+c d e)/2]; PrimePi/@Select[ Partition[ Prime[Range[1000]],5,1],prQ][[;;,1]] (* Harvey P. Dale, Apr 21 2023 *)

Extensions

Definition simplified by R. J. Mathar, Apr 23 2023
Edited by Jon E. Schoenfield, Jul 23 2023
Previous Showing 11-20 of 40 results. Next