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-18 of 18 results.

A298302 The first of three consecutive primes the sum of which is equal to the sum of three consecutive heptagonal numbers.

Original entry on oeis.org

17, 967, 7477, 15877, 17093, 24337, 69467, 99689, 123983, 241333, 375773, 457307, 501077, 525983, 604411, 654587, 772001, 780347, 1007099, 1023037, 1124593, 1192651, 1206497, 1423921, 1488797, 1598791, 1610809, 1692071, 1809221, 2297759, 2538623, 3017849
Offset: 1

Views

Author

Colin Barker, Jan 16 2018

Keywords

Examples

			17 is in the sequence because 17+19+23 (consecutive primes) = 59 = 7+18+34 (consecutive hexagonal numbers).
		

Crossrefs

Programs

  • PARI
    L=List(); forprime(p=2, 4000000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if(issquare(120*t-519, &sq) && (sq-21)%30==0, u=(sq-21)\30; listput(L, p))); Vec(L)

A098726 Take three consecutive primes starting with the n-th prime. Calculate d(i,j) = abs(prime(i) - prime(j)), for all {i,j}, i.e., all possible differences. a(n) is the number of distinct differences (which can be either 3 or 2).

Original entry on oeis.org

3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3
Offset: 1

Views

Author

Labos Elemer, Oct 05 2004

Keywords

Comments

a(n) = 2 iff the consecutive prime differences are equal.
It appears that a(n) = 2 for n in A064113. - Michel Marcus, Jul 27 2017

Crossrefs

Programs

  • Mathematica
    k=3;t=Table[Abs[Prime[n+i]-Prime[n+j]], {i, 0, k-1}, {j, 0, k-1}]; u=Delete[Union[Flatten[t]], 1];a(n)=Length[u]

Extensions

Name edited by Michel Marcus, Jul 27 2017

A298102 The first of five consecutive integers the sum of which is equal to the sum of five consecutive prime numbers.

Original entry on oeis.org

77, 279, 293, 327, 347, 353, 401, 437, 509, 641, 675, 683, 785, 803, 839, 885, 947, 961, 1169, 1177, 1193, 1239, 1325, 1337, 1395, 1433, 1461, 1501, 1545, 1639, 1683, 1715, 1731, 1777, 1809, 1915, 1955, 1989, 2031, 2059, 2139, 2145, 2345, 2387, 2393, 2431
Offset: 1

Views

Author

Colin Barker, Jan 12 2018

Keywords

Comments

Also: Number m such that 5 * m + 10 is the sum of 5 consecutive primes. - David A. Corneth, Jan 12 2018

Examples

			77 is in the sequence because 77+78+79+80+81 = 395 = 71+73+79+83+89.
		

Crossrefs

Programs

  • Mathematica
    p = {2, 3, 5, 7, 11}; lst = {}; While[p[[1]] < 3001, t = Plus @@ p; If[Mod[t, 10] == 5, AppendTo[lst, (t - 10)/5]]; p = Join[Rest@p, {NextPrime[p[[-1]]]}]]; lst (*  Robert G. Wilson v, Jan 14 2018 *)
    Select[(#-10)/5&/@(Total/@Partition[Prime[Range[400]],5,1]),IntegerQ] (* Harvey P. Dale, Jun 22 2019 *)
  • PARI
    L=List(); forprime(p=2, 2500, q=nextprime(p+1); r=nextprime(q+1); s=nextprime(r+1); t=nextprime(s+1); u=p+q+r+s+t; if((u-10)%5==0, listput(L, (u-10)\5))); Vec(L)
    
  • PARI
    upto(n) = my(res = List(), pr = primes(5), s = vecsum(pr)); while(pr[5] < n, if(s == 5 * pr[3], listput(res, pr[1])); lp = nextprime(pr[5] + 1); s += (lp - pr[1]); for(i = 1, 4, pr[i] = pr[i+1]); pr[5] = lp); res \\ David A. Corneth, Jan 12 2018

Extensions

New name by David A. Corneth, Jan 12 2018

A298103 The first of five consecutive prime numbers the sum of which is equal to the sum of five consecutive integers.

Original entry on oeis.org

71, 271, 281, 313, 337, 347, 389, 431, 499, 631, 661, 673, 769, 787, 827, 877, 937, 947, 1153, 1163, 1181, 1229, 1307, 1319, 1373, 1427, 1451, 1489, 1531, 1621, 1667, 1699, 1721, 1759, 1789, 1901, 1933, 1979, 2017, 2039, 2131, 2137, 2339, 2381, 2383, 2417
Offset: 1

Views

Author

Colin Barker, Jan 12 2018

Keywords

Examples

			71 is in the sequence because 71+73+79+83+89 = 395 = 77+78+79+80+81.
		

Crossrefs

Programs

  • PARI
    L=List(); forprime(p=2, 2500, q=nextprime(p+1); r=nextprime(q+1); s=nextprime(r+1); t=nextprime(s+1); u=p+q+r+s+t; if((u-10)%5==0, listput(L, p))); Vec(L)

A298312 The first of three consecutive octagonal numbers the sum of which is equal to the sum of three consecutive primes.

Original entry on oeis.org

12160, 74576, 158240, 181056, 269400, 371008, 601216, 606600, 848008, 980408, 1242920, 2075008, 3292816, 3680776, 4477408, 4685000, 5627960, 7505008, 8263480, 9289280, 10397408, 10419760, 10735208, 10757920, 12726680, 13000008, 14200576, 15426936, 15700256
Offset: 1

Views

Author

Colin Barker, Jan 17 2018

Keywords

Examples

			12160 is in the sequence because 12160+12545+12936 (consecutive octagonal numbers) = 37641 = 12541+12547+12553 (consecutive primes).
		

Crossrefs

Programs

  • PARI
    L=List(); forprime(p=2, 20000000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if(issquare(36*t-180, &sq) && (sq-12)%18==0, u=(sq-12)\18; listput(L, 3*u^2-2*u))); Vec(L)
    
  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A298312_list, n, m = [], 1, 30
    while len(A298312_list) < 10000:
        k = prevprime(m//3)
        k2 = nextprime(k)
        if prevprime(k) + k + k2 == m or k + k2 + nextprime(k2) == m:
            A298312_list.append(n*(3*n-2))
        n += 1
        m += 18*n + 3 # Chai Wah Wu, Jan 22 2018

A298313 The first of three consecutive primes the sum of which is equal to the sum of three consecutive octagonal numbers.

Original entry on oeis.org

12541, 75521, 159617, 182519, 271181, 373091, 603901, 609289, 851197, 983819, 1246757, 2079997, 3299081, 3687421, 4484737, 4692497, 5636171, 7514477, 8273437, 9299831, 10408577, 10430921, 10746557, 10769281, 12739037, 13012487, 14213621, 15440531, 15713959
Offset: 1

Views

Author

Colin Barker, Jan 17 2018

Keywords

Examples

			12541 is in the sequence because 12541+12547+12553 (consecutive primes) = 37641 = 12160+12545+12936 (consecutive octagonal numbers).
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=5000,oct3},oct3=Total/@Partition[PolygonalNumber[8,Range[nn]],3,1];Select[ Partition[Prime[Range[PrimePi[Ceiling[Max[oct3]/3]]]],3,1],MemberQ[ oct3,Total[ #]]&]][[All,1]] (* Harvey P. Dale, Dec 03 2022 *)
  • PARI
    L=List(); forprime(p=2, 20000000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if(issquare(36*t-180, &sq) && (sq-12)%18==0, u=(sq-12)\18; listput(L, p))); Vec(L)
    
  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A298313_list, n, m = [], 1, 30
    while len(A298313_list) < 10000:
        k = prevprime(m//3)
        k2 = prevprime(k)
        k3 = nextprime(k)
        if k2 + k + k3 == m:
            A298313_list.append(k2)
        elif k + k3 + nextprime(k3) == m:
            A298313_list.append(k)
        n += 1
        m += 18*n + 3 # Chai Wah Wu, Jan 22 2018

A358393 First of three consecutive primes p,q,r such that p*q + p*r - q*r, p*q - p*r + q*r and -p*q + p*r + q*r are all prime.

Original entry on oeis.org

261977, 496163, 1943101, 2204273, 2502827, 2632627, 2822381, 2878543, 3291593, 3431891, 4122043, 4269679, 5205671, 5224361, 5565139, 6248881, 6600989, 6881291, 7568963, 8181317, 8251277, 8377777, 9005561, 9644911, 10226233, 11096753, 11767801, 12252271, 13197361, 13574489, 13730263, 14064901
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Nov 13 2022

Keywords

Examples

			a(1) = 261977 is a term because 261977, 261983 and 262007 are consecutive primes with 261977*261983 + 261977*262007 - 261983*262007 = 68631948349,
261977*261983 - 261977*262007 + 261983*262007 = 68635092433, and
-261977*261983 + 261977*262007 + 261983*262007 = 68647667329 prime.
		

Crossrefs

Contained in A054643.

Programs

  • Maple
    q:= 2: r:= 3:
    R:= NULL: count:= 0:
    while count < 40 do
      p:= q; q:= r; r:= nextprime(r);
      s:= p*(q+r)+q*r;
      if  isprime(s-2*p*q) and isprime(s-2*p*r) and isprime(s-2*q*r) then       R:= R, p; count:= count+1;
      fi
    od:
    R;
  • Mathematica
    f[p_, q_, r_] := PrimeQ[p*q + p*r - q*r] && PrimeQ[p*q - p*r + q*r] && PrimeQ[-p*q + p*r + q*r]; Select[Partition[Prime[Range[10^6]], 3, 1], f @@ # &][[;; , 1]] (* Amiram Eldar, Nov 13 2022 *)
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen():
        p, q, r = 2, 3, 5
        while True:
            pq, pr, qr = p*q, p*r, q*r
            if all(isprime(t) for t in [pq+pr-qr, pq-pr+qr, -pq+pr+qr]): yield p
            p, q, r = q, r, nextprime(r)
    print(list(islice(agen(), 15))) # Michael S. Branicky, Nov 13 2022

A366414 Primes p such that p and the four previous primes are in arithmetic progression.

Original entry on oeis.org

9843139, 37772549, 53868769, 71427877, 78364669, 79080697, 98150141, 99591553, 104437009, 106457629, 111267539, 121174931, 121174961, 168236239, 199450219, 203909011, 207068923, 216618307, 230952979, 234058991, 235524901, 253412437, 263651281, 268843153, 294485483, 296239907
Offset: 1

Views

Author

Harvey P. Dale, Oct 09 2023

Keywords

Examples

			9843019, 9843049, 9843079, 9843109, 9843139 are the 5 consecutive primes starting from A059044(1) and ending at a(1).
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[10^7]],5,1],Length[Union[Differences[#]]]==1&][[;;,5]]
Previous Showing 11-18 of 18 results.