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.

Showing 1-10 of 13 results. Next

A034707 Numbers that are sums (of a nonempty sequence) of consecutive primes.

Original entry on oeis.org

2, 3, 5, 7, 8, 10, 11, 12, 13, 15, 17, 18, 19, 23, 24, 26, 28, 29, 30, 31, 36, 37, 39, 41, 42, 43, 47, 48, 49, 52, 53, 56, 58, 59, 60, 61, 67, 68, 71, 72, 73, 75, 77, 78, 79, 83, 84, 88, 89, 90, 95, 97, 98, 100, 101, 102, 103, 107, 109, 112, 113, 119, 120, 121, 124, 127
Offset: 1

Views

Author

Keywords

Comments

A050936 is a subsequence (which still includes primes, embodied by A067377). - Enoch Haga, Jun 16 2002, R. J. Mathar, Oct 10 2010

Crossrefs

Complement is A050940.

Programs

  • Mathematica
    f[n_] := Block[{len = PrimePi@ n}, p = Prime@ Range@ len; Count[ Flatten[ Table[ p[[i ;; j]], {i, len}, {j, i, len}],1], q_ /; Total@ q == n]]; Select[ Range@ 1000, f@ # > 0 &] (* Or quicker for a larger range *)
    lmt = 10000; p = Prime@ Range@ PrimePi@ lmt; t = Table[0, {lmt}]; Do[s = 0; j = i; While[s = s + p[[j]]; s <= lmt, t[[s]]++; j++], {i, Length@ p}]; Select[ Range@ lmt, t[[#]] > 0 &]
    upto=200;Select[Union[Flatten[Table[ Total/@Partition[Prime[ Range[ PrimePi[ upto]]],n,1],{n,upto-1}]]],#<=upto&] (* Harvey P. Dale, Jul 15 2011 *)
  • PARI
    is(n)=if(isprime(n), return(1)); my(v,m=1,t); while(1, v=vector(m++); v[m\2]=precprime(n\m); for(i=m\2+1,m,v[i]=nextprime(v[i-1]+1)); forstep(i=m\2-1,1,-1,v[i]=precprime(v[i+1]-1)); if(v[1]==0, return(0)); t=vecsum(v); if (t==n, return(1)); if(t>n, while(t>n, t-=v[m]; v=concat(precprime(v[1]-1), v[1..m-1]); t+=v[1]), while(tCharles R Greathouse IV, May 05 2016

Formula

A054845(a(n)) > 0. - Ray Chandler, Sep 20 2023

Extensions

Updated a misleading comment. - R. J. Mathar, Oct 10 2010

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

A342443 a(n) is the largest prime < 10^n that is the sum of at least two consecutive primes.

Original entry on oeis.org

5, 97, 991, 9949, 99971, 999983, 9999991, 99999989, 999999937, 9999999943, 99999999977, 999999999989, 9999999999763, 99999999999959, 999999999999989
Offset: 1

Views

Author

Bernard Schott, Mar 12 2021

Keywords

Comments

The minimum corresponding number of consecutive primes to get this largest prime a(n) is A342444(n) and the first prime of these A342444(n) consecutive primes is A342454(n).
Differs from A342439 where the corresponding primes result of the longest sum < 10^n of consecutive primes.
a(n) is the largest n-digit prime A003618(n) for n = 2, 6, 7, 8, 9, 11, 12, ...
a(13) >= k = 10^13 - 237. If a(13) > k then it is the sum of at least 30000 primes. k can be written as the sum of 6449 consecutive primes. - David A. Corneth, Mar 13 2021
No sum of 30000 or more consecutive primes is in the interval [10^13 - 237, 10^13 - 1], so a(13) = 10^13 - 237. - Jon E. Schoenfield, Mar 14 2021

Examples

			a(1) = 5 = 2 + 3, since it is not possible to obtain the greatest 1-digit prime 7 when adding consecutive primes.
a(2) = 29 + 31 + 37 = 97, since (29, 31, 37) are consecutive primes and 97 is the largest 2-digit prime.
		

Crossrefs

Formula

A342439(n) <= a(n) <= A003618(n).

Extensions

a(9) from Jinyuan Wang, Mar 13 2021
a(10) from David A. Corneth, Mar 13 2021
a(11)-a(12) from Jinyuan Wang, Mar 13 2021
a(13)-a(14) from Jon E. Schoenfield, Mar 13 2021
a(15) from Max Alekseyev, Dec 11 2024

A342444 a(n) is the smallest number of consecutive primes that are necessary to add to obtain the largest prime = A342443(n) < 10^n.

Original entry on oeis.org

2, 3, 5, 9, 5, 29, 281, 1575, 599, 7, 17, 3, 6449, 2725361, 163315
Offset: 1

Views

Author

Bernard Schott, Mar 12 2021

Keywords

Comments

There are at least two consecutive primes in each sum.
The corresponding largest primes obtained are in A342443, and the first primes of these a(n) consecutive primes are in A342454.

Examples

			A342443(1) = 5 = 2 + 3, hence a(1) = 2.
A342443(2) = 97 = 29 + 31 + 37, hence a(2) = 3.
From _Jon E. Schoenfield_, Mar 14 2021: (Start)
                                                    a(n) =
              sum of consecutive primes           number of
      -----------------------------------------  consecutive
   n   A342454(n)   +   ...    =    A342443(n)      primes
  --  -----------------------------------------  -----------
   1             2  +  3       =              5          2
   2            29  + 31 + 37  =             97          3
   3           191  +   ...    =            991          5
   4          1087  +   ...    =           9949          9
   5         19979  +   ...    =          99971          5
   6         34337  +   ...    =         999983         29
   7         34129  +   ...    =        9999991        281
   8         54829  +   ...    =       99999989       1575
   9       1665437  +   ...    =      999999937        599
  10    1428571363  +   ...    =     9999999943          7
  11    5882352691  +   ...    =    99999999977         17
  12  333333333299  +   ...    =   999999999989          3
  13    1550560001  +   ...    =  9999999999763       6449
  14      13384757  +   ...    = 99999999999959    2725361
(End)
		

Crossrefs

Extensions

a(6)-a(9) from Jinyuan Wang, Mar 13 2021
a(10) from David A. Corneth, Mar 13 2021
a(11)-a(14) from Jon E. Schoenfield, Mar 14 2021
a(15) from Max Alekseyev, Dec 11 2024

A164556 Primes expressible as the sum of (at least two) consecutive primes in at least 5 ways.

Original entry on oeis.org

34421, 229841, 235493, 271919, 345011, 358877, 414221, 442019, 488603, 532823, 621937, 655561, 824099, 888793, 896341, 935791, 954623, 963173, 988321, 1055969, 1083371, 1083941, 1115911, 1170857, 1261763, 1338823, 1352863, 1409299, 1444957, 1598953, 1690597
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A067380.

Examples

			a(1) = 34421 = Sum_{i=57..127} prime(i) = Sum_{i=226..248} prime(i) = Sum_{i=527..535} prime(i) = Sum_{i=654..660} prime(i) = Sum_{i=1382..1384} prime(i) and
a(3) = 235493 = Sum_{i=50..284} prime(i) = Sum_{i=120..300} prime(i) = Sum_{i=123..301} prime(i) = Sum_{i=334..424} prime(i) = Sum_{i=7701..7703} prime(i)
are expressible in 5 ways as the sum of two or more consecutive primes.
		

Crossrefs

Programs

  • Magma
    M:=1695000; P:=PrimesUpTo(M); S:=[0]; for p in P do t:=S[#S]+p; if #S ge 3 then if t-S[#S-2] gt M then break; end if; end if; S[#S+1]:=t;end for; c:=[0:j in [1..M]]; for C in [2..#S-1] do if IsEven(C) then L:=1; else L:=#S-C; end if; for j in [1..L] do s:=S[j+C]-S[j]; if s gt M then break; end if; if IsPrime(s) then c[s]+:=1; end if; end for; end for; [j:j in [1..M]|c[j] ge 5]; // Jon E. Schoenfield, Dec 25 2021
  • Mathematica
    m=3*7!;lst={};Do[p=Prime[a];Do[p+=Prime[b];If[PrimeQ[p]&&p
    				

Formula

A067375 INTERSECT A000040.

Extensions

Examples added by R. J. Mathar, Aug 19 2009
a(10)-a(28) from Donovan Johnson, Sep 16 2009
a(29)-a(31) from Jon E. Schoenfield, Dec 25 2021

A194939 Table T read by rows, where T(n, k) is the sum of the largest k primes up to and including prime(n), for 1 <= k <= n.

Original entry on oeis.org

2, 3, 5, 5, 8, 10, 7, 12, 15, 17, 11, 18, 23, 26, 28, 13, 24, 31, 36, 39, 41, 17, 30, 41, 48, 53, 56, 58, 19, 36, 49, 60, 67, 72, 75, 77, 23, 42, 59, 72, 83, 90, 95, 98, 100, 29, 52, 71, 88, 101, 112, 119, 124, 127, 129, 31, 60, 83, 102, 119, 132, 143, 150, 155, 158, 160
Offset: 1

Views

Author

Alonso del Arte, Sep 07 2011

Keywords

Comments

From the left, the second column gives the sums of two consecutive primes, the third column gives the sums of three consecutive primes, etc. Thus, from the right, the rightmost column gives the running sum of all prime numbers up to that row.
This triangle is the mirror image of A143121: left border are the primes (right border in the other one) while the right border is the sum of the first n primes (A007504, left border in the other one). Row sums are given by A014285, just like the other triangle.
On odd numbered rows, the central entry is exactly the same as the corresponding position in A143121: T(n, (n + 1)/2) = A143121(n, (n + 1)/2). The rest of the row is of course the reverse.

Examples

			First few rows of triangle are:
2
3,   5
5,   8, 10
7,  12, 15, 17
11, 18, 23, 26, 28
...
T(5, 2) = 18 because the sum of the fourth and fifth primes (two consecutive primes) is 7 + 11 = 18.
T(5, 3) = 23 because the sum of the third, fourth and fifth primes (three consecutive primes) is 5 + 7 + 11 = 23.
		

Crossrefs

Cf. A143121 (rows reversed), A014285 (row sums).
Cf. A000040 (column k=1), A007504 (main diagonal).
Cf. A067377.

Programs

  • Mathematica
    a[n_, k_] := a[n, k] = Plus@@Prime[Range[n - k + 1, n]]; Column[Table[a[n, k], {n, 15}, {k, n}], Center]

Formula

T(n, k) = Sum_{i = n-k+1..n} prime(i), where prime(i) is the i-th prime number.

Extensions

More terms from Michel Marcus, Aug 31 2020
New name from David A. Corneth, Aug 31 2020

A197227 Primes that are not the sum of at least two consecutive primes.

Original entry on oeis.org

2, 3, 7, 11, 13, 19, 29, 37, 43, 47, 61, 73, 79, 89, 103, 107, 113, 137, 149, 151, 157, 163, 167, 179, 191, 193, 227, 229, 239, 241, 257, 277, 283, 293, 307, 313, 317, 337, 347, 359, 367, 383, 389, 397, 409, 419, 433, 461, 467, 509, 521, 541, 547, 557, 569
Offset: 1

Views

Author

T. D. Noe, Nov 03 2011

Keywords

Comments

Complement of A067377 in the primes. For the primes less than 10^6, these primes make up about 56%.

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..10^3)]:
    S:= ListTools:-PartialSums([0,op(P)]):
    sort(convert(convert(P,set) minus {seq(seq(S[i]-S[j],j=1..i-2),i=1..10^3+1)},list)); # Robert Israel, May 09 2021
  • Mathematica
    lim = 1000; pFound = {}; ps = Prime[Range[PrimePi[lim]]]; sm = ps; i = 0; While[i++; j = 1; While[sm[[j]] = sm[[j]] + ps[[i + j]]; sm[[j]] <= lim, If[PrimeQ[sm[[j]]], AppendTo[pFound, sm[[j]]]]; j++]; j > 1]; Complement[ps, pFound]

Formula

Prime(n) such that A307610(n) = 1. - Ray Chandler, Sep 21 2023

Extensions

Definition clarified by Jonathan Sondow, May 18 2013

A272713 Prime powers (p^k, k>=2) that are the sum of consecutive prime numbers.

Original entry on oeis.org

8, 49, 121, 128, 169, 243, 625, 841, 961, 1331, 1369, 1681, 1849, 2209, 3125, 5329, 6241, 6859, 6889, 8192, 10201, 11449, 11881, 12167, 12769, 16384, 18769, 22801, 24649, 26569, 32768, 36481, 39601, 44521
Offset: 1

Views

Author

Altug Alkan, May 05 2016

Keywords

Comments

In other words, prime powers (p^k, k>=2) that are the sum of two or more consecutive prime numbers.
Intersection of A025475 and A034707.
Terms of this sequence are 2^3, 7^2, 11^2, 2^7, 13^2, 3^5, 5^4, 29^2, ...

Examples

			8 is a term because 8 = 2^3 = 3 + 5.
49 is a term because 49 = 7^2 = 13 + 17 + 19.
121 is a term because 121 = 11^2 = 37 + 41 + 43.
		

Crossrefs

Programs

  • PARI
    list(lim)=my(v=List(),n=1,p,q,t,s); while(1, t=primes(n++); p=2; q=t[n]; s=vecsum(t); if(s>lim, return(Set(v))); while(s<=lim, if(isprimepower(s)>1, listput(v,s)); q=nextprime(q+1); s+=q-p; p=nextprime(p+1))) \\ Charles R Greathouse IV, May 05 2016

Extensions

a(9)-a(34) from Charles R Greathouse IV, May 05 2016

A309770 Numbers that are sums of one or more consecutive primes in more than one way.

Original entry on oeis.org

5, 17, 23, 31, 36, 41, 53, 59, 60, 67, 71, 72, 83, 90, 97, 100, 101, 109, 112, 119, 120, 127, 131, 138, 139, 143, 152, 173, 180, 181, 187, 197, 199, 204, 210, 211, 221, 223, 228, 233, 240, 251, 258, 263, 269, 271, 276, 281, 287, 300, 304, 311, 323, 330, 331, 340, 349
Offset: 1

Views

Author

Ilya Gutkovskiy, Aug 16 2019

Keywords

Comments

Contains A067372 as a subsequence.

Examples

			5 is in the sequence because it can be written as either 5 or 2 + 3.
36 is the sequence because it can be written as either 5 + 7 + 11 + 13 or 17 + 19.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms <= N
    P:= select(isprime, [2, seq(i,i=3..N,2)]):
    S:= [0,op(ListTools:-PartialSums(P))]:
    V:= Vector(N):
    for i from 1 to nops(S) do
      for j from i-1 to 1 by -1 do
        v:= S[i]-S[j];
        if v > N then break fi;
        V[v]:= V[v]+1;
    od od:
    select(t -> V[t]>1, [$1..N]); # Robert Israel, Aug 22 2019

Formula

A054845(a(n)) > 1.

A350334 Primes expressible as the sum of (at least two) consecutive primes in at least 6 ways.

Original entry on oeis.org

442019, 1866373, 3051161, 3634531, 3704819, 3839677, 3890609, 4539331, 4711937, 5011213, 5069023, 5369743, 5384221, 6137587, 6783263, 6893273, 9213073, 10354177, 10602763, 11394193, 11849339, 12012257, 13126801, 13322887, 14385781, 15077143, 17225003, 19301221
Offset: 1

Views

Author

Jon E. Schoenfield, Dec 25 2021

Keywords

Comments

Subsequence of A164556.

Examples

			442019 is a term because it is a prime and
   442019 = Sum_{j=13620..13622} prime(j)
          = Sum_{j=5044..5052} prime(j)
          = Sum_{j=2019..2043} prime(j)
          = Sum_{j=1573..1605} prime(j)
          = Sum_{j=954..1010} prime(j)
          = Sum_{j=81..381} prime(j).
		

Crossrefs

Showing 1-10 of 13 results. Next