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

A298462 The first of two consecutive triangular numbers the sum of which is equal to the sum of two consecutive prime numbers.

Original entry on oeis.org

15, 45, 66, 276, 861, 1128, 1891, 2556, 3486, 4005, 5995, 7140, 7381, 15051, 20706, 21528, 24090, 26796, 28680, 34716, 46665, 52975, 56280, 69006, 74305, 83028, 83845, 98346, 102831, 103740, 109278, 110215, 112101, 135981, 148785, 150975, 176121, 179700
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			45 is in the sequence because 45+55 (consecutive triangular numbers) = 100 = 47+53 (consecutive primes).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,q;
      p:= prevprime(floor((n+1)^2/2)); q:= nextprime(p);
      if p+q = (n+1)^2 then n*(n+1)/2 else NULL fi
    end proc:
    map(f, [$2..1000]); # Robert Israel, Jan 19 2018
  • PARI
    L=List(); forprime(p=2, 200000, q=nextprime(p+1); t=p+q; if(issquare(4*t, &sq) && (sq-2)%2==0, u=(sq-2)\2; listput(L, u*(u+1)/2))); Vec(L)

A298464 The first of two consecutive primes the sum of which is equal to the sum of two consecutive pentagonal numbers.

Original entry on oeis.org

79, 3643, 10909, 37123, 56053, 70849, 78889, 125551, 178877, 209063, 258743, 330409, 350411, 395261, 439559, 469279, 479387, 499969, 620813, 663997, 754723, 828811, 878597, 901709, 1026709, 1087147, 1170397, 1202429, 1213189, 1234873, 1340477, 1510013
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			79 is in the sequence because 79+83 (consecutive primes) = 162 = 70+92 (consecutive pentagonal numbers).
		

Crossrefs

Programs

  • Mathematica
    Block[{s = Total /@ Partition[PolygonalNumber[5, Range[10^3]], 2, 1], t}, t = Partition[Prime@ Range@ PrimePi[2 Last[s]], 2, 1]; Select[t, MemberQ[s, Total@ #] &][[All, 1]]] (* Michael De Vlieger, Jan 21 2018 *)
  • PARI
    L=List(); forprime(p=2, 1600000, q=nextprime(p+1); t=p+q; if(issquare(12*t-8, &sq) && (sq-2)%6==0, u=(sq-2)\6; listput(L, p))); Vec(L)
    
  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A298464_list, n, m = [], 1 ,6
    while len(A298464_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298464_list.append(k)
        n += 1
        m += 6*n-1 # Chai Wah Wu, Jan 20 2018

A298465 The first of two consecutive heptagonal numbers the sum of which is equal to the sum of two consecutive primes.

Original entry on oeis.org

1, 18, 403, 16281, 24354, 167314, 172528, 183196, 191407, 223054, 413512, 446688, 476767, 507826, 512343, 791578, 926289, 994456, 1032658, 1248562, 1284147, 2221708, 2278630, 2453716, 2604571, 2738952, 2770443, 3207523, 3333330, 4203577, 4400332, 4628761
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			18 is in the sequence because 18+34 (consecutive heptagonal numbers) = 52 = 23+29 (consecutive primes).
		

Crossrefs

Programs

  • Mathematica
    chcpQ[{a_,b_}]:=Module[{c=(a+b)/2},NextPrime[c]+ NextPrime[c,-1] ==a+b]; Select[ Partition[PolygonalNumber[7,Range[2000]],2,1],chcpQ][[;;,1]] (* Harvey P. Dale, Mar 14 2023 *)
  • PARI
    L=List(); forprime(p=2, 6000000, q=nextprime(p+1); t=p+q; if(issquare(20*t-16, &sq) && (sq-2)%10==0, u=(sq-2)\10; listput(L, (5*u^2-3*u)/2))); Vec(L)
    
  • Python
    from sympy import prevprime, nextprime
    A298465_list, n, m = [], 1 ,8
    while len(A298465_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298465_list.append(n*(5*n-3)//2)
        n += 1
        m += 10*n-3 # Chai Wah Wu, Jan 19 2018

A298466 The first of two consecutive primes the sum of which is equal to the sum of two consecutive heptagonal numbers.

Original entry on oeis.org

3, 23, 433, 16481, 24593, 167953, 173183, 183871, 192097, 223781, 414521, 447743, 477857, 508951, 513473, 792983, 927803, 996019, 1034251, 1250309, 1285937, 2224063, 2281003, 2456191, 2607109, 2741561, 2773073, 3210353, 3336209, 4206817, 4403647, 4632161
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			23 is in the sequence because 23+29 (consecutive primes) = 52 = 18+34 (consecutive heptagonal numbers).
		

Crossrefs

Programs

  • Mathematica
    Module[{hep=Total/@Partition[PolygonalNumber[7,Range[1500]],2,1]},Select[ Partition[Prime[Range[PrimePi[Max[hep]/2]]],2,1],MemberQ[hep,Total[#]]&]][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 04 2019 *)
  • PARI
    L=List(); forprime(p=2, 6000000, q=nextprime(p+1); t=p+q; if(issquare(20*t-16, &sq) && (sq-2)%10==0, u=(sq-2)\10; listput(L, p))); Vec(L)
    
  • Python
    from sympy import prevprime, nextprime
    A298466_list, n, m = [], 1 ,8
    while len(A298466_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298466_list.append(k)
        n += 1
        m += 10*n-3 # Chai Wah Wu, Jan 19 2018
Showing 1-4 of 4 results.