将123456789翻一倍,你会发现结果仍然是这9个数字的一个排列:
123456789 x 2 = 246913578
我们再次将246913578翻倍,发现:
246913578 x 2 = 493827156
结果依旧使用了每个数字各一次。操,没完了吗?我们继续翻倍:
493827156 x 2 = 987654312
牛B了,一个很有特点的数987654312,显然每个数字又只用了一次。
你或许会想,这下到头了吧,再翻倍就成10位数了。不过,请看:
987654312 x 2 = 1975308624
又使用了每个数字各一次,只不过这一次加上了数字0。再来?
1975308624 x 2 = 3950617248
恐怖了,又是每个数字各出现一次。
出现了这么多巧合之后我们开始怀疑,这并不是什么巧合,一定有什么简单的方法可以解释这种现象的。
但是,下面的事实让这个问题更加复杂了。到了第6次后,虽然仍然是10位数,但偏偏就在这时发生了一次例外:
3950617248 x 2 = 7901234496 <-- 第一次出现例外
于是,我们不得不相信,前面这一切很可能只是一个巧合,它背后并没有什么简单的原理。
即使有办法解释这种巧合,解释方法可能也很麻烦。寻找一个漂亮的解释是一个有趣的课题。

在没有Mathematica这种牛B东西的年代,我们用电脑做数学题时,电脑只能返回一长串的小数。但你那小数精确到多少位都没用,我们做作业总是要求最终结果是一个表达式的形式。于是,当时我就在想,计算器可以计算出一长串表达式的值,但有没有计算器可以根据足够精确的数值反过来推出表达式呢?
今天果然发现了这样一个牛B东西:在线反符号计算器(Inverse Symbolic Calculator, ISC)。输入足够多位的小数,它可以告诉你这个数是由什么表达式得到的。比如,你输入10.5916630466254391,系统会告诉你它是两倍根号23加1;输入1.8994432200976623351,系统会告诉你它是cos(1)的值加上e的一半;输入0.3732821739073952,系统会告诉你它是Γ(1/3)的倒数。它到底有多牛B呢?我试过一些比较复杂的式子。它竟然能准确地算出,11.1457467760047553180356168160是(2√2 + 1)/3 + π^2。
链接:http://ddrive.cs.dal.ca/~isc/standard.html
下面这道题来自今年的Virginia Tech Rigeonal数学比赛(不知道该咋翻好)。比赛时间为两个半小时,一共有7道题,这是第5题:
找出下面这个数小数点后第三位上的数字:(2+√5)^100 * ((1+√2)^100 + (1+√2)^(-100))
这个问题有趣的地方就是,你真的可以用一个简单的办法估算出答案来。为什么不先试试看?
我们需要求出(2+√5)^100 * ((1+√2)^100 + (1+√2)^(-100))小数点后第三位上的数。首先,(1+√2)^(-1)就等于(√2-1),而二项式展开后你会发现(√2 + 1)^(2n) + (√2 - 1)^(2n)总是一个整数(根号2的奇数次幂总是一正一负抵消)。同样地,((√5 + 2)^(2n) + (√5 - 2)^(2n)) * ((√2 + 1)^(2n) + (√2 - 1)^(2n))也是一个整数,于是(√5 + 2)^(2n) * ((√2 + 1)^(2n) + (√2 - 1)^(2n))和(√5 - 2)^(2n) * ((√2 + 1)^(2n) + (√2 - 1)^(2n))的小数部分是互补的(相加为1),我们可以依据后面这个数的小数部分来确定前面这个数(也即题目要求的数)的小数部分。而当n较大时,后面这个数很可能会变得非常小。事实上,当n=50时,
(√5 - 2)^100 * ((√2 + 1)^100 + (√2 - 1)^100)
< (√5 - 2)^100 * 2((√2 + 1)^100)
< (1/4)^100 * 2((5/2)^100)
= 2(5/8)^100
可以断定,这是一个非常非常小的数,小数点后面紧跟着的0至少有10个。这足以说明,题目里那个数的小数点后面十几位全部是9。事实上,
(2+√5)^100 * ((1+√2)^100 + (1+√2)^(-100))
= 94158733601034420664808450657998303298219601745567527892456021922994
873597395955752869490271254871747.9999999999999999999999996186915243
507242961564029332966750212181162222265977213142686546252118999....
小数点后一共有24个9。
本文来源:http://www.cut-the-knot.org/arithmetic/PowersOf10.shtml
在各种文明的算术发展过程中,乘法运算的产生是很重要的一步。一个文明可以比较顺利地发展出计数方法和加减法运算,但要想创造一套简单可行的乘法运算方法却不那么容易。我们目前使用的乘法竖式计算看似简便,实际上这需要我们事先掌握九九乘法口诀表;考虑到这一点,这种竖式计算并不是完美的。我们即将看到,在数学的发展过程中,不同的文明创造出了哪些不同的乘法运算方法,其中有的运算法甚至可以完全抛弃乘法表。
古巴比伦数学使用60进制,考古发现的一块古巴比伦泥板证实了这一点。这块泥板上有一个正方形,对角线上有四个数字1, 24, 51, 10。最初发现这块泥板时人们并不知道这是什么意思,后来某牛人惊讶地发现,如果把这些数字当作60进制的三位小数的话,得到的正好是单位正方形对角线长度的近似值:1 + 24/60 + 51/60^2 + 10/60^3 = 1.41421296296... 这说明古巴比伦已经掌握了勾股定理。60进制的使用为古巴比伦数学的乘法运算发展带来了很大的障碍,因为如果你要背59-59乘法口诀表的话,至少也得背1000多项,等你把它背完了后我期末论文估计都已经全写完了。另一项考古发现告诉了我们古巴比伦数学的乘法运算如何避免使用乘法表。考古学家们发现一些泥板上刻有60以内的平方表,利用公式ab = [(a+b)^2 - a^2 - b^2]/2 可以迅速查表得到ab的值。另一个公式则是ab = [(a+b)^2 - (a-b)^2]/4,这说明两个数相乘只需取它们的和平方与差平方的差,再两次取半即可。平方数的频繁使用很可能加速了古巴比伦人发现勾股定理的过程。
古巴比伦数学把除以一个数看作是乘以它的倒数,利用倒数表可以很方便的实现这种算法。倒数表开头的一部分是这个样子:
2 0; 30
3 0; 20
4 0; 15
5 0; 12
6 0; 10
8 0; 7, 30
9 0; 6, 40
10 0; 6
12 0; 5
15 0; 4
16 0; 3, 45
18 0; 3, 20
20 0; 3
.... ....
古巴比伦人很早就发现,1/7是一个无限小数,怎么除也除不完。古巴比伦的倒数表里所有的数都是精确的小数,它们(在60进制中)都是有限小数。碰到无限小数时,他们会用取近似值的方法来解决。例如,古巴比伦人会通过1/13 = 1*(1/13) = 7*(1/91) ≈ 7*(1/90) = 7*(40/3600) = (7*40)/3600 来计算1/13的值。那个40就是查倒数表查出来的。
古埃及数学使用了完全不同的乘法运算法。它们的乘法运算不需要借助任何辅助用表。古埃及人注意到,任何一个数都可以表示为若干个不同的2的幂的和。因此,你需要做的仅仅是不断将1和乘数进行翻倍。看看古埃及人如何计算46乘以22:
46 x 22 = 1012
1 22
2 44 44
4 88 + 88
8 176 + 176
16 352
32 704 + 704
-------
1012
上面的演算中,左列是1不断翻倍的结果,右边是22不断翻倍的结果。选出左列的2, 4, 8, 32,它们的和正好就是被乘数46;那么把右列对应的数加起来就是乘法运算的最终结果。至于如何选出2, 4, 8, 32这四个数,一个简单的方法就是,不断选出左列里小于被乘数的数中最大的一个,然后当前被乘数减去它。比如,32是最大的数,用46-32后剩14;8是小于14的最大数,14-8后剩6;然后最大的小于6的数是4,6减去4后剩2,这样下来2+4+8+32正好就是被乘数46了。这其实就是二进制的经典应用,2, 4, 8, 32正好与46的二进制中的数字1一一对应。你可以在这里看到一些相关的东西。
无独有偶,据说俄国农村曾产生过这样一种乘法算术法:将被乘数逐次减半,同时乘数依次加倍,那么找出所有左边的数是奇数的行,其右列的数的和就是答案。例如,下面的例子中,23, 11, 5和1都是奇数,于是右边对应的44, 88, 176和704的和就是乘法运算的结果。这个做法与古埃及的算术法完全一样,但看起来似乎更神奇一些。
46 x 22 = 1012
46 22
23 44 44
11 88 + 88
5 176 + 176
2 352
1 704 + 704
-------
1012
做人要厚道
转贴请注明出处

上图是一个非常牛的钟,钟面上的数字1到12全部是用数字9表示出来的,更绝的是每个算式恰好用了三个9 ! (反光处很可能写的是(9/9)^9 )
当然,这种事并不只有数字9能够做出来。比如,只使用三个4也可以构造出12以内的自然数:
1 = (√4 + √4)/4 = (√4*√4)/4
2 = (4 + 4)/4
3 = 4 - 4/4
4 = 4 + 4 - 4 = 4*4/4
5 = 4 + 4/4
6 = 4 + 4/√4
7 = 4!! - 4/4
8 = 4!! + 4 - 4
9 = 4!! + 4/4
10 = (√4 + √4)/.4 = 4!! + 4/√4
11 = 44/4
12 = 4 + 4 + 4 = 4*4 - 4
Ambigram
Ambigram是指把一个单词或短语写成对称的样子,这样从两个不同的角度看这个图形都能读出这个单词或短语。例如,下面一个图形就是单词Ambigram的Ambigram:

ambigram.com的首页有个这样的图片:

Wikipedia上有这样一个Ambigram:

最后来看一个左右轴对称的Ambigram(献丑了):

Erich Friedman教授为他的朋友创作了很多Ambigram。你可以在他的个人主页上看到。
Alphametic
Alphametic是指,把一句话写成加法算式,每一个字母表示一个数字,那么这个“虫食算”有唯一解。最常见的Alphametic可能是这个:
SEND + MORE = MONEY
它的唯一解是9567 + 1085 = 10652
另一些Alphametic如下:
FIFTY + STATES = AMERICA
TERRIBLE + NUMBER = THIRTEEN
EARTH + AIR + FIRE + WATER = NATURE
SATURN + URANUS + NEPTUNE + PLUTO = PLANETS
1969年,有人发现了这样一个有趣的Alphametic:
THREE + THREE + TWO + TWO + ONE = ELEVEN
这样的Alphametic叫做Doubly-True Alphametic。可以证明上面这个Doubly-True Alphametic是合法的Alphametic中“最小的”一个。另外两个稍微大一点的Doubly-True Alphametic为:
SEVEN + SEVEN + SIX = TWENTY
EIGHT + EIGHT + TWO + ONE + ONE = TWENTY
Mnemonic
Mnemonic本意是可以帮助记忆的句子。例如,我原来记together这个单词就记作We want to get her。再比如,arithmetic可以记作A Rat In Tom's House Might Eat Tom's Ice Cream(每个单词的首字母)。当然,也有一些专门搞笑的Mnemonic,比如Microsoft = Most Intelligent Customers Realize Our Software Only Fools Them,而Macintosh = Most Applications Crash. If Not, The Operating System Hangs。
数学家George Pólya(就是Pólya置换定理的那个Pólya)曾说过一句经典的话:How I need a drink, alcoholic of course, after the heavy chapters involving quantum mechanics! 依次数出每个单词的字母个数,你会惊讶的发现它正好是圆周率的前15位。后来又有人在后面加上一句All of thy geometry, Herr Planck, is fairly hard,让圆周率长度增加到24位。另一些圆周率的Mnemonic如下:
Can I have a large container of orange juice?
May I have a white telephone, or pastel color?
How I wish I could calculate pi faster.
For a girl I loved contrived; by nature tough, her heart survived.
下面这首诗给出了圆周率的前740位。其中10个字母的单词表示一个数字0,字母数大于10的单词则表示两位数。
Poe, E.
Near a Raven
Midnights so dreary, tired and weary.
Silently pondering volumes extolling all by-now obsolete lore.
During my rather long nap - the weirdest tap!
An ominous vibrating sound disturbing my chamber's antedoor.
"This", I whispered quietly, "I ignore".
Perfectly, the intellect remembers: the ghostly fires, a glittering ember.
Inflamed by lightning's outbursts, windows cast penumbras upon this floor.
Sorrowful, as one mistreated, unhappy thoughts I heeded:
That inimitable lesson in elegance - Lenore -
Is delighting, exciting...nevermore.
Ominously, curtains parted (my serenity outsmarted),
And fear overcame my being - the fear of "forevermore".
Fearful foreboding abided, selfish sentiment confided,
As I said, "Methinks mysterious traveler knocks afore.
A man is visiting, of age threescore."
Taking little time, briskly addressing something: "Sir," (robustly)
"Tell what source originates clamorous noise afore?
Disturbing sleep unkindly, is it you a-tapping, so slyly?
Why, devil incarnate!--" Here completely unveiled I my antedoor--
Just darkness, I ascertained - nothing more.
While surrounded by darkness then, I persevered to clearly comprehend.
I perceived the weirdest dream...of everlasting "nevermores".
Quite, quite, quick nocturnal doubts fled - such relief! - as my intellect said,
(Desiring, imagining still) that perchance the apparition was uttering a whispered "Lenore".
This only, as evermore.
Silently, I reinforced, remaining anxious, quite scared, afraid,
While intrusive tap did then come thrice - O, so stronger than sounded afore.
"Surely" (said silently) "it was the banging, clanging window lattice."
Glancing out, I quaked, upset by horrors hereinbefore,
Perceiving: a "nevermore".
Completely disturbed, I said, "Utter, please, what prevails ahead.
Repose, relief, cessation, or but more dreary 'nevermores'?"
The bird intruded thence - O, irritation ever since! -
Then sat on Pallas' pallid bust, watching me (I sat not, therefore),
And stated "nevermores".
Bemused by raven's dissonance, my soul exclaimed, "I seek intelligence;
Explain thy purpose, or soon cease intoning forlorn 'nevermores'!"
"Nevermores", winged corvus proclaimed - thusly was a raven named?
Actually maintain a surname, upon Pluvious seashore?
I heard an oppressive "nevermore".
My sentiments extremely pained, to perceive an utterance so plain,
Most interested, mystified, a meaning I hoped for.
"Surely," said the raven's watcher, "separate discourse is wiser.
Therefore, liberation I'll obtain, retreating heretofore -
Eliminating all the 'nevermores' ".
Still, the detestable raven just remained, unmoving, on sculptured bust.
Always saying "never" (by a red chamber's door).
A poor, tender heartache maven - a sorrowful bird - a raven!
O, I wished thoroughly, forthwith, that he'd fly heretofore.
Still sitting, he recited "nevermores".
The raven's dirge induced alarm - "nevermore" quite wearisome.
I meditated: "Might its utterances summarize of a calamity before?"
O, a sadness was manifest - a sorrowful cry of unrest;
"O," I thought sincerely, "it's a melancholy great - furthermore,
Removing doubt, this explains 'nevermores' ".
Seizing just that moment to sit - closely, carefully, advancing beside it,
Sinking down, intrigued, where velvet cushion lay afore.
A creature, midnight-black, watched there - it studied my soul, unawares.
Wherefore, explanations my insight entreated for.
Silently, I pondered the "nevermores".
"Disentangle, nefarious bird! Disengage - I am disturbed!"
Intently its eye burned, raising the cry within my core.
"That delectable Lenore - whose velvet pillow this was, heretofore,
Departed thence, unsettling my consciousness therefore.
She's returning - that maiden - aye, nevermore."
Since, to me, that thought was madness, I renounced continuing sadness.
Continuing on, I soundly, adamantly forswore:
"Wretch," (addressing blackbird only) "fly swiftly - emancipate me!"
"Respite, respite, detestable raven - and discharge me, I implore!"
A ghostly answer of: "nevermore".
" 'Tis a prophet? Wraith? Strange devil? or the ultimate evil?"
"Answer, tempter-sent creature!", I inquired, like before.
"Forlorn, though firmly undaunted, with 'nevermores' quite indoctrinated,
Is everything depressing, generating great sorrow evermore?
I am subdued!", I then swore.
In answer, the raven turned - relentless distress it spurned.
"Comfort, surcease, quiet, silence!" - pleaded I for.
"Will my (abusive raven!) sorrows persist unabated?
Nevermore Lenore respondeth?", adamantly I encored.
The appeal was ignored.
"O, satanic inferno's denizen -- go!", I said boldly, standing then.
"Take henceforth loathsome "nevermores" - O, to an ugly Plutonian shore!
Let nary one expression, O bird, remain still here, replacing mirth.
Promptly leave and retreat!", I resolutely swore.
Blackbird's riposte: "nevermore".
So he sitteth, observing always, perching ominously on these doorways.
Squatting on the stony bust so untroubled, O therefore.
Suffering stark raven's conversings, so I am condemned, subserving,
To a nightmare cursed, containing miseries galore.
Thus henceforth, I'll rise (from a darkness, a grave) -- nevermore!
-- original: E. Poe
-- Redone by measuring circles.
Lipogram
看看下面这句话有什么问题?
This is an unusual paragraph. I'm curious how quickly you can find out what is so unusual about it. It looks so plain you would think nothing was wrong with it! In fact, nothing is wrong with it! It is unusual though. Study it, and think about it, but you still may not find anything odd. But if you work at it a bit, you might find out! Try to do so without any coaching!
答案:这段话里竟然没有一个字母e !
Lipogram就是指的这样一个段落(甚至文章),里面缺少某个常用的字母。在所有的Lipogram中,写一个没有字母e的文章是最难的,因为字母e出现的频率最高。
看一个比较长的Lipogram。下面这篇文章里硬是没有一个字母e!
Looking at this paragraph with confusion? I'll aid you slightly. Is any odd gap, lacuna or omission obvious to you? Got it now? No?
That's right - this is a lipogram - a book, paragraph or similar thing in writing that lacks a symbol, particularly (but not always) that symbol fifth in rank out of our 26 script-signs (found amidst 'd' and 'f'), which stands for a sound such as that in 'kiwi'. I won't bring it up right now, to avoid spoiling it. I could play with lipograms morning, noon and night. So it is with joy that I submit to you this location – truly, a loquacious location – for lipogram fanatics to join as a unit to glorify this form of wordplay.
As far as I know, this location has a distinct honour: it contains such an abundant quantity of words without using this taboo glyph that no WWW location can outmatch it. As of right now, it contains 1500 words without any hint of that symbol. Naturally, many long lipograms abound in print, including books, rhyming stanzas, and similar works of fiction. Most notably, La Disparition (A Void) by a famous author of a writing group known as Oulipo, stands out as a paragon of lipogrammaticity. I cannot aim to surpass it, but as a fan, I can look upon it with admiration.
Writing lipograms is, as you might think, a difficult task. In my lingo, 2/3 of all words contain that symbol which I am now avoiding, including many common pronouns and similar words commonly found in writing. Without using abbrvs., slang and odd jargon, which most purists scorn as cop-outs, it's darn tough to impart information in a stylistically satisfying way. Stripping paragraphs of particular symbols has a way of making looking at lipograms jarring. No doubt about it, a lipogram is a particularly arduous form of wordplay.
Having said this, acquiring a knack for lipogram composition isn't that hard, and may assist you in your non-lipogrammatic writing. Not to say that I'm without aid in this activity; my dictionary is always handy, as is a book with synonyms for words. And, notwithstanding any drawbacks flowing from passing many an hour looking for unusual ways to say ordinary things, it might aid your socialization skills. Chicks truly dig lipogrammatists, or so my old lady says.
Sadly, a handful of critics find lipograms ridiculous, ugly or without worth (as fiction or as wordplay). To such sorry saps, I say only that in constraining your thoughts and writing in a particular way aids in promoting branching paths of thought, thus amplifying vocabulary and instilling adroit linguistic skills among both young and old. By putting into praxis ways of thinking that wouldn't occur normally, lipograms call for authors to look at writing as an activity in ways that, frankly, wouldn't occur to such niggling adjudicators of linguistic conduct.
Withholding a symbol found in so many words has drastic symptoms that disallow many topics of discussion. (From this point on, I'll stick to talking about that sign I'm skipping right now). Using math is almost an impossibility; you can only maintain 15 of all non-digital words for cardinal quantity up to 100, and hardly any at all past that point, though using digits is a good way out. You can go north or south, but talking about circumnavigating our world latitudinally is an impossibility. How can I possibly talk about various kinds of malt liquor, or parts of my body, without it? To top it all off, as an Anglo, strict prohibitions apply to naming of my own form of linguistic communication. I ought to thank my lucky stars that I'm not writing in lipogrammatic français, though, which holds on to only an octal portion of its original vocabulary.
But all is not lost. Surprisingly, profanity is mostly intact. As a practicing lipogrammatist, you'll find you want many such words, for it is a task so awkward as to call for cussing and cursing on a normal basis. A world map is truly a blissful oasis; my country (Canada) is totally satisfactory, as with most toponyms for nations (111 out of 186, by my count); with a bit of work, USA, UK, and so on, can still show up, and with twin island nations Trinidad and Tobago and Antigua and Barbuda (both with 17 glyphs) topping my list for prolongation. Musicians (particularly classical artists), astonishingly, hold firm as topics of discussion, with Bach, Bartok, Brahms, Chopin, Dvorak, Haydn, Holst, Liszt, Mozart, orff, Puccini, Rachmaninov, Rossini, Scarlatti, Schumann, Strauss, Stravinsky, Tchaikovsky and Vivaldi void of my lost non-consonant.
An additional branch of family Lipogrammatica consists of univocalics. This form of wordplay is akin to a lipogram, but contains a solitary sign that's not a consonant. To wit, a univocalic might omit 'a', 'i', 'o', and 'u' (but what about 'y'?). A univocalic has a sonorant quality that a lipogram lacks, so you must look at a lipogram, but contrarily, a univocalic is both auditory and visual, and has a strong sound if said aloud. Univocalic writing is hard to pull off, but if it's good, its payoff is gigantic.
另外推荐本Blog里的两个相关内容:
http://www.matrix67.com/blog/article.asp?id=104
http://www.matrix67.com/blog/article.asp?id=173
Matrix67收集整理
转贴请注明出处
给定一个仅包括加法运算的算式,请计算出结果。
算式以类似下面的形式给出:
@ @@@ @@@ @ @ @@@ @ @@@ @@@ @@@ @@@ @@@
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @@@ @@@ @@@ @@@ @@@ @@@ @ @@@ @@@ @ @
@ @ @ @ @ @ @ @ @ @ @ @ @ @
@ @@@ @@@ @ @@@ @ @@@ @ @@@ @@@ @@@
数字和+号的位置大小比例以及笔画长短粗细间距都是可变的。例如上面的算式也可以是这样:
@@@@
@@ @@@ @@@@ @@@ @@@ @@@ @@@ @@@@@
@@ @@@ @@ @ @@@ @ @ @ @ @ @@@@@
@@ @ @@@@ @ @ @ @ @ @ @ @ @ @ @@ @@
@@ @@@ @@@@ @@@ @@@ @@@ @@@ @ @@@ @@@ @@@@@
@@ @ @@ @ @ @ @ @ @ @ @ @ @@@@@
@@ @@@ @@@@ @ @@@ @ @@@ @ @@@ @@@
@@@@ @
@
但是保证不会发生笔画的缺损断裂歪斜扭曲等情况,所有字符在外形上都是可以辨识的,不会与其他字符发生混淆。相邻两个字符之间至少使用一列空格符分隔。
输入文件expression.in中包含了一个算式,文件总行数不超过100,每行不超过100个字符。运算的最终结果不超过10000000。算式只由@组成。
在expression.out中输出单独一行一个整数表示最终的运算结果。
输入样例:
@
@ @
@@@@@@@@@@@@@@@ @
@@@@@@@@@@@@@@@ @
@@@@@@@@@@@@@@@ @ @@@@@@@@@@@@@@@@ @@@
@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@ @
@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@ @
@@@@@@@@@@@@@@@ @ @ @
@@@@@@@@@@@@@@ @ @@@ @
@ @
@@@
@
@@@
输出样例:33












