OFFSET
1,1
COMMENTS
Even digits are 2, 4, 6 or 8 and prime digits are 2, 3, 5 or 7.
EXAMPLE
If prime(1)=2(even, prime), then 1+1=2=a(1). If prime(2)=3(0, prime), then 0+1=1=a(2). If prime(3)=5(0, prime), then 0+1+1=a(3). If prime(4)=7(0, prime), then 0+1=1+a(4). If prime(5)=11(0, 0), then 0+0=0=a(5), etc.
MAPLE
npris := proc(n) local dgs, a, i ; dgs := convert(n, base, 10) ; a := 0 ; for i in dgs do if isprime(i) then a := a+1 ; fi; od: a ; end: nevsnot0 := proc(n) local dgs, a, i ; dgs := convert(n, base, 10) ; a := 0 ; for i in dgs do if i mod 2 = 0 and i <> 0 then a := a+1 ; fi; od: a ; end: for n from 1 to 800 do p := ithprime(n) ; printf("%d, ", nevsnot0(p)+npris(p)) ; od: # R. J. Mathar, Feb 13 2009
MATHEMATICA
nepd[n_]:=Module[{p=IntegerDigits[Prime[n]]}, Count[p, _?EvenQ]+Count[ p, _?PrimeQ]]; Array[nepd, 120] (* Harvey P. Dale, Dec 09 2017 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Juri-Stepan Gerasimov, Feb 11 2009
EXTENSIONS
Corrected by Harvey P. Dale, Dec 09 2017
STATUS
approved