A202238 Characteristic function of positive integers not prime and not a power of 2.
0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1
Offset: 1
Links
Programs
-
PARI
{a(n) = n>0 && !isprime(n) && n != 2^valuation(n, 2)}
-
Python
from sympy import isprime def A202238(n): return int(not isprime(n) and bool((n&-n)^n)) # Chai Wah Wu, Mar 11 2025
Formula
A111775(n) = 0 if and only if a(n) = 0.
A111787(n) = 0 if and only if a(n) = 0.
a(n) = 1 for n in A111774. - Michel Marcus, Aug 28 2017