OFFSET
1,3
COMMENTS
p is bitwise covered by n iff (p = (n AND p)) bitwise: A080099(n,p)=p.
LINKS
FORMULA
a(2^k-1) = A007053(k) for k > 1. - Amiram Eldar, Jan 12 2020
EXAMPLE
n=21->10101 -> a(21) = #{00101=5,10001=17} = 2.
MATHEMATICA
a[n_] := Count[Range[n], _?(PrimeQ[#] && BitAnd[n, #] == # &)]; Array[a, 100] (* Amiram Eldar, Jan 12 2020 *)
PROG
(Magma) [#[p:p in PrimesUpTo(n)| p eq BitwiseAnd(n, p)] :n in [1..105] ]; // Marius A. Burtea, Jan 12 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Dec 30 2004
STATUS
approved