login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A024785 Left-truncatable primes: every suffix is prime and no digits are zero. 33
2, 3, 5, 7, 13, 17, 23, 37, 43, 47, 53, 67, 73, 83, 97, 113, 137, 167, 173, 197, 223, 283, 313, 317, 337, 347, 353, 367, 373, 383, 397, 443, 467, 523, 547, 613, 617, 643, 647, 653, 673, 683, 743, 773, 797, 823, 853, 883, 937, 947, 953, 967, 983, 997, 1223 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Last term is a(4260) = 357686312646216567629137 (Angell and Godwin). - Eric W. Weisstein, Dec 11 1999

LINKS

N. J. A. Sloane, Table of n, a(n) for n = 1..4260 (The full list, based on the De Geest web site)

I. O. Angell and H. J. Godwin, On Truncatable Primes, Math. Comput. 31, 265-267, 1977.

P. De Geest, The list of 4260 left-truncatable primes

Rosetta Code, Programs for finding truncatable primes

Eric Weisstein's World of Mathematics, Truncatable Prime

Chai Wah Wu, On a conjecture regarding primality of numbers constructed from prepending and appending identical digits, arXiv:1503.08883 [math.NT], 2015.

Index entries for sequences related to truncatable primes

MAPLE

a:=[[2], [3], [5], [7]]: l1:=1: l2:=4: for n from 1 to 3 do for k from 1 to 9 do for j from l1 to l2 do d:=[op(a[j]), k]: if(isprime(op(convert(d, base, 10, 10^nops(d)))))then a:=[op(a), d]: fi: od: od: l1:=l2+1: l2:=nops(a): if(l1>l2)then break: fi: od: seq(op(convert(a[j], base, 10, 10^nops(a[j]))), j=1..nops(a)); # Nathaniel Johnston, Jun 21 2011

MATHEMATICA

max = 2000; truncate[p_] := If[id = IntegerDigits[p]; FreeQ[id, 0] && (Last[id] == 3 || Last[id] == 7) && PrimeQ[q = FromDigits[ Rest[id]]], q, p]; ok[n_] := FixedPoint[ truncate, n] < 10; p = 5; A024785 = {2, 3, 5}; While[(p = NextPrime[p]) < max, If[ok[p], AppendTo[A024785, p]]]; A024785 (* Jean-François Alcover, Nov 09 2011 *)

d[n_]:=IntegerDigits[n]; ltrQ[n_]:=And@@PrimeQ[NestList[FromDigits[Drop[d[#], 1]]&, n, Length[d[n]]-1]]; Select[Range[1225], ltrQ[#]&] (* Jayanta Basu, May 29 2013 *)

PROG

(PARI) {v=vector(4260); v[1]=2; v[2]=3; v[3]=5; v[4]=7; i=0; j=4; until(i>=j, i++; p=v[i]; P10=10^(1+log(p)\log(10)); for(k=1, 9, z=k*P10+p; if(isprime(z), j++; v[j]=z; ))); s=vector(4260); s=vecsort(v); for(i=1, j, write("b024785.txt", i, " ", s[i]); ); } \\ Harry J. Smith, Sep 19 2008

(PARI) is_A024785(n, t=1)={until(t>10*p, isprime(p=n%t*=10)||return); n==p} \\ M. F. Hasler, Apr 17 2014

(Haskell)

import Data.List (tails)

a024785 n = a024785_list !! (n-1)

a024785_list = filter (\x ->

   all (== 1) $ map (a010051 . read) $ init $ tails $ show x) a038618_list

-- Reinhard Zumkeller, Nov 01 2011

CROSSREFS

Supersequence of A240768.

Cf. A033664, A032437, A020994, A024770 (right-truncatable primes), A052023, A052024, A052025, A050986, A050987, A077390 (left-and-right truncatable primes), A137812 (left-or-right truncatable primes), A254753.

Sequence in context: A067905 A042993 A033664 * A069866 A125772 A233282

Adjacent sequences:  A024782 A024783 A024784 * A024786 A024787 A024788

KEYWORD

nonn,base,easy,fini,full

AUTHOR

David W. Wilson

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified December 7 23:55 EST 2016. Contains 278902 sequences.