login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the number of prime digits used in writing out all primes up to and including the n-th prime.
0

%I #17 Apr 11 2019 21:33:09

%S 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,

%T 25,26,26,27,29,30,32,33,33,34,36,37,38,40,41,41,41,42,43,43,44,47,50,

%U 52,55,57,58,60,63,65,66,68,71,72,74,76,78,79

%N a(n) is the number of prime digits used in writing out all primes up to and including the n-th prime.

%e 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.

%t With[{s = IntegerDigits[Prime@ Range@ 64]}, Array[Count[Flatten[s[[1 ;; #]] ], _?PrimeQ] &, Length@ s]] (* _Michael De Vlieger_, Mar 27 2019 *)

%o (PARI) a(n) = sum(k=1, prime(n), if (isprime(k), #select(x->isprime(x), digits(k)))); \\ _Michel Marcus_, Mar 23 2019

%Y Partial sums of A109066. Cf. A068670.

%K nonn,base

%O 1,2

%A _Lekraj Beedassy_, Mar 15 2019