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

A077362 Largest n-digit prime whose external digits as well as internal digits form a prime, or 0 if no such number exists.

Original entry on oeis.org

0, 0, 977, 9677, 99377, 998717, 9998777, 99999617, 999999017, 9999996437, 99999997397, 999999997277, 9999999986477, 99999999993317, 999999999997337, 9999999999990797, 99999999999998837, 999999999999995717, 9999999999999997397, 99999999999999994877
Offset: 0

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

Conjecture: no entry is zero for n>2.
Conjecture: each term after the first two terms ends with 7. - Harvey P. Dale, May 26 2018

Crossrefs

Programs

  • Mathematica
    LastDigit[n_] := n - 10*Floor[n/10]; FirstDigit[n_] := Floor[n/(10^(Ceiling[Log[10, n]] - 1))]; MiddleDigits[n_] := Floor[(n - Floor[n/(10^(Ceiling[Log[10, n]] - 1))]*10^(Ceiling[Log[10, n]] - 1))/10]; IntExtPrimeTest2[n_] := TrueQ[(Boole[PrimeQ[FirstDigit[n]*10 + LastDigit[ n]]] + Boole[PrimeQ[MiddleDigits[n]]] + Boole[PrimeQ[n]]) == 3]; finder[digits_] := (maxj = 10^digits; For[j = maxj, IntExtPrimeTest2[j] == False, j-- ]; j); Table[finder[n], {n, 3, 20}] (* Joshua Albert (jba138(AT)psu.edu), Feb 22 2006 *)
    eidQ[n_]:=Module[{idn=IntegerDigits[n]},AllTrue[{FromDigits[Join[ {idn[[1]]}, {idn[[-1]]}]],FromDigits[Most[Rest[idn]]]},PrimeQ]]; Join[ {0,0},Table[Module[{np=NextPrime[10^n-1,-1]},While[ !eidQ[np],np = NextPrime[ np,-1]];np],{n,3,18}]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 26 2018 *)

Extensions

Corrected and extended by Joshua Albert (jba138(AT)psu.edu), Feb 22 2006
Showing 1-1 of 1 results.