Returns the list of truncated primes >>> compute_truncated_primes(11) [23, 37, 53, 73, 313, 317, 373, 797, 3137, 3797, 739397]
(count: int = 11)
| 92 | |
| 93 | |
| 94 | def compute_truncated_primes(count: int = 11) -> list[int]: |
| 95 | """ |
| 96 | Returns the list of truncated primes |
| 97 | >>> compute_truncated_primes(11) |
| 98 | [23, 37, 53, 73, 313, 317, 373, 797, 3137, 3797, 739397] |
| 99 | """ |
| 100 | list_truncated_primes: list[int] = [] |
| 101 | num = 13 |
| 102 | while len(list_truncated_primes) != count: |
| 103 | if validate(num): |
| 104 | list_nums = list_truncated_nums(num) |
| 105 | if all(is_prime(i) for i in list_nums): |
| 106 | list_truncated_primes.append(num) |
| 107 | num += 2 |
| 108 | return list_truncated_primes |
| 109 | |
| 110 | |
| 111 | def solution() -> int: |