KTUGFaq

KTUG FAQ

·Î±×ÀÎ:
ºñ¹Ð¹øÈ£:
°¡ÀÔ
You will be awarded some great honor.
FrontPage › LittleTree/ReadingTeXbook/2006-09
Nov 24, 2006
Armstrong Numbers
Submitted by ÀÛÀº³ª¹« @ 11-24 [11:37 pm]
Pluperfect DigitalInvariants(PPDI) ȤÀº Armstrong Numbers ¶ó°í ºÒ¸®´Â ¼öµéÀÌ ÀÖ½À´Ï´Ù. ´ÙÀ½ÀÌ ¹Ù·Î ±×·¯ÇÑ ¼öµéÀε¥,



Àß »ìÆ캸¸é Àç¹ÌÀִ Ư¼ºÀÌ ÀÖ½À´Ï´Ù. 153À» ¿¹¸¦ µé¾î ¼³¸íÇϸé, 153Àº ¼¼ÀÚ¸® ¼öÀ̸ç, °¢ ÀÚ¸®¼ö¸¦ ¼¼Á¦°öÇÏ¿© ¸ðµÎ ´õÇÏ¸é ¿ø·¡ÀÇ ¼öÀÎ 153ÀÌ µÇ´Â °ÍÀÔ´Ï´Ù. ´Ù¸¥ ¸ðµç ¼öµéµµ ¸¶Âù°¡ÁöÀÔ´Ï´Ù. :)

PPDI ¸ð¾çÀ» ¸¸µé¾îÁÖ´Â TeX ¸ÅÅ©·Î¸¦ ¸¸µé¾î º¸¾Ò½À´Ï´Ù. ¿À·£¸¸¿¡ ÀÛÀº³ª¹«ÀÇ ¾Ö¿ë(?) ¸ÅÅ©·ÎÀÎ \fifo ... \ofif¸¦ ÀÌ¿ëÇß½À´Ï´Ù.

\newcount\cnt \newcount\length \def\fifo#1{\ifx\ofif#1\ofif\fi \process#1\fifo} \def\ofif#1\fifo{\fi} \def\ppdi#1{\cnt=0 \def\process##1{\advance\cnt by1 } \fifo #1\ofif \length=\cnt \def\process##1{\advance\cnt by-1 ##1^{\number\length}\ifnum\cnt>0 +\fi } $#1 = \fifo #1\ofif$}

À§¿Í °°Àº \ppdi ¸ÅÅ©·Î¸¦ Á¤ÀÇÇÏ°í \ppdi{153} Çϸé 153¿¡ ÇØ´çÇÏ´Â PPDI ¸ð¾çÀÌ ¸¸µé¾î Áý´Ï´Ù. Âü°í·Î °¡Àå ±ä ¼ö´Â ±× ÀÚ¸®¼ö°¡ 39ÀÚ¸®³ª µÇ´Â ¼öÀÔ´Ï´Ù. ¾Æ·¡ÀÇ µÎ ¼öÀÔ´Ï´Ù.

115132219018763992565095597973971522400 115132219018763992565095597973971522401

±×·³ ÇÑ ¹ø »ìÆ캼±î¿ä? :)



Nov 17, 2006
¿¬ºÐ¼ö ¸ÅÅ©·Î
Submitted by ÀÛÀº³ª¹« @ 11-17 [11:51 am]
218~219ÂÊ: Âü, ¿À·£¸¸¿¡ Àû¾îº¾´Ï´Ù. ¿äÁò ÅØ°øºÎ°¡ Á» ¶äÇÑ °ü°è·Î... :)

ÃÖ±Ù¿¡ ¿ì¿¬È÷ ¿¬ºÐ¼ö(continued fraction)À̶ó´Â °ÍÀ» ¾Ë°ÔµÇ¾î¼­ ÅØÀ¸·Î ¸ÅÅ©·Î¸¦ ¸¸µé¾îº¸¸é Àç¹Õ°Ú´Ù ½Í¾î¼­ ÀÛ¼ºÇغýÀ´Ï´Ù. ²¿¸® Àç±Í(tail recursion)¸¦ ÀÌ¿ëÇÕ´Ï´Ù. óÀ½¿¡´Â ÀúÀÇ ºí·Î±×¿¡ Àû¾ú´Âµ¥, ±×°÷º¸´Ù´Â ¿©±â°¡ Àû´çÇÏ´Ù ½Í¾î¼­ ¿Å±é´Ï´Ù.

\newcount\m % ºÐÀÚ \newcount\n % ºÐ¸ð \newcount\t % t = m % n \newcount\s % s = m / n \def\cf#1#2{\m=#1 \n=#2 \t=\m \divide\m by\n \s=\m \multiply\m by\n \advance\t by-\m \number\s \ifnum\t>0+{\strut1\hfill\over\displaystyle\cf\n\t}\fi} \def\cfrac#1#2{{#1\over#2}=\cf{#1}{#2}}
¾Æ·¡¿Í °°ÀÌ »ç¿ëÇÕ´Ï´Ù.

$$\cfrac{421}{73}$$ $$\cfrac{103}{24}$$



Sep 01, 2006
¾ûÅ͸®Áö¸¸ µ¿ÀÛÇÑ´Ù
Submitted by ÀÛÀº³ª¹« @ 09-01 [12:00 pm]
213ÂÊ: \expandafter

1ºÎÅÍ \n ±îÁöÀÇ ÇÕÀ» ±¸ÇÏ´Â ·çƾÀÔ´Ï´Ù.




\loop...\repeat ¶Ç´Â Àç±Í¹®À» »ç¿ëÇÏÁö ¾Ê°í º¯¼ö¸¦ 1°³¸¸ »ç¿ëÇÏ´Â ·çƾÀ» ¸¸µå·Á°í Çغ¸¾Ò´Âµ¥, ¾ûÅ͸® ÄÚµåÁö¸¸ µ¿ÀÛÇÕ´Ï´Ù. ÀÌ»óÇÕ´Ï´Ù.

\newcount\n \def\square{\multiply\n\n} \def\divtwo{\divide\n2} \def\summation#1{\n=#1 \def\add{\advance\n#1} \expandafter\expandafter\expandafter\square\expandafter\add\divtwo The sum from 1 to #1 is \number\n.} \summation{97} \summation{98} \summation{99} \summation{100}
°á°ú




expandafter¸¦ ³²¹ßÇÔÀ¸·Î½á °ñ¸Ó¸®¸¦ ½â°Ô ÇÏ°í ¹Î½ÉÀ» ÈäÈäÇÏ°Ô ÇÑ Çã¹°, °áÄÚ °¡º±´Ù ÇÒ ¼ö ¾øÀ¸¸®¶ó »ç·áµË´Ï´Ù.^^ expandafter¸¦ ½Ï °È¾î³»°í ÄÄÆÄÀÏÇØ ºÃ´õ´Ï ¾ó·¹~ °á°ú´Â µ¿ÀÏÇÏ´õ±º¿ä -.-;; -- DohyunKim 2006-09-01 14:12:59

±×·¯´Ï ÀÌ»óÇϴٴ°Š¾Æ´Õ´Ï±î...^^; À§¿¡ »ç¿ëÇÑ ¹æ½ÄÀÌ Ã¥´ë·Î¶ó¸é Àü°³ ¼ø¼­¸¦ ¿ªÀ¸·Î ÇÑ´Ù´Â °Çµ¥¿ä... ÀÌ°Å ¹¹ À߸øµÈ°Å ¾Æ´Ñ°¡¿ä? ¤¾¤¾¤¾ -- ÀÛÀº³ª¹« 2006-09-01 15:08:40

TeXbyTopic 12.3.1À» º¸¸é °³³äÀÌ ³ª¿ÍÀÖ½À´Ï´Ù. One step expansion: \expandafter -- DohyunKim 2006-09-01 16:14:17

¾Æ... Á¦°¡ ÀÌÇØ·ÂÀÌ ¶³¾îÁ®¼­ ¾öû³­ Âø°¢À» ÇÏ°í ÀÖ´ø°Í °°½À´Ï´Ù... Àü°³(expansion) ¼ø¼­¸¸ ¹Ù²î´Â °ÍÀÌ°í, ½ÇÇàµÇ´Â ¼ø¼­´Â À¯ÁöµÇ´Â °ÍÀ̱º¿ä. ¾ðÁ¦³ª ÀÌó·³ À߸øµÈ °ÍÀ» ÁöÀûÇØÁֽðí ÇÑ ¼ö °¡¸£ÃÄÁּż­ °¨»çÇÏ°Ô »ý°¢ÇÏ°í ÀÖ½À´Ï´Ù. -- ÀÛÀº³ª¹« 2006-09-01 16:32:46