%I #17 Feb 23 2019 21:56:08
%S 111111,111122,111133,111144,111155,111212,111221,111222,111313,
%T 111331,111333,111414,111441,111444,111515,111551,111555,112112,
%U 112121,112122,112211,112212,112221,112222,112233,112244,112255,112323,112332,112424,112442,112525,112552
%N 6-digit numbers k such that: (a) the digits of k are from the set {1, 2, 3, 4, 5}, and (b) any digit that appears in k appears at least twice.
%C See Problem 4 of RMO 2007 (Regional Mathematical Olympiad-India).
%C There are exactly 1405 such numbers from 111111, 111122,... to ..., 555544, 555555.
%H Nathaniel Johnston, <a href="/A171725/b171725.txt">Table of n, a(n) for n = 1..1405</a> (full sequence)
%H |nSan|ty, <a href="http://www.artofproblemsolving.com/Forum/viewtopic.php?p=942695">RMO 2007 problem</a>
%p A171725:={}: for n from 9331 to 46655 do d:=convert(n,base,6): for k from 0 to 5 do cordig:=true: if((k=0 and numboccur(k,d)>0) or (k>0 and numboccur(k,d)=1))then cordig:=false:break: fi: od: if(cordig)then A171725 := A171725 union {op(convert(d,base,10,10^nops(d)))}: fi: od: op(sort(convert(A171725,list))); # _Nathaniel Johnston_, Jun 24 2011
%t cc=0;re=Reap[Do[dc=DigitCount[n];If[Take[dc,{6,10}]=={0,0,0,0,0}&&FreeQ[Take[dc,5],1],cc++;Sow[n]],{n,111111,555555}]][[2,1]];cc
%K base,fini,full,nonn
%O 1,1
%A _Zak Seidov_, Dec 16 2009
|