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.

A226533 a(n) = smallest integer m such that m^n is a sum of two successive primes.

Original entry on oeis.org

5, 6, 2, 150, 22, 82, 2, 258, 70, 30, 42, 18, 2, 12, 262, 58, 460, 36, 552, 24, 318, 344, 450, 54, 274, 88, 36, 92, 90, 188, 554, 20, 404, 700, 240, 6, 136, 262, 578, 222, 2182, 276, 162, 60, 142, 326, 176, 198, 930, 1116
Offset: 1

Views

Author

Zak Seidov, Jun 09 2013

Keywords

Examples

			5^1 = 5 = 2 + 3, 6^2 = 36  = 17 + 19, 2^3 = 8 = 3 + 5, 150^4 =506250000 = 253124999 + 253125001.
		

Crossrefs

a(2) = 6 = A074924(1), a(3) = 2 = A074925(1). Cf. A001043, A001597.

Programs

  • Mathematica
    a[n_] := For[m = 2, True, m++, p = m^n/2 // NextPrime[#, -1]&; q = NextPrime[p]; If[p + q == m^n, Print["a(", n, ") = ", m]; Return[m]]]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Jun 10 2013 *)
    tsp[n_]:=Module[{m=1,t},t=m^n;While[NextPrime[t/2]+NextPrime[t/2, -1]! = t,m++;t=m^n];m]; Array[tsp,50] (* Harvey P. Dale, Nov 10 2014 *)
  • PARI
    a(n)=if(n==1,return(5)); my(m=1,M,p); while(1,M=m++^n;p=precprime(M/2); ispseudoprime(M-p) && M-p==nextprime(M/2) && return(m)) \\ Charles R Greathouse IV, Jun 10 2013

Extensions

a(41)-a(50) from Jean-François Alcover, Jun 10 2013