|
|
A193238
|
|
Number of prime digits in decimal representation of n.
|
|
16
|
|
|
0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 0, 0, 1, 1, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,23
|
|
LINKS
|
|
|
FORMULA
|
a(n) = sum_{j=1..m+1} (floor(n/10^j+0.3) + floor(n/10^j+0.5) + floor(n/10^j+0.8) - floor(n/10^j+0.2) - floor(n/10^j+0.4) - floor(n/10^j+0.6)), where m=floor(log_10(n)), n>0.
a(10n+k) = a(n) + a(k), 0<=k<10, n>=0.
a(n) = a(floor(n/10)) + a(n mod 10), n>=0.
a(n) = sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
a(A046034(n)) = floor(log_4(3n+1)), n>0.
a(A211681(n)) = 1 + floor((n-1)/4), n>0.
G.f.: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j) + x^(3*10^j)+ x^(5*10^j) + x^(7*10^j))*(1-x^10^j)/(1-x^10^(j+1)).
Also: g(x) = (1/(1-x))*sum_{j>=0} (x^(2*10^j)- x^(4*10^j)+ x^(5*10^j)- x^(6*10^j)+ x^(7*10^j)- x^(8*10^j))/(1-x^10^(j+1)). (End)
|
|
MATHEMATICA
|
Count[IntegerDigits[#], _?PrimeQ]&/@Range[0, 100] (* Harvey P. Dale, Nov 13 2022 *)
|
|
PROG
|
(Haskell)
a193238 n = length $ filter (`elem` "2357") $ show n
|
|
CROSSREFS
|
Cf. A211681, A046034, A052382, A055640, A055641, A055642, A102669 - A102685, A122640, A117804, A196563, A196564.
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|