This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A323137 Largest prime that is both left-truncatable and right-truncatable in base n. 3
 23, 11, 67, 839, 37, 1867, 173, 739397, 79, 105691, 379, 37573, 647, 3389, 631, 202715129, 211, 155863, 1283, 787817, 439, 109893629, 577, 4195880189, 1811, 14474071, 379, 21335388527, 2203, 1043557, 2939, 42741029, 2767, 50764713107, 853, 65467229, 4409, 8524002457 (list; graph; refs; listen; history; text; internal format)
 OFFSET 3,1 LINKS Daniel Suteu, Table of n, a(n) for n = 3..64 Wikipedia, Truncatable prime FORMULA a(n) <= min(A023107(n), A103443(n)). - Daniel Suteu, Feb 24 2019 EXAMPLE For n = 12: 105691 is 511B7 in base 12. Successively removing the leftmost digit yields the base-12 numbers 11B7, 1B7, B7 and 7. When converted to base 10, these are 2011, 283, 139 and 7, respectively, all primes. Successively removing the rightmost digit yields the base-12 numbers 511B, 511, 51 and 5. When converted to base 10, these are 8807, 733, 61 and 5, respectively, all primes. Since no larger prime with this property in base 12 exists (as proven by Daniel Suteu), a(12) = 105691. PROG (PARI) digitsToNum(d, base) = sum(k=1, #d, base^(k-1) * d[k]); isLeftTruncatable(d, base) = my(ok=1); for(k=1, #d, if(!isprime(digitsToNum(d[1..k], base)), ok=0; break)); ok; generateFromPrefix(p, base) = my(seq = [p]); for(n=1, base-1, my(t=concat(n, p)); if(isprime(digitsToNum(t, base)), seq=concat(seq, select(v -> isLeftTruncatable(v, base), generateFromPrefix(t, base))))); seq; bothTruncatablePrimesInBase(base) = my(t=[]); my(P=primes(primepi(base-1))); for(k=1, #P, t=concat(t, generateFromPrefix([P[k]], base))); vector(#t, k, digitsToNum(t[k], base)); a(n) = vecmax(bothTruncatablePrimesInBase(n)); \\ for n>=3; Daniel Suteu, Jan 22 2019 CROSSREFS Cf. A020994, A023107, A076586, A076623, A103443, A323390, A323396. Sequence in context: A016837 A226218 A294087 * A083154 A002549 A166526 Adjacent sequences:  A323134 A323135 A323136 * A323138 A323139 A323140 KEYWORD nonn,base AUTHOR Felix FrÃ¶hlich, Jan 05 2019 EXTENSIONS a(17)-a(40) from Daniel Suteu, Jan 11 2019 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
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified June 20 09:12 EDT 2019. Contains 324234 sequences. (Running on oeis4.)