%I #19 Oct 12 2019 08:34:11
%S 1,0,1,2,1,2,1,0,3,0,1,2,1,2,1,4,1,2,1,4,3,2,1,4,5,0,1,4,1,4,1,0,3,0,
%T 5,6,1,2,1,0,1,6,1,2,3,2,1,4,7,0,1,4,1,2,1,4,3,0,1,4,1,2,1,8,5,2,1,2,
%U 3,4,1,8,1,0,5,2,3,4,1,8,9,0,1,6,1,2,1
%N a(n) is the maximal value of the expression d AND (n/d) where d runs through the divisors of n and AND denotes the bitwise AND operator.
%H Rémy Sigrist, <a href="/A328176/b328176.txt">Table of n, a(n) for n = 1..16384</a>
%H Rémy Sigrist, <a href="/A328176/a328176.png">Scatterplot of the first 2^16 terms</a>
%F a(n)^2 <= n with equality iff n is a square.
%F a(n) = 1 for any odd prime number p.
%F a(n) <= A327987(n).
%F a(n) = 0 iff n belongs to A327988.
%e For n = 12:
%e - we have the following values:
%e d 12/d d AND (12/d)
%e -- ---- ------------
%e 1 12 0
%e 2 6 2
%e 3 4 0
%e 4 3 0
%e 6 2 2
%e 12 1 0
%e - hence a(12) = max({0, 2}) = 2.
%p a:= n-> max(map(d-> Bits[And](d, n/d), numtheory[divisors](n))):
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Oct 09 2019
%o (PARI) a(n) = vecmax(apply(d -> bitand(d, n/d), divisors(n)))
%Y See A328177 and A328178 for similar sequences.
%Y Cf. A327987, A327988.
%K nonn,base
%O 1,4
%A _Rémy Sigrist_, Oct 06 2019