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 27 results. Next

A001043 Numbers that are the sum of 2 successive primes.

Original entry on oeis.org

5, 8, 12, 18, 24, 30, 36, 42, 52, 60, 68, 78, 84, 90, 100, 112, 120, 128, 138, 144, 152, 162, 172, 186, 198, 204, 210, 216, 222, 240, 258, 268, 276, 288, 300, 308, 320, 330, 340, 352, 360, 372, 384, 390, 396, 410, 434, 450, 456, 462, 472, 480, 492, 508, 520
Offset: 1

Views

Author

Keywords

Comments

Arithmetic derivative (see A003415) of prime(n)*prime(n+1). - Giorgio Balzarotti, May 26 2011
A008472(a(n)) = A191583(n). - Reinhard Zumkeller, Jun 28 2011
With the exception of the first term, all terms are even. a(n) is divisible by 4 if the difference between prime(n) and prime(n + 1) is not divisible by 4; e.g., prime(n) = 1 mod 4 and prime(n + 1) = 3 mod 4. In general, for a(n) to be divisible by some even number m > 2 requires that prime(n + 1) - prime(n) not be a multiple of m. - Alonso del Arte, Jan 30 2012

Examples

			2 + 3 = 5.
3 + 5 = 8.
5 + 7 = 12.
7 + 11 = 18.
		

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A050936.
Cf. A000040 (primes), A031131 (first differences), A092163 (bisection), A100479 (bisection).

Programs

  • Haskell
    a001043 n = a001043_list !! (n-1)
    a001043_list = zipWith (+) a000040_list $ tail a000040_list
    -- Reinhard Zumkeller, Oct 19 2011
  • Magma
    [(NthPrime(n+1) + NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..1000)]):
    n:= nops(Primes):
    Primes[1..n-1] + Primes[2..n]; # Robert Israel, Aug 29 2014
  • Mathematica
    Table[Prime[n] + Prime[n + 1], {n, 55}] (* Ray Chandler, Feb 12 2005 *)
    Total/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Aug 23 2011 *)
    Abs[Differences[Table[(-1)^n Prime[n], {n, 60}]]] (* Alonso del Arte, Feb 03 2016 *)
  • PARI
    p=2;forprime(q=3,1e3,print1(p+q", ");p=q) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2 \\ Charles R Greathouse IV, Jun 21 2012
    
  • Sage
    BB = primes_first_n(56)
    L = []
    for i in range(55): L.append(BB[1 + i] + BB[i])
    L # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = prime(n) + prime(n + 1) = A000040(n) + A000040(n+1).
a(n) = A116366(n, n - 1) for n > 1. - Reinhard Zumkeller, Feb 06 2006
a(n) = 2*A024675(n-1), n>1. - R. J. Mathar, Jan 12 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 17 2000

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

A067381 Smallest prime expressible as the sum of (at least two) consecutive primes in n ways.

Original entry on oeis.org

5, 41, 311, 311, 34421, 442019, 3634531, 48205429, 1798467197, 36154343837, 166400805323, 6123584726269
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Comments

a(9)-a(11) found by Wilfred Whiteside in 2007.

Examples

			5 can be represented (in just one way) as 2+3.
		

Crossrefs

Extensions

a(12) from Giovanni Resta, May 07 2020

A067372 Integers expressible as the sum of (at least two) consecutive primes in at least 2 ways.

Original entry on oeis.org

36, 41, 60, 72, 83, 90, 100, 112, 119, 120, 138, 143, 152, 180, 187, 197, 199, 204, 210, 221, 223, 228, 240, 251, 258, 276, 281, 287, 300, 304, 311, 323, 330, 340, 371, 372, 384, 390, 395, 401, 408, 410, 434, 439, 456, 462, 473, 480, 491, 492, 508, 510, 533
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			36 = (17 + 19) = (5 + 7 + 11 + 13) or (#2,17) (#4,5).
		

Crossrefs

Programs

  • Mathematica
    m=5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)
  • PARI
    upto(n) = {my(s = 0, pr = List([0]), l = List(), res = List()); forprime(p = 2, n + 100, s+=p; listput(pr, s) ); for(i = 3, #pr, for(j = 2, i-1, if(pr[i] - pr[i-j] <= n, listput(l, pr[i] - pr[i-j]) , next(2) ) ) ); listsort(l); for(i = 2, #l, if(l[i-1] == l[i], listput(res, l[i]) ) ); Set(res); } \\ David A. Corneth, Aug 22 2019

Formula

A084143(a(n)) > 1. - Ray Chandler, Sep 20 2023

Extensions

Offset corrected by Donovan Johnson, Nov 14 2013

A067377 Primes expressible as the sum of (at least two) consecutive primes in at least 1 way.

Original entry on oeis.org

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

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Examples

			The prime 83, for example, is the sum of the five consecutive primes 11 + 13 + 17 + 19 + 23.
The prime 2011, for example, is the sum of the eleven consecutive primes 157 + 163 + 167 + 173 + 179 + 181 + 191 + 193 + 197 + 199 + 211. - _Daniel Forgues_, Nov 03 2011
		

Crossrefs

Cf. A197227 (primes that are not the sum of consecutive primes).

Programs

  • Mathematica
    p = {}; Do[a = Table[ Prime[i], {i, n, 150}]; l = Length[a]; k = 2; While[k < l + 1, b = Plus @@@ Partition[a, k]; k++; p = Append[ p, Select[ b, PrimeQ[ # ] &]]], {n, 1, 149}]; Take[ Union[ Flatten[p]], 70]
    m=5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&p<=Prime[m]*3+8,AppendTo[lst,p]],{b,a+1,m+2,1}],{a,m}]; Union[lst] (* Vladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

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

Extensions

Offset changed to 1 by Hans Havermann, Oct 07 2018

A097889 Numbers that are products of (at least two) consecutive primes.

Original entry on oeis.org

6, 15, 30, 35, 77, 105, 143, 210, 221, 323, 385, 437, 667, 899, 1001, 1147, 1155, 1517, 1763, 2021, 2310, 2431, 2491, 3127, 3599, 4087, 4199, 4757, 5005, 5183, 5767, 6557, 7387, 7429, 8633, 9797, 10403, 11021, 11663, 12317, 12673, 14351, 15015, 16637, 17017
Offset: 1

Views

Author

Bart la Bastide (bart(AT)xs4all.nl), Sep 21 2004

Keywords

Comments

Subsequence of A073485; A073490(a(n)) = 0. - Reinhard Zumkeller, Nov 20 2004
A proper subset of A073485. - Robert G. Wilson v, Jun 11 2010
A192280(a(n)) * (1 - A010051(a(n))) = 1. - Reinhard Zumkeller, Aug 26 2011 [corrected by Jason Yuen, Aug 29 2024]
The Heinz numbers of the partitions into at least 2 consecutive parts. The Heinz number of an integer partition p = [p_1, p_2, ..., p_r] is defined as Product(p_j-th prime, j=1...r) (concept used by Alois P. Heinz in A215366 as an "encoding" of a partition). Examples: (i) 105 (=3*5*7) is in the sequence because it is the Heinz number of the partition [2,3,4]; (ii) 108 (= 2*2*3*3*3) is not in the sequence because it is the Heinz number of the partition [1,1,2,2,2]. - Emeric Deutsch, Oct 02 2015

Examples

			1001 = 7 * 11 * 13.
		

Crossrefs

Cf. A050936.
Intersection of A073485 and A002808.

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a097889 n = a097889_list !! (n-1)
    a097889_list = f $ singleton (6, 2, 3) where
       f s = y : f (insert (w, p, q') $ insert (w `div` p, a151800 p, q') s')
             where w = y * q'; q' = a151800 q
                   ((y, p, q), s') = deleteFindMin s
    -- Reinhard Zumkeller, May 12 2015, Aug 26 2011
    
  • Maple
    isA097889 := proc(n)
        local plist,p,i ;
        plist := sort(convert(numtheory[factorset](n),list)) ;
        if nops(plist) < 2 then
            return false;
        end if;
        for i from 1 to nops(plist) do
            p := op(i,plist) ;
            if modp(n,p^2) = 0 then
                return false;
            end if;
            if i > 1 then
                if nextprime(op(i-1,plist)) <> p then
                    return false;
                end if;
            end if;
        end do:
        true;
    end proc:
    for n from 1 to 1000 do
        if isA097889(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Jan 12 2016
  • Mathematica
    a = {}; Do[ AppendTo[a, Apply[ Times, (Prime /@ Partition[ Range[30], n, i]), 1]], {n, 2, 6}, {i, n - 1}]; Take[ Union[ Flatten[ a]], 45] (* Robert G. Wilson v, Sep 24 2004 *)
  • PARI
    list(lim)=my(v=List(), p, t); for(e=2, log(lim+.5)\log(2), p=1; t=prod(i=1, e-1, prime(i)); forprime(q=prime(e), lim, t*=q/p; if(t>lim, next(2)); listput(v, t); p=nextprime(p+1))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Oct 24 2012
    
  • Python
    import heapq
    from sympy import sieve
    sieve.extend(10**6)
    primes = list(sieve._list)
    def prime(n): return primes[n-1]
    def aupton(terms, verbose=False):
        p = prime(1)*prime(2); h = [(p, 1, 2)]; nextcount = 3; alst = []
        while len(alst) < terms:
            (v, s, l) = heapq.heappop(h)
            alst.append(v)
            if verbose: print(f"{v}, [= Prod_{{i = {s}..{l}}} prime(i)]")
            if v >= p:
                p *= prime(nextcount)
                heapq.heappush(h, (p, 1, nextcount))
                nextcount += 1
            v //= prime(s); s += 1; l += 1; v *= prime(l)
            heapq.heappush(h, (v, s, l))
        return alst
    print(aupton(45)) # Michael S. Branicky, Jun 15 2021

Formula

a(n) ~ n^2 log^2 n. - Charles R Greathouse IV, Oct 24 2012

Extensions

More terms from Robert G. Wilson v, Sep 24 2004
Data corrected for n > 41 by Reinhard Zumkeller, Aug 26 2011

A055514 Composite numbers that are the sum of consecutive prime numbers and are divisible by the first and last of these primes.

Original entry on oeis.org

10, 39, 155, 371, 10225245560, 2935561623745, 454539357304421, 7228559051256366318, 1390718713078158117206
Offset: 1

Views

Author

Jud McCranie, Jul 03 2000

Keywords

Comments

Composite n such that n = p_1 + p_2 + ... + p_k where the p_i are consecutive primes and n is divisible by p_1 and p_k.
Problem proposed by Carlos Rivera, who found the first 4 terms.
No more terms below 10^22. - Michael Beight, Jul 22 2012
In subsequence A055233 the first and last term of the sum must also be its smallest and largest prime factor. Therefore a(5) (cf. first EXAMPLE) is not in that sequence, since it has smaller factors 2^3*5. - M. F. Hasler, Nov 21 2021

Examples

			503 + 509 + 521 + ... + 508213 = 10225245560, which is divisible by 503 and 508213. - _Manuel Valdivia_, Nov 17 2011
From _Michael Beight_, Jul 22 2012: (Start)
a(8) = 7228559051256366318 = 73 + ... + 18281691653;
a(9) = 1390718713078158117206 = 370794889 + ... + 267902967061. (End)
		

Crossrefs

Subsequence of A050936.
Cf. A055233.

Programs

  • Mathematica
    Module[{nn=200},Table[Total/@Select[Partition[Prime[Range[10000]],n,1],scpQ],{n,2,nn}]]//Flatten (* The program generates the first four terms of the sequence. *)
    (* Harvey P. Dale, Oct 22 2022 *)
  • PARI
    S=vector(N=50000); s=0; i=1; forprime(p=2,oo, S[i++]=s+=p; for(j=1,i-2, (s-S[j])%p || (s-S[j])%prime(j)|| print1(s-S[j]",")|| break)) \\ gives a(1..5), but too slow to go beyond. - M. F. Hasler, Nov 21 2021

Extensions

a(7) from Donovan Johnson, Jun 19 2008
a(8) and a(9) from Michael Beight, Jul 22 2012

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

Original entry on oeis.org

311, 863, 14369, 14699, 15329, 19717, 29033, 34421, 36467, 37607, 40433, 42463, 48731, 49253, 49499, 55813, 67141, 70429, 76423, 78791, 85703, 90011, 94559, 97159, 98411, 109159, 110359, 110527, 125821, 130513, 134921, 141587, 147031, 147347, 155087, 155387
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Comments

Note that the definition says "at least two", so a(n) = a(n) itself is not allowed as a possible sum (see Examples).

Examples

			311 is a term because 311 is prime and
  11+13+17+19+23+29+31+37+41+43+47 = 311,
  31+37+41+43+47+53+59 = 311,
  53+59+61+67+71 = 311,
  101+103+107 = 311.
1151 is not a term, since although 1151 is prime it only has three representations of the required form:
  101+97+89+83+79+73+71+67+61+59+53+47+43+41+37+31+29+23+19+17+13+11+7 = 1151,
  239+233+229+227+223 = 1151,
  389+383+379 = 1151.
Also, 16277 is not a term because although it has five representations as a sum of consecutive primes, it is not itself a prime. - _Sean A. Irvine_, Dec 25 2021
		

Crossrefs

Programs

  • Magma
    M:=160000; 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 4]; // Jon E. Schoenfield, Dec 25 2021
  • Mathematica
    m=7!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)

Formula

Prime(n) such that A307610(n) > 4. - Ray Chandler, Sep 21 2023

Extensions

The terms have been confirmed by Sean A. Irvine, Dec 24 2021. - N. J. A. Sloane, Dec 25 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

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

Original entry on oeis.org

41, 83, 197, 199, 223, 251, 281, 311, 401, 439, 491, 593, 733, 857, 863, 883, 941, 983, 991, 1061, 1151, 1187, 1283, 1361, 1367, 1381, 1433, 1439, 1493, 1511, 1523, 1553, 1607, 1753, 1801, 1823, 1901, 1951, 2011, 2027, 2099, 2111, 2179, 2203, 2267, 2357, 2393, 2417, 2579, 2647, 2689, 2731
Offset: 1

Views

Author

Patrick De Geest, Feb 04 2002

Keywords

Crossrefs

Programs

  • Mathematica
    m=3*5!; lst={}; Do[p=Prime[a]; Do[p+=Prime[b]; If[PrimeQ[p]&&pVladimir Joseph Stephan Orlovsky, Aug 15 2009 *)
  • PARI
    e=2500; for(d=2,e, if(d%2==1,h=d/3,h=d/2); f=floor(2*d/(log(d)*3)); g=0; for(c=1,f,a=0; b=0; forprime(n=prime(c),h+50,a=a+n; b=b+1;if (a==d,g=g+1; if(g>=2&isprime(a),print1(a, ", ")),if(a>d,next(2)))))) /* The parameter g selects the number of ways wanted. - Robin Garcia, Jan 11 2011 */

Formula

Prime(n) such that A307610(n) > 2. - Ray Chandler, Sep 21 2023
Showing 1-10 of 27 results. Next