OFFSET
0,3
COMMENTS
There is only one 2 in the sequence, so if the value 2 is blanked out, a riddle is created that demands some out-of-the-box thinking.
EXAMPLE
1 is neither prime nor even so a(1) = 0 + 0 = 0.
2 is both a prime and even so a(2) = 1 + 1 = 2.
3 is a prime but odd so a(3) = 1 + 0 = 1.
4 is not a prime but even so a(4) = 0 + 1 = 1.
MATHEMATICA
a[n_] := Boole[PrimeQ[n]] + Boole[EvenQ[n]]; Array[a, 100, 0] (* Amiram Eldar, Mar 31 2024 *)
PROG
(Python)
from sympy import isprime
def A370482(n): return isprime(n)+(n&1^1) # Chai Wah Wu, Apr 25 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jens Ahlström, Mar 31 2024
STATUS
approved