The even part
of a positive integer
is defined by
where is the exponent
of the exact power of 2 dividing
. The values for
, 2, ..., are 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, ... (OEIS
A006519). The even part function can be implemented
in the Wolfram Language as
EvenPart[0]:=1 EvenPart[n_Integer]:=2^IntegerExponent[n,2]