login
Characteristic function of positive numbers that are primes ending in 3.
6

%I #18 Dec 10 2021 14:06:10

%S 0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,

%T 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

%U 0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0

%N Characteristic function of positive numbers that are primes ending in 3.

%H Antti Karttunen, <a href="/A185706/b185706.txt">Table of n, a(n) for n = 1..65539</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%t Array[Boole@ And[PrimeQ@ #, Mod[#, 10] == 3] &, 105] (* _Michael De Vlieger_, Dec 16 2017 *)

%t Table[If[PrimeQ[n]&&Mod[n,10]==3,1,0],{n,150}] (* _Harvey P. Dale_, Dec 10 2021 *)

%o (PARI) A185706(n) = ((3==(n%10))&isprime(n)); \\ _Antti Karttunen_, Dec 16 2017

%Y Characteristic function of A030431.

%Y Cf. A185709.

%K base,nonn

%O 1

%A _N. J. A. Sloane_, Feb 10 2011