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.

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

This page as a plain text file.
%I A077362 #11 Aug 11 2025 23:09:00
%S A077362 0,0,977,9677,99377,998717,9998777,99999617,999999017,9999996437,
%T A077362 99999997397,999999997277,9999999986477,99999999993317,
%U A077362 999999999997337,9999999999990797,99999999999998837,999999999999995717,9999999999999997397,99999999999999994877
%N A077362 Largest n-digit prime whose external digits as well as internal digits form a prime, or 0 if no such number exists.
%C A077362 Conjecture: no entry is zero for n>2.
%C A077362 Conjecture: each term after the first two terms ends with 7. - _Harvey P. Dale_, May 26 2018
%H A077362 Harvey P. Dale, <a href="/A077362/b077362.txt">Table of n, a(n) for n = 0..100</a>
%t A077362 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 *)
%t A077362 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 *)
%Y A077362 Cf. A069686, A077359, A077360, A077361.
%K A077362 base,nonn
%O A077362 0,3
%A A077362 _Amarnath Murthy_, Nov 05 2002
%E A077362 Corrected and extended by Joshua Albert (jba138(AT)psu.edu), Feb 22 2006