OFFSET
0,1
COMMENTS
The number of direct decimal descendants (i.e., decimal children) of n is A038800(n). The number of prime decimal descendants of the n-th prime is A214342(p_n). a(n) is the number of prime decimal descendants of n, which include the prime decimal children of n, the prime decimal children of the prime decimal children of n, and so on.
Conjecture 1: a(n) <= 83. Conjecture 2: lim_{n->oo} (n0/n) = 1, where n0 is the number of zero terms, a(k) = 0, for k <= n.
EXAMPLE
a(4) = 23. The 23 prime decimal descendants of 4 are shown in the tree below.
_____ 4__________________________
/ | \
41 ___43______________ 47
/ / | \ \
419 431 433 439 479
/ \ / \ / \
4337 4339 4391 4397 4793 4799
/ | \ | | / \
43391 43397 43399 43913 43973 47933 47939
|
439133
|
4391339
MATHEMATICA
Table[Length@Rest@Flatten[FixedPointList[(b=#; Select[Flatten[(a=#; FromDigits/@(Join[IntegerDigits@a, {#}]&/@If[b=={0}, Range@9, {1, 3, 7, 9}]))&/@b], PrimeQ])&, {n}]], {n, 0, 76}] (* Giorgos Kalogeropoulos, Aug 16 2021 *)
PROG
(Python)
from sympy import isprime
def p_count(k):
global ct; d = [2, 3, 5, 7] if k == 0 else [1, 3, 7, 9]
for i in range(4):
m = 10*k + d[i]
if isprime(m): ct += 1; p_count(m)
return ct
for n in range(100):
ct = 0; print(p_count(n))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ya-Ping Lu, Aug 09 2021
STATUS
approved