A079806 Number of even numbers that can be formed by permuting the digits of n.
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
Examples
a(246) = 6 (the numbers are 246,264,426,462,624,642). a(384) = 4 (the numbers are 384,348,438,834).
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Programs
-
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 *)
Extensions
More terms from Harvey P. Dale, Jul 25 2020
Comments