cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A079806 Number of even numbers that can be formed by permuting the digits of n.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Feb 06 2003

Keywords

Comments

Leading zeros are allowed. - Robert Israel, Aug 27 2025

Examples

			a(246) = 6 (the numbers are 246,264,426,462,624,642). a(384) = 4 (the numbers are 384,348,438,834).
		

Crossrefs

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