A306890 a(n) is the number of prime digits used in writing out all primes up to and including the n-th prime.
1, 2, 3, 4, 4, 5, 6, 6, 8, 9, 10, 12, 12, 13, 14, 16, 17, 17, 18, 19, 21, 22, 23, 23, 24, 24, 25, 26, 26, 27, 29, 30, 32, 33, 33, 34, 36, 37, 38, 40, 41, 41, 41, 42, 43, 43, 44, 47, 50, 52, 55, 57, 58, 60, 63, 65, 66, 68, 71, 72, 74, 76, 78, 79
Offset: 1
Examples
We have a(10) = 9 since all primes up to the 10th (2, 3, 5, 7, 11, 13, 17, 19, 23, 29) use the 9 prime digits 2, 3, 5, 7, 3, 7, 2, 3, 2.
Programs
-
Mathematica
With[{s = IntegerDigits[Prime@ Range@ 64]}, Array[Count[Flatten[s[[1 ;; #]] ], ?PrimeQ] &, Length@ s]] (* _Michael De Vlieger, Mar 27 2019 *)
-
PARI
a(n) = sum(k=1, prime(n), if (isprime(k), #select(x->isprime(x), digits(k)))); \\ Michel Marcus, Mar 23 2019