login
A156606
a(n)=number of even digits in prime(n) + number of prime digits in prime(n).
0
2, 1, 1, 1, 0, 1, 1, 0, 3, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 2, 1, 1, 3, 1, 2, 1, 1, 1, 2, 2, 2, 2, 1, 1, 0, 1, 1, 0, 2, 5, 5, 4, 4, 3, 3, 3, 4, 4, 3, 3, 4, 3, 4, 3, 3, 1, 2, 2, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 2, 2, 2, 2, 1, 3, 2, 3, 2, 3
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
Sequence in context: A053252 A261029 A117195 * A324606 A194087 A107034
KEYWORD
nonn,base,less
AUTHOR
EXTENSIONS
Corrected by Harvey P. Dale, Dec 09 2017
STATUS
approved