login
A392157
a(n) is the number of prime-to-prime deletion paths from prime(n) to a one-digit prime, where at each step exactly one decimal digit is removed and the resulting number, interpreted without leading zeros, is prime.
2
1, 1, 1, 1, 0, 1, 1, 0, 2, 1, 1, 2, 0, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 0, 1, 0, 2, 2, 0, 2, 1, 2, 4, 1, 0, 0, 1, 1, 2, 4, 2, 0, 0, 1, 2, 0, 0, 4, 0, 2, 4, 3, 0, 0, 0, 2, 1, 1, 0, 0, 3, 3, 3, 2, 2, 4, 2, 4, 3, 0, 2, 1, 3, 4, 3, 1, 0, 3, 0, 0, 0, 0, 2, 2, 1, 2, 0, 1
OFFSET
1,9
FORMULA
a(n) <= floor(log_10(prime(n)) + 1)!.
a(n) = 0 if prime(n) is not a term of A118950.
EXAMPLE
a(1) = 1 since prime(1) = 2 is already a one-digit prime.
a(27) = 2 since prime(27) = 103. Deleting one digit yields 03, 13, 10; ignoring leading zeros and nonprimes, the prime continuations are 3 and 13. From 13, a further deletion gives 3; from 3, the path already terminates. Hence there are two prime endpoints in total (both 3).
a(33) = 4 since prime(33) = 137. Deleting one digit yields 37, 17, 13, all prime. Deleting again gives {3, 7} from 37, {1, 7} from 17, and {1, 3} from 13; among these, the primes are 3, 7, 7, 3, for a total of four.
a(36) = 0 since prime(36) = 151. Deleting one digit yields 51, 11, 15; only 11 is prime. Deleting again from 11 yields 1 and 1, which are not prime, so no path reaches a one-digit prime.
MAPLE
A392157 := proc(n) local b, i, k, l, p; b := proc(x) local d, j; d := ListTools:-Reverse(convert(x, 'base', 10)); `if`(nops(d) = 1, x, [seq(select(isprime, map(k -> foldl((x, y) -> 10*x + y, 0, op(k)), [seq(subsop(j = NULL, d), j = 1 .. nops(d))])))]); end proc; p := [ithprime(n)]; l := length(op(p)); while 1 < l do k := [seq(op(b(i)), i in p)]; p := k; l := l - 1; end do; return nops(select(isprime, p)); end proc: seq(A392157(n), n = 1 .. 88);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Huber, Jan 20 2026
STATUS
approved