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-3 of 3 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)

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
Showing 1-3 of 3 results.