In number theory, a left-truncatable prime is a prime number which, in a given base, contains no 0, and if the leading ("left") digit is successively removed, then all resulting numbers are prime. For example, 7817, since 7817, 817, 17 and 7 are all prime. Dozenal representation is often assumed and always used in this article.

right-truncatable prime is a prime which remains prime when the last ("right") digit is successively removed. 575E is an example of a right-truncatable prime, since 575E, 575, 57 and 5 are all prime.

## Lists of truncatable primes

There are 824E1 left-truncatable primes:

2, 3, 5, 7, E, 15, 17, 1E, 25, 27, 35, 37, 3E, 45, 4E, 57, 5E, 67, 6E, 75, 85, 87, 8E, 95, X7, XE, E5, E7, 117, 11E, 125, 13E, 145, 157, 167, 16E, 175, 18E, 195, 1X7, 1E5, 1E7, 217, 21E, 225, 237, 24E, 25E, 267, 285, 295, 2XE, 315, 325, 327, 33E, 34E, 357, 35E, 375, 3XE, 3E5, 3E7, 415, 41E, 427, 435, 437, 457, 45E, 46E, 485, 48E, 517, 51E, 527, 535, 545, 557, 575, 585, 587, 58E, 5E5, 5E7, 615, 617, 61E, 637, 63E, 66E, 675, 687, 68E, 695, 6X7, 71E, 727, 735, 737, 745, 767, 76E, 775, 785, 817, 825, 835, 85E, 867, 88E, 8X7, 8XE, 8E5, 8E7, 91E, 927, 95E, 987, 995, 9X7, 9XE, 9E5, X17, X27, X35, X37, X3E, X45, X4E, X5E, X6E, X87, X95, XX7, XXE, XE7, E15, E1E, E25, E37, E45, E67, E6E, E95, EE5, EE7, 1125, 1167, 118E, 11X7, 11E7, 121E, 125E, 1295, 133E, 13E5, 1437, 1457, 148E, 1517, 1585, 1587, 1615, 168E, 16X7, 1727, 1735, 1745, 176E, 1785, 1825, 18XE, 18E7, 1995, 1X17, 1X35, 1X45, 1X6E, 1X87, 1XXE, 1XE7, 1E15, 1E67, 1EE5, 211E, 21X7, 21E7, 221E, 224E, 2267, 2325, 2327, 234E, 23XE, 23E7, 2415, 2435, 2457, 2485, 248E, 2535, 2545, 2557, 258E, 2615, 2617, 2637, 2675, 2687, 26X7, 2737, 2745, 276E, 2825, 2835, 285E, 2927, 29E5, 2X35, 2X3E, 2X5E, 2X87, 2X95, 2XX7, 2E67, 2E95, 2EE7, 3117, 311E, 3145, 3167, 3175, 3195, 3225, 324E, 3285, 3327, 3357, 341E, 3427, 3435, 3457, 346E, 3485, 348E, 3517, 351E, 3587, 358E, 35E7, 3617, 3637, 366E, 3687, 3767, 38E5, 395E, 39X7, 3X95, 3XE7, 3E1E, 3EE7, 411E, 413E, 4145, 41E5, 4217, 4225, 4237, 42XE, 4357, 4375, 43E5, 4435, 445E, 4485, 4535, 4557, 4615, 463E, 4687, 468E, 4727, 4737, 4775, 4825, 488E, 48X7, 491E, 4987, 4X5E, 4E15, 4E37, 4E95, 5117, 511E, 513E, 5145, 5167, 516E, 51E7, 521E, 5237, 525E, 5267, 5285, 5295, 52XE, 5327, 5375, 53XE, 53E5, 541E, 5435, 5457, 548E, 5527, 5545, 5585, 5587, 558E, 55E5, 5615, 5637, 563E, 566E, 56X7, 5727, 5735, 5785, 5817, 5835, 5867, 58XE, 58E5, 58E7, 5927, 595E, 5987, 59XE, 5X17, 5X27, 5X45, 5X4E, 5X5E, 5X6E, 5X95, 5XXE, 5E1E, 5E25, 5E37, 5E67, 5E95, 6117, 613E, 6175, 61X7, 61E7, 6327, 633E, 634E, 6357, 6375, 63E5, 63E7, 6437, 646E, 6527, 6575, 6617, 663E, 6675, 671E, 6825, 68E5, 6995, 69E5, 6X17, 6X27, 6X4E, 6XXE, 6E15, 6E25, 711E, 7125, 716E, 7175, 718E, 71E5, 71E7, 7225, 7295, 73XE, 7415, 7427, 7435, 7457, 745E, 7585, 7587, 758E, 75E5, 7617, 761E, 7637, 763E, 766E, 7675, 7687, 771E, 7737, 7767, 776E, 7817, 7867, 795E, 79XE, 7X27, 7X35, 7X6E, 7X95, 7E15, 7E25, 7E37, 7E67, 7E6E, 8125, 816E, 8175, 8195, 81E7, 82XE, 833E, 8357, 835E, 83XE, 841E, 8427, 8517, 8575, 85E7, 8637, 866E, 8835, 888E, 88XE, 8995, 8X37, 8X95, 8XX7, 8E37, 8E45, 9145, 918E, 9195, 91X7, 9217, 9267, 92XE, 9315, 9375, 9485, 9557, 9575, 95E7, 9615, 9687, 9695, 9737, 9775, 9785, 988E, 98X7, 98E7, 991E, 9927, 99XE, 9X17, 9X35, 9XXE, 9E1E, 9E45, X117, X13E, X145, X157, X1X7, X225, X24E, X285, X295, X315, X35E, X3E7, X457, X46E, X485, X535, X575, X63E, X675, X68E, X695, X71E, X735, X745, X767, X76E, X817, X825, X85E, X88E, X987, X9E5, XX45, XX6E, XXE7, XE45, XE6E, XEE5, E125, E157, E167, E18E, E1E5, E21E, E2XE, E315, E325, E327, E357, E3XE, E3E5, E51E, E527, E5E7, E615, E617, E63E, E675, E68E, E727, E785, E835, E85E, E8X7, E8E5, E91E, E987, E9X7, E9E5, EX27, EX4E, EX87, EEE7, ...

The largest is the 28-digit 471X34X164259EX16E324XE8X32E7817.

There are 12E right-truncatable primes. The complete list:

2, 3, 5, 7, E, 25, 27, 31, 35, 37, 3E, 51, 57, 5E, 75, E5, E7, 251, 255, 25E, 271, 277, 27E, 315, 357, 35E, 375, 377, 3E5, 3E7, 511, 517, 51E, 575, 577, 5E1, 5E5, 5E7, 5EE, 751, E71, 2555, 2557, 2715, 2717, 2771, 27E1, 27E7, 3155, 315E, 35E1, 35E7, 35EE, 3755, 375E, 3771, 377E, 3E51, 3E55, 3E75, 3E7E, 5117, 511E, 51E7, 575E, 5771, 5777, 577E, 5E17, 5E1E, 5E55, 5E75, 5EE1, 7511, E711, 25551, 25577, 27151, 27155, 2715E, 27E17, 27E77, 31551, 315E5, 375E5, 375EE, 37715, 3E515, 3E557, 3E55E, 3E7E5, 511E7, 51E71, 575EE, 57711, 57717, 577E7, 577EE, 5E175, 5E1E7, 5E55E, 5E751, 5EE17, 75111, 75115, E7111, E7115, 255515, 255775, 271555, 2715E1, 27E177, 27E17E, 27E771, 375E55, 375EE5, 377151, 3E5155, 3E5157, 3E515E, 3E5571, 3E557E, 3E55E7, 3E7E5E, 511E77, 51E717, 575EEE, 577117, 577175, 577E75, 5E55E1, 5E55EE, 5EE171, 751115, E71157, 2715551, 27E7715, 27E7717, 375E555, 375E557, 375EE5E, 3771515, 3E5155E, 3E5157E, 3E55715, 3E557E5, 3E557E7, 3E55E71, 3E55E77, 3E55E7E, 511E775, 5771171, 5771755, 5E55E1E, 5E55EE1, 5EE1711, 7511151, 7511157, 27E77151, 27E7715E, 27E77175, 375EE5E5, 3E5155EE, 3E5157E7, 3E557151, 3E557E75, 3E55E775, 3E55E7E5, 3E55E7EE, 511E7755, 5E55E1E5, 27E771511, 27E771755, 375EE5E51, 375EE5E55, 3E5571515, 3E55E7755, 3E55E7E57, 375EE5E515

The largest is the X-digit 375EE5E515. All primes above 3 end with digit 1, 5, 7 or E, so a right-truncatable prime can only contain those digits after the leading digit.

There are 2E primes which are both left-truncatable and right-truncatable. They have been called two-sided primes. The complete list:

2, 3, 5, 7, E, 25, 27, 35, 37, 3E, 57, 5E, 75, E5, E7, 25E, 315, 357, 35E, 375, 3E5, 3E7, 517, 51E, 575, 5E5, 5E7, 2557, 35E7, 5117, 511E, 51E7, 5E1E, 375E5, 511E7

b number of left-truncatable prime in base b largest left-truncatable prime in base b (written in base b) largest left-truncatable prime in base b (written in base 10) length of largest left-truncatable prime in base b number of right-truncatable prime in base b largest right-truncatable prime in base b (written in base b) largest right-truncatable prime in base b (written in base 10) length of largest right-truncatable prime in base b
2 0 (not exist) (not exist) 0 0 (not exist) (not exist) 0
3 3 212 1E 3 4 2122 5E 4
4 14 333323 244E 6 7 2333 13E 4
5 13 222232 4635 6 12 34222 14E1 5
6 31X 14141511414451435 661426663E7E 15 30 2155555 52EEE 7
7 1X 6642623 334EE5 7 17 25642 3E61 5
8 312 313636165537775 16X2480130191 13 58 21117717 160X77E 8
9 90 4284484465 3X9537995 X 58 3444224222 31X099985 X
X 2570 357686312646216567629137 793709X9407881E4128241 20 6E 73939133 20918X25 8
E 63 X68822827 536290XE5 9 75 29668286XX 1390726X5E X
10 824E1 471X34X164259EX16E324XE8X32E7817 471X34X164259EX16E324XE8X32E7817 28 12E 375EE5E515 375EE5E515 X
11 84 10:10:4:10:8:10:6:5 1X823237E 8 128 E:6:10:2:10:X:8:X:8:X 1E85596E165 X
12 17XX1 11:9:6:7:10:10:11:6:3:3:8:8:5:2:2:6:1:9:8:8:3:X:7:11:2:3 4591525X0198E04X7X660699X877 22 307 2:11:11:3:5:E:9:11:3:9:9:3:9:5:E:3:11 2E36559295482X788E 15
13 54E9 6:10:6:10:2:10:12:2:10:12:12:12:X:4:8:2:6:12:6:4:2:E 5186597X1677107XX2E1517E 1X 271 7:2:4:2:4:12:4:2:12:12:12:8:12 880X51595EE12E 11
14 1423X 11:E:10:7:13:E:X:2:4:13:12:6:X:12:10:4:6:2:X:E:13:6:3:E:3 7E09X93310E0X498E00280X45X6E 21 2X6 3:E:9:E:13:3:1:9:E:11:5:1:13:13 11099X01E6E9313E 12
15 262 6:10:6:6:10:10:4:10:10:8:3 1630884157X25 E 335 5:14:4:10:12:12:8:12:10:6:8:8:10:X:10:8:6:14 135147E8XX56205450635 16
16 5024996 X:13:9:3:12:4:1:X:5:8:6:15:12:7:5:X:7:15:15:X:X:E:7:15:12:1:2:13:14:7:9:9:9:2:14:X:7:7:4:1:E:3:11 765EXE402572XX6E757046320X22E783X13365714347753E87 37 59E 11:15:1:7:15:E:7:E:E:11:7:5:E:11:E 24341127775322X9E5 13
17 491 10:16:12:14:8:6:14:10:12:X:2:10:6:15 2E550920XE5526817 12 702 3:12:10:8:14:16:8:14:16:10:16:12:14:8:10 143700133681E49111 13
18 1038617 13:10:7:7:7:14:3:10:14:1:13:16:11:16:9:16:3:1:16:12:5:13:13:E:3:7:9:10:7:X:3:13:6:12:13:16:11 363143250967163301X2226000E200380767777X92345 31 XE5 2:3:15:E:15:9:11:1:9:15:15:9:17:11:11:17:9 460103753234533E0731 15
19 2X277 14:8:X:14:14:2:14:10:X:8:10:X:18:4:18:6:8:14:12:X:4:14:2:18:2:2:15 E551526354X9XX5293783548E81X07E95 23 1393 3:8:2:4:X:4:14:14:X:4:X:14:8:2:18:18:X:8 2264904E9048E30833X33E 16
1X 651733 13:13:15:X:19:10:8:17:13:E:9:17:18:X:2:X:15:9:13:X:E:4:16:9:19:5:16:9:19:3:14:13:8:11:5:19:5 91681801X875X86E51X11859549837X073419274499167 31 1794 5:15:9:7:5:13:13:19:19:17:13:3:15:19:3:13:3:3:13:3 2404E5192922E43112X244E81 18
1E 964 16:1X:1X:14:1X:6:10:6:16:1X:10:16:6:6:X:4:15 2648596177401EX0166371 15 102X 11:12:18:6:16:10:10:12:8:12:12:2:18:2:6 5E386X9X43988E6207E 13
20 2543X5599 15:1X:17:12:17:13:X:3:X:7:1:11:16:11:9:1X:13:1X:1E:13:12:3:11:3:18:17:15:X:6:1:18:15:9:2:16:13:10:X:3:19:E:8:14:13:4:4:4:13:E:E:7:X:15 52E709723848X6E730956E195160XX7E9E691042E79167X646059723735089336595 45 1E54 3:E:5:17:5:1:1:15:5:1E:17:1E:1E:5:5:E:7:17:11:E:1E:1E:7:15 98E15195841925044X615743EEE935 20