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

A127338 Numbers that are the sum of 11 consecutive primes.

Original entry on oeis.org

160, 195, 233, 271, 311, 353, 399, 443, 491, 539, 583, 631, 677, 725, 779, 833, 883, 931, 979, 1025, 1081, 1139, 1197, 1253, 1313, 1367, 1423, 1483, 1543, 1607, 1673, 1727, 1787, 1843, 1901, 1951, 2011, 2077, 2141, 2203, 2263, 2323, 2383, 2443, 2507
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of coefficient of x^10 of the polynomial Product_{j=0..10} (x - prime(n+j)) of degree 11; the roots of this polynomial are prime(n), ..., prime(n+10).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..10] ]: n in [1..70] ]; // Vincenzo Librandi, Apr 03 2011
  • Mathematica
    f[n_] := Sum[Prime[n + i], {i, 0, 10}]; Array[f, 45]
    Plus @@@ Partition[ Prime@ Range@ 55, 11, 1] (* Robert G. Wilson v, Jan 13 2011 *)
  • PARI
    {m=45;k=11;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=45;k=11;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A127334 Numbers that are the sum of 7 consecutive primes.

Original entry on oeis.org

58, 75, 95, 119, 143, 169, 197, 223, 251, 281, 311, 341, 371, 401, 431, 463, 493, 523, 559, 593, 625, 659, 689, 719, 757, 791, 827, 863, 905, 947, 991, 1027, 1063, 1099, 1139, 1171, 1211, 1247, 1281, 1313, 1351, 1395, 1441, 1479, 1519, 1561, 1603, 1643
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of coefficient of x^6 of the polynomial Product_{j=0..6} (x - prime(n+j)) of degree 7; the roots of this polynomial are prime(n), ..., prime(n+6).

Crossrefs

Programs

  • GAP
    P:=Filtered([1..1000],IsPrime);; List([0..50],n->Sum([1+n..7+n],i->P[i])); # Muniru A Asiru, Apr 16 2018
  • Magma
    [&+[ NthPrime(n+k): k in [0..6] ]: n in [1..70] ]; // Vincenzo Librandi, Apr 03 2011
    
  • Maple
    seq(add(ithprime(i),i=n..6+n),n=1..50); # Muniru A Asiru, Apr 16 2018
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 6}]], {x, 1, 50}]; a
    Total/@Partition[Prime[Range[60]],7,1] (* Harvey P. Dale, May 14 2023 *)
  • PARI
    {m=48;k=7;for(n=0,m-1,print1(a=sum(j=1,k,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=48;k=7;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • Python
    from sympy import prime
    def a(x): return sum(prime(x + n) for n in range(7))
    print([a(i) for i in range(1, 50)]) # Indranil Ghosh, Mar 18 2017
    
  • Sage
    BB = primes_first_n(62)
    L = []
    for i in range(55):
        L.append(sum(BB[i+j] for j in range(7)))
    L
    # Zerinvary Lajos, May 14 2007
    

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A127339 Numbers that are the sum of 12 consecutive primes.

Original entry on oeis.org

197, 236, 276, 318, 364, 412, 460, 510, 562, 612, 662, 714, 766, 822, 880, 936, 990, 1040, 1092, 1152, 1212, 1276, 1336, 1402, 1464, 1524, 1586, 1650, 1716, 1786, 1854, 1918, 1980, 2040, 2100, 2162, 2234, 2304, 2370, 2436, 2502, 2564, 2634, 2700, 2770
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) = absolute value of coefficient of x^11 of the polynomial Product_{j=0..11} (x - prime(n+j)) of degree 12; the roots of this polynomial are prime(n), ..., prime(n+11).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..11] ]: n in [1..100] ]; // Vincenzo Librandi, Apr 03 2011
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 11}]], {x, 1, 50}]; a
    Total/@Partition[Prime[Range[60]],12,1] (* Harvey P. Dale, May 05 2018 *)
  • PARI
    {m=45;k=12;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=45;k=12;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A203619 Numbers that are a sum of m=3 successive primes and also a product of m=3 (other) successive primes.

Original entry on oeis.org

33263, 7566179, 10681031, 29884301, 51881689, 94593973, 182918137, 187466723, 319512181, 682238471, 799964687, 3926804047, 4047409651, 4881262679, 11857438631, 13418999327, 19184166361, 20428396159, 20743879777, 32573603551, 34148299187, 56372241473, 72215998451
Offset: 1

Views

Author

Zak Seidov, Feb 09 2012

Keywords

Comments

Indices of initial addends (summands) are 1343, 184557, 254101, 662222, 1108908, 1946623, 3616497, 3700883, 6114024, 12508273, 14539139, 65654476, 67568267, 80729196.
Initial addends (summands) are 11083, 2522057, 3560329, 9961421, 17293891, 31531301, 60972697, 62488883, 106504039, 227412803, 266654879, 1308934661, 1349136511, 1627087549.
Indices of initial factors are 10, 44, 47, 63, 73, 87, 103, 104, 123, 151, 157, 248, 250, 264.
Initial factors are 29, 193, 211, 307, 367, 449, 563, 569, 677, 877, 919, 1571, 1583, 1693.

Examples

			33263 = 11083+11087+11093 = 29*31*37,
7566179 = 2522057+2522059+2522063 = 193*197*199,
10681031 = 3560329+3560339+3560363 = 211*223*227,
4881262679 = 1627087549+1627087559+1627087571 = 1693*1697*1699.
		

Crossrefs

Intersection of A034961 and A046301.
Cf. A034961 (sums of three consecutive primes), A046301 (product of 3 successive primes).

Programs

  • PARI
    list(lim)={
        my(v=List(),p,q,p1,q1,r1,t);
        t=nextprime(lim^(1/3));
        while(t*precprime(t-1)*precprime(precprime(t-1)-1)t,r1=q1;q1=p1;p1=precprime(p1-1));
            if(p1+q1+r1==t,listput(v,t));
            p=q;q=r
        );
        Vec(v)
    }; \\ Charles R Greathouse IV, Feb 13 2012

A167788 Triangular numbers which are sums of three consecutive primes.

Original entry on oeis.org

10, 15, 1891, 3403, 10153, 13861, 20503, 27261, 56953, 77815, 87571, 89253, 99681, 121771, 144991, 218791, 224785, 354061, 392941, 606651, 693253, 761995, 765703, 802011, 874503, 1017451, 1038961, 1091503, 1269621, 1348903, 1428895, 1468041
Offset: 1

Views

Author

Zak Seidov, Nov 12 2009

Keywords

Comments

Intersection of A000217 (Triangular numbers) and A034961 (Sums of three consecutive primes).

Crossrefs

Cf. A226145 (corresponding indices), A226148 (the smallest of the 3 consecutive primes).

Programs

  • Magma
    [ t: n in [1..40000] | IsSquare(8*t+1) where t is &+[NthPrime(n+s): s in [0,1,2]] ]; // Bruno Berselli, Apr 28 2011
  • Mathematica
    Select[Table[Prime[n]+Prime[n+1]+Prime[n+2],{n,8!}],IntegerQ[Sqrt[1+8# ]]&] (* Vladimir Joseph Stephan Orlovsky, Feb 18 2010 *)

Formula

a(n) = A000217(A226145(n)). - Michel Marcus, Feb 12 2018

A337489 a(n) is the k-th prime, such that abs(prime(k) - Sum_{j=k-1..k+1} prime(j)/3) sets a new record.

Original entry on oeis.org

3, 7, 29, 113, 523, 1151, 1327, 9551, 15683, 19609, 25471, 31397, 156007, 360653, 370261, 492113, 1349533, 1357201, 1357333, 1562051, 2010733, 4652507, 17051707, 17051887, 20831323, 47326693, 47326913, 122164747, 189695893, 191912783, 387096133, 428045741, 436273291
Offset: 1

Views

Author

Hugo Pfoertner, Aug 29 2020

Keywords

Comments

A337488 are the corresponding values of k.

Examples

			List of first terms:
   a(n) pi(a(n))  average-median
     3,      2,   1/3  = (2 + 3 + 5)/3 - 3
     7,      4,   2/3  = (5 + 7 + 11)/3 - 7
    29,     10,  -4/3  = (23 + 29 + 31)/3 - 29
   113,     30,  10/3
   523,     99,  16/3
  1151,    190, -20/3
  1327,    217,  28/3
  9551,   1183,  32/3
		

Crossrefs

Programs

  • PARI
    a337489(limp) = {my(p1=0, p2=2, p3=3, s=p1+p2+p3, d=0); forprime(p=5, limp, s=s-p1+p; my(dd=abs(s/3-p3)); if(dd>d, print1(p3, ", "); d=dd); p1=p2; p2=p3; p3=p)};
    a337489(500000000)

Extensions

Name edited by Peter Munn, Aug 01 2025

A054892 Smallest prime a(n) such that the sum of n consecutive primes starting with a(n) is divisible by n.

Original entry on oeis.org

2, 3, 3, 5, 71, 5, 7, 17, 239, 13, 29, 5, 43, 23, 5, 5, 7, 7, 79, 17, 47, 11, 2, 73, 97, 53, 271, 13, 263, 23, 41, 61, 97, 101, 181, 41, 47, 13, 233, 13, 53, 13, 359, 151, 71, 61, 239, 73, 443, 859, 29, 131, 2, 61, 313, 101, 19, 151, 521, 3, 571, 31, 7, 79, 109, 97, 53
Offset: 1

Views

Author

Labos Elemer, May 23 2000

Keywords

Comments

See A132809 for another version.
In some cases (n=1,2,25,..), like a(25)=97, the sum of 25 consecutive primes starts with the 25th prime and is divided by 25: Sum=97+...+227=3925=25*157

Examples

			a(8) = 17 since the sum of the 8 consecutive primes starting with 17 is 17 + 19 + 23 + 29 + 31 + 37 + 41 + 43 = 240, which is divisible by 8.  No prime less than 17 has this property: for example, 7 + 11 + ... + 31 = 150 which is not divisible by 8.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, t}, While[t = Table[Prime[i], {i, k, k + n - 1}]; Mod[Plus @@ t, n] > 0, k++ ]; t]; First /@ Table[f[n], {n, 67}] (* Ray Chandler, Oct 09 2006 *)
    Module[{prs=Prime[Range[250]]},Table[SelectFirst[Partition[prs,n,1],Mod[Total[#],n]==0&],{n,70}]][[;;,1]] (* Harvey P. Dale, Jul 11 2023 *)

Formula

a(n) = min{q_1 | Sum_{i=1..n} q_i = n*X}, q_i is a prime (rarely only a(n) = prime(n)).

A129863 Sums of three consecutive pentagonal numbers.

Original entry on oeis.org

6, 18, 39, 69, 108, 156, 213, 279, 354, 438, 531, 633, 744, 864, 993, 1131, 1278, 1434, 1599, 1773, 1956, 2148, 2349, 2559, 2778, 3006, 3243, 3489, 3744, 4008, 4281, 4563, 4854, 5154, 5463, 5781, 6108, 6444, 6789, 7143, 7506, 7878, 8259, 8649, 9048, 9456, 9873
Offset: 0

Views

Author

Jonathan Vos Post, May 23 2007, May 24 2007

Keywords

Comments

Arises in pentagonal number analog to A129803, Triangular numbers that are the sum of three consecutive triangular numbers. What are the pentagonal numbers which are the sum of three consecutive pentagonal numbers?

Examples

			a(0) = 6 = A000326(0) + A000326(1) + A000326(2) = 0 + 1 + 5.
a(1) = 18 = A000326(1) + A000326(2) + A000326(3) = 1 + 5 + 12.
		

Crossrefs

Programs

  • Magma
    [(9/2)*(n^2)+(15/2)*n+6: n in [0..50]]; // Vincenzo Librandi, Aug 16 2017
  • Mathematica
    Table[(3/2)*(4 + 5*n + 3*n^2), {n, 0, 100}] (* Stefan Steinerberger, May 27 2007 *)
    CoefficientList[Series[3 (2 + x^2) / (1 - x)^3, {x, 0, 50}], x] (* Vincenzo Librandi, Aug 16 2017 *)
    Total/@Partition[PolygonalNumber[5,Range[0,50]],3,1] (* Requires Mathematica version 10 or later *) (* or *) LinearRecurrence[{3,-3,1},{6,18,39},50] (* Harvey P. Dale, Nov 22 2018 *)
  • PARI
    a(n)=n*(9*n+15)/2+6 \\ Charles R Greathouse IV, Jun 17 2017
    

Formula

a(n) = P(n) + P(n+1) + P(n+2) where P(n) = A000326(n) = n*(3*n-1)/2.
a(n) = (9/2)*(n^2) + (15/2)*n + 6.
a(n) = (3*n^2 + 5*n + 4)*(3/2). - Stefan Steinerberger, May 27 2007
G.f.: 3*(2+x^2)/(1-x)^3. - Colin Barker, Feb 13 2012
From Elmo R. Oliveira, Nov 16 2024: (Start)
E.g.f.: 3*exp(x)*(3*x^2 + 8*x + 4)/2.
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n > 2. (End)

Extensions

Offset corrected by Eric Rowland, Aug 15 2017

A076306 Numbers k such that k^3 is a sum of three successive primes.

Original entry on oeis.org

11, 47, 145, 223, 229, 267, 313, 353, 365, 391, 397, 409, 507, 565, 567, 571, 573, 641, 661, 723, 793, 799, 841, 887, 895, 1015, 1051, 1089, 1293, 1297, 1411, 1451, 1469, 1789, 1909, 1943, 2043, 2077, 2171, 2401, 2459, 2497, 2671, 2801, 2851, 2871, 2921, 3211
Offset: 1

Views

Author

Zak Seidov, Oct 05 2002, Nov 12 2009

Keywords

Comments

prime(k) + prime(k+1) + prime(k+2) is a cube in A034961, k=A158796(n).

Examples

			11 is a term because 11^3 = 1331 = prime(85) + prime(86) + prime(87) = 439 + 443 + 449.
47 is a term because 47^3 = 103823 = prime(3696) + prime(3697) + prime(3698) = 34603 + 34607 + 34613.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Module[{x=n^3,low,hi}, low=PrimePi[Round[x/3]]-4; hi=low+8; MemberQ[Total/@Partition[Prime[Range[low,hi]],3,1],x]]; Select[Range[5,3300],okQ]  (* Harvey P. Dale, Jan 27 2011 *)
  • PARI
    { p1=prime(1) ; p2=prime(2) ; p3=prime(3) ; n3=p1+p2+p3 ; for(i=1,100000000, if( ispower(n3,3,&n), print(n) ; ) ; n3 -= p1 ; p1=p2 ; p2=p3 ; p3=nextprime(p3+1) ; n3 += p3 ; ) ; } \\ R. J. Mathar, Jan 13 2007
    
  • PARI
    n=0; forstep(j=3, 86231, 2, c=j^3; c3=c/3; f=0; if(denominator(c3)==1, if(isprime(c3), if(precprime(c3-1)+c3+nextprime(c3+1)==c, f=1))); p2=precprime(c3); p1=precprime(p2-1); p3=nextprime(c3); p4=nextprime(p3+1); if(p1+p2+p3==c, f=1); if(p2+p3+p4==c, f=1); if(f==1, n++; write("b076306.txt", n " " j))) /* Donovan Johnson, Sep 02 2013 */
    
  • Python
    from _future_ import division
    from sympy import nextprime, prevprime, isprime
    A070306_list, i = [], 3
    while i < 10**6:
        n = i**3
        m = n//3
        pm, nm = prevprime(m), nextprime(m)
        k = n - pm - nm
        if isprime(m):
            if m == k:
                A070306_list.append(i)
        else:
            if nextprime(nm) == k or prevprime(pm) == k:
                A070306_list.append(i)
        i += 1 # Chai Wah Wu, May 30 2017

Extensions

More terms from R. J. Mathar, Jan 13 2007
a(29)-a(48) from Donovan Johnson, Apr 27 2008
Edited by N. J. A. Sloane, Nov 12 2009 at the suggestion of R. J. Mathar

A362465 a(n) is the least number of 2 or more consecutive signed primes whose sum equals n.

Original entry on oeis.org

3, 2, 2, 4, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 5, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 3, 2, 5, 2, 3
Offset: 0

Views

Author

Karl-Heinz Hofmann, Apr 21 2023

Keywords

Comments

Inspired by a conjecture made by Carlos Rivera in 2000 (see link). Here we remove Rivera's restriction that the primes have to be smaller than n.
For every positive even n, a(n) = 2, provided there are 2 consecutive primes separated by a gap of size n. Polignac's conjecture says: "For any positive even number n, there are infinitely many prime gaps of size n." If so, a(3) is the only 4 in this sequence, as any even number of consecutive odd signed primes has an even sum.
There is also the reversed sequence for negative n with 0 as the symmetry point.
See A362466 for the first occurrences of numbers in this sequence.

Examples

			a(1) = 2: -2 + 3 = 1.
a(0) = 3: -2 - 3 + 5 = 0.
a(3) = 4:  2 + 3 + 5 - 7 = 3.
The example below for a(29) gives more detail of the general method employed.
a(29) = 5:  3 - 5 + 7 + 11 + 13 = 29.
Since any even number of consecutive odd signed primes has an even sum, we can show a(29) <> 4.
A test with all triples of consecutive signed primes up to 10^9 gave no solution for 29. The estimated lower bound for the permutation p1 + p2 - p3 is p1 - (p1 + 2)^0.525 and was never surpassed. (See Wikipedia link. "A result, due to Baker, Harman and Pintz in 2001, shows that Theta may be taken to be 0.525".) So the terms are calculated with the assumption that this is true.
		

Crossrefs

Cf. A000230, A001632, A362466 (first occurrences).

Programs

  • Python
    from sympy import primepi, sieve as prime
    import numpy
    upto = 50000                   # 5000000 good for 8 GB RAM (3 Minutes)
    primepi_of_upto, np, arr = primepi(upto), 1, []
    A362465 = numpy.zeros(upto + 1, dtype="i4")
    A362465[2:][::2] = 2           # holds if "upto" < 7 * 10^7
    for n in range(1,primepi_of_upto + 1): arr.append([prime[n]])
    while all(A362465) == 0:
        np += 1
        for k in range(0,primepi_of_upto):
            temp = []
            for i in arr[k]:
                temp.append(i + prime[k+np])
                temp.append(abs(i - prime[k+np]))
            arr[k] = set(temp)
            for n in temp:
                if n <= upto and A362465[n] == 0: A362465[n] = np
    print(list(A362465[0:100]))

Formula

a(n) = a(-n).

Extensions

Edited by Peter Munn, Aug 08 2023
Previous Showing 11-20 of 53 results. Next