login
A079806
Number of even numbers that can be formed by permuting the digits of n.
2
1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 1, 2, 1
OFFSET
0,21
COMMENTS
Leading zeros are allowed. - Robert Israel, Aug 27 2025
LINKS
EXAMPLE
a(246) = 6 (the numbers are 246,264,426,462,624,642). a(384) = 4 (the numbers are 384,348,438,834).
MAPLE
f:= proc(n) local L, T, m, x, i, j;
L:= convert(n, base, 10);
for i from 0 to 9 do T[i]:= numboccur(i, L) od;
m:= nops(L);
x:= 0;
for i in [0, 2, 4, 6, 8] do
if T[i] > 0 then x:= x + (m-1)!/(T[i]-1)!/mul(T[j]!, j={0$9} minus {i}); fi;
od;
x
end proc;
map(f, [$0..100]); # Robert Israel, Aug 27 2025
MATHEMATICA
Table[Count[FromDigits/@Permutations[IntegerDigits[n]], _?EvenQ], {n, 0, 120}] (* Harvey P. Dale, Jul 25 2020 *)
CROSSREFS
Sequence in context: A133162 A276172 A322028 * A342845 A045887 A056832
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Feb 06 2003
EXTENSIONS
More terms from Harvey P. Dale, Jul 25 2020
STATUS
approved