All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
All Combos (Posted on 2024-05-08) Difficulty: 3 of 5
N is a positive integer such that N! expressed in decimal contains:
(A) all of the digits 0 to 9
(B) all of the 2-digit combinations 00, 01, ..., 99
(C) all of the 3-digit combinations 000, 001, ..., 999

Find the smallest value of N in conformity with the given conditions.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution Comment 2 of 2 |
clc
f=sym(factorial(10));
hadA=false; hadB=false; hadC=false;
for n=11:3000
  f=f*n;
  fs=char(f);
  good=true;
  for s='0':'9'
    if isempty(strfind(fs,s))
      good=false;
      break
    end
  end
  if good
    if ~hadA
      hadA=true;
      disp('A')
      disp(n)
      show(fs)
    end
    for s2=0:99
      ss=sprintf('%02d',s2);
      if isempty(strfind(fs,ss))
        good=false;
        break
      end
    end
    if good
      if ~hadB
        hadB=true;
        disp('B')
        disp(n)
        show(fs)
      end
      for s3=0:999
        ss=sprintf('%03d',s3);
        if isempty(strfind(fs,ss))
          good=false;
          break
        end
      end
      if good
        if ~hadC
          hadC=true;
          disp('C')
          disp(n)
          show(fs)
        end
      end
    end
  end
end

function show(st)
  s=st;
  while length(s)>0
    if length(s)> 100
      fprintf('%s\n',s(1:100));
      s=s(101:end);
    else
      fprintf('%s\n',s);
      s='';
    end
  end
end

finds

For each part, A, B, C,  the next line shows n, and the following lines show n! grouped in 100's of digits.

A
    23
25852016738884976640000
B
   220
2283860335914641457397265865115333727042973071546228701773634716126027692603024845877776549791921102
9457065581960747795750095505232241970499561769723020565876672261660609763234049775547325430135571331
4682574755379945084952337706589453102105527251633427846687561490492136580783384585342855715518008495
7884822642989867003294551385992993862178352349027264696691854493614080000000000000000000000000000000
0000000000000000000000
C
        2091
6453647207164872565259261264041988174043765044695538651610445460566555780901088962128978580212121661
9361143171488085902614904394460589939665801286556044421568385902411295536222227342444554495045335593
9184377150767020860219792816074007403794465945873555739796143482546774772714617294204214979529989572
4445342502518521646090510766147337079088153321045830014690658657083104378674947802930809464129635250
4138841282545716762905888393983751206801624455767497267582660963187994431846098264391584912249511846
4095077496443858448981223960890402194152379279383602299974110417059820673047832798880141944771970758
0587032770260472241382167869068974528198172775582352848259828138921863865067195190808040939231195566
5998650961880796504837386106658237806834766454544761554640225181238396752519146658018987254154978329
4928487001788437385388796917389505419521038787703879311726301719958812742165642754707208892125697143
1124196297551858008452715310970410057498183042619425363620660078286355385582217338623118298443719405
0059919362798742065340717500791352729885941350081042768070712757305707928878242813798121344550439198
3905180726197190541209736291670107101441643519461838476608126443899867647560916303001587358756639073
8365930595880752376238789114835265427841767912305326483910017917276033605434170663488679353060378152
8649224857842934789225019054424246538968113131883786885516779963013861402099011428107097325364093402
6930037025677676137294031141564843375932233918736339426636165708959303296311236847987398945135522011
8540188939274525628984075910131124906927990098457384952222030680494915158905494306713000249128146058
5427212816736735131857138460425875331661997143023198664141092517111066747952160694874712144477213636
5927718789954596413499591289053706677409195923958051956866271562233951699519712060457740494196909185
8807174191131959385459634122935682448462082975393470797494581774800335426950511680494069523146172856
7775604546439243214626382271533290753193582677516647924895258839995200528311496300996784090111514435
2084774880504859312626410558446257532212082149672898044439599238452953346789442916182291613984237237
5961625195216419386310153328367980989567548029469381514628222009574329004966668212783615573861413584
9933866647699567583811582206403861130725526060217542093013858160516747338317652110595163225629771319
7269715800706224648195630691430521476369548806767986754508330491436707083525984002570236522277568137
4750224554954528291330921845499720751247376399036626897943472392191919310115068526355149143935574534
6033492709211928381500350024190617119133453356196781539786092276562100248249581229086959216257332010
0822884515707122437016840803479003946315163110688853427967175441973019392400297192902833293677523704
2471936320493886473249909837236379319761893462103607791236266728725741300014011460335716603405621805
0349938816428163288183732077248568283007277872903752715265443187079948766720013251208715422422951096
8311794736980656072467221374654378581759982854247563104426106937671722410227619303096447980768607688
7111642575888623791964562261785503223992888765687847518946160918588023719108913274474446055795866163
1715548732916632994756092365394245643965246114897472266829283156046329349000956572009303349664540403
1329318776825485539171686834368262187146432706892736534448869692010638747945993419022318458064628123
5668602110154719415097922455005140023710799829584349582022682588826188914640291124451506567609892619
0089082345150976126943131636633205284887313263907813537864772049758462973343998068875612543523849410
9019546623097999028376127235846953251583958558573057923417103371091404520424208625516575504585863215
2056653829815001222009044479704364101779038010796373760496895150866967303339558807478579182307177073
0106305182746387244997249261031422671877287557782162794088614228051679825409338386787067339381427836
5925922902775153646837917032614205617526264367059143561391155564868617668821830073078832120395874450
9868282410678580780932397853674832629758438006892770920774035398212521747280290950387664917449622088
6049463140459004322704561597989473922921450166505973355568621606193486286839792220026909376499831905
1518348122077909270451775894761079281276318259628244212891705123704484370325262904995543623964226580
9776661277976317846365001067059284420675662398034286388003144438899503138945855595140903426038208943
0553632005299781856562070898936319111471087200647024573741589742404915180844573142833220383320678586
7846485052459150150103080070903200352298299115493305716764238535829583582970556505766649443521796381
3588403069800460488358845334097856345034514205397791865515715485342073337672239099597717210367872374
1566955295123057065237773951407479126567731959893464867218247697237393535439372121825118859735074426
6597781341232509607695743085428971731884455144170956680279152219032266400002427921990675542508036352
5926159673382428067771579123049200936881910000455624965956536899108989177568372308342488151868584570
3356608572392959932117554580830917799659363757751013419169269666844596812697782138218615032065418187
7765429351131438916715291472068010511296739072074711996537945051586741373397325046329050956001879359
2536486133616496747367491221939860202942078586249681449263367663118131837216468649301868672162462607
6983123440786602342581124546760319105929260873921928358578257155890716768149168211388319185968727780
1985975722265280096949325187766072248269009960184034263729366682356136888950653141085163556044027797
8960931066628445526046708313081985528615307934870354631797457361510302450659322539553748896916512292
2683239017060761600000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000


  Posted by Charlie on 2024-05-08 09:17:31
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information