OFFSET
0,21
COMMENTS
Leading zeros are allowed. - Robert Israel, Aug 27 2025
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
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
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Feb 06 2003
EXTENSIONS
More terms from Harvey P. Dale, Jul 25 2020
STATUS
approved
