cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A193238 Number of prime digits in decimal representation of n.

This page as a plain text file.
%I A193238 #23 Nov 13 2022 16:16:45
%S A193238 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,
%T A193238 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,
%U A193238 0,0,1,1,2,2,1,2,1,2,1,1,0,0,1,1,0,1
%N A193238 Number of prime digits in decimal representation of n.
%H A193238 Reinhard Zumkeller, <a href="/A193238/b193238.txt">Table of n, a(n) for n = 0..10000</a>
%F A193238 a(A084984(n))=0; a(A118950(n))>0; a(A092620(n))=1; a(A092624(n))=2; a(A092625(n))=3; a(A046034(n))=A055642(A046034(n));
%F A193238 a(A000040(n)) = A109066(n).
%F A193238 From _Hieronymus Fischer_, May 30 2012: (Start)
%F A193238 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.
%F A193238 a(10n+k) = a(n) + a(k), 0<=k<10, n>=0.
%F A193238 a(n) = a(floor(n/10)) + a(n mod 10), n>=0.
%F A193238 a(n) = sum_{j=0..m} a(floor(n/10^j) mod 10), n>=0.
%F A193238 a(A046034(n)) = floor(log_4(3n+1)), n>0.
%F A193238 a(A211681(n)) = 1 + floor((n-1)/4), n>0.
%F A193238 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)).
%F A193238 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)
%t A193238 Count[IntegerDigits[#],_?PrimeQ]&/@Range[0,100] (* _Harvey P. Dale_, Nov 13 2022 *)
%o A193238 (Haskell)
%o A193238 a193238 n = length $ filter (`elem` "2357") $ show n
%o A193238 (PARI) a(n)=n=eval(Vec(Str(n)));sum(i=1,#n,isprime(n[i])) \\ _Charles R Greathouse IV_, Jul 29 2011
%Y A193238 Cf. A010051.
%Y A193238 Cf. A211681, A046034, A052382, A055640, A055641, A055642, A102669 - A102685, A122640, A117804, A196563, A196564.
%K A193238 nonn,base
%O A193238 0,23
%A A193238 _Reinhard Zumkeller_, Jul 19 2011