text:
Metapoem equinox
Objective:

Write one program that outputs sourcecode for another program that outputs words.

General information:

Any programming language.

Rules:

Your programs should not take any input. (from user, filename, network or anything).
The generated program sourcecode must not be in the same programming language as the original.
The output from the generated program should be exactly every third character from the original sourcecode, starting at character #3 (first character in sourcecode is #1).
Sourcecode constraints: Maximum 1500 characters
Sourcecode constraints for generated program: Maximum 250 characters

Scoring is based on the output from the generated program, you get points for the following words (any combination of upper/lowercase):
me - 2 points
ore - 3 points
freq - 5 points
pager - 7 points
mentor - 11 points
triumph - 13 points
equipage - 17 points
equipment - 19 points
equivalent - 23 points
equilibrium - 29 points
unubiquitous - 31 points
questionnaire - 37 points

Each word can be repeated but lose 1 point for each repetition. For example:

four of Equilibrium (in any place) in the output gives: 29+28+27+26 points.

Letters in the output can be used in more than one word, for example:

equipager = equipage and pager = 17+7 points.

Best score wins. Good luck, have fun!

I don't get the Rule 3! What do you mean? Can you write down an example?

If the sourcecode is this: print("hello") then the output from the generated code must be exactly: i(eo . The output from the generated code can therefor be maximum 500 characters long (since the original sourcecode is limited to 1500 characters).

@Plarsen: Shouldn't you update your question then? Now it says "Maximum 250 characters" for the generated program, but in your comment you say "500 characters".

the maximum sourcecode size for the generated program is 250, but it can output up to 500 characters (if the original sourcecode is 1500 characters)

Am I correct in thinking that 'mentor' and 'equipment' should get a bonus of 2 points for containing 'me'?

Will i get penalties for using words to often? (mememememe -> 2+1+0-1-2)

yes, both mentor and equipment contains me and give extra points for the words, but the word me can only give you a total of 3 points. First occurance gives 2 points, second: 1 point and after that zero points.

@quasimodo no, no penalties

I wonder how many people will write a program to write their initial program...

How does rule #3 affect newlines and multibyte characters? Do we count every third octet, or every third codepoint, or what? And I'm guessing newlines count as characters as well?

newlines is counted as 1 character. 1 byte is 1 character and the other way round, sorry for not clarifying that.

Befunge-98, produces zsh script: 150 1053 1113 1139 points
The Befunge-98 program (1500)
:#q #u!#e!#sa#t7#i6#o*#n*#n*#aj#ib#r9#e*#q:#u:#i:#p:#a:#g:#e:#r:#e:#q3#u+#i,#pc#m+#e,#nf#t+#o,#r4#e8#q*#u,#i6#l+#i:#b,#r4#i8#u*#m,#e,#qb#u+#i:#p:#m:#e:#n:#t,#o4#r8#e*#q,#u,#i4#l8#i*#b,#r,#i4#u8#m*#u,#n,#u4#b8#i*#q,#u,#i4#t8#o*#u,#s,#q4#ua#e*#s-#t,#i2#o+#n,#n,#a5#i+#r,#ec#q+#u,#i4#v8#a*#l,#e9#n5#t*#-,#qb#ua#e*#s,#t4#i8#o*#n,#n #a #i #r #e #q #u #i #p #a #g #e #r #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #u #n #u #b #i #q #u #i #t #o #u #s #q #u #e #s #t #i #o #n #n #a #i #r #e #q #u #i #v #a #l #e #n #t #- #q #u #e #s #t #i #o #n #n #a #i #r #e #q #u #i #p #a #g #e #r #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #u #n #u #b #i #q #u #i #t #o #u #s #q #u #e #s #t #i #o #n #n #a #i #r #e #q #u #i #v #a #l #e #n #t #- #q #u #e #s #t #i #o #n #n #a #i #r #e #q #u #i #p #a #g #e #r #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #u #n #u #b #i #q #u #i #t #o #u #s #q #u #e #s #t #i #o #n #n #a #i #r #e #q #u #i #v #a #l #e #n #t #- #q #u #e #s #t #i #o #n #n #a #i #r #e #q #u #i #p #a #g #e #r #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #e #q #u #i #p #m #e #n #t #o #r #e #q #u #i #l #i #b #r #i #u #m #u #n #u #b #i #q #u #i #t #o #u #s:#q2#u+#e0#sg#t,#i3#o+#n:#n #a3#i9#rb#e*#q*#u #i`#v #a!#l #e1#n+jt@#-

produces the zsh shell script (127)
for i in n n n n n;echo -n questionnairequipagerequipmentorequilibriumequipmentorequilibriumunubiquitousquestionnairequivalent-

which in turn of course outputs (500)
questionnairequipagerequipmentorequilibriumequipmentorequilibriumunubiquitousquestionnairequivalent-questionnairequipagerequipmentorequilibriumequipmentorequilibriumunubiquitousquestionnairequivalent-questionnairequipagerequipmentorequilibriumequipmentorequilibriumunubiquitousquestionnairequivalent-questionnairequipagerequipmentorequilibriumequipmentorequilibriumunubiquitousquestionnairequivalent-questionnairequipagerequipmentorequilibriumequipmentorequilibriumunubiquitousquestionnairequivalent-

when executed. This is worth 1139 points (assuming my calculations are correct).
Early version (saved here because it's much easier to try to understand)
The Befunge-98 program
:#m #e!#n!#tb#o9#r*#e*#qj#ub#i9#l*#i:#b:#r:#u2#m+#f,#r,#e5#q+#u,#ec#s+#t,#i8#o4#n*#n,#a #r #i #e #q #u #i #p #m #e #n #t #r #i #u:#m2#p+#h0#ug#n,#u3#b+#i:#qf#uf#i*#t`#o5ju @s#_

produces the Bourne shell script (including a bunch of trailing spaces)
echo mentorequilibrumfrequestionnariequipmentriumphunubiquitous

Here is the same program transposed, for easier reading.
: !!b9**jb9*:::2+,,5+,c+,84*,              :2+0g,3+:ff*`5 #
########################################################j@_
mentorequilibrumfrequestionnariequipmentriumphunubiquitous

I knew someone was going to use echo as the second step eventually. :)

I considered leaving it out and calling the target language "English" or "/bin/cat", but that would probably be a tad cheaty. :P

Shellscript and Python - 514 Points
My submission is written in shellscript:
echo   print"'h rthtq""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""q""u""e""s""t""i""o""n""n""a""i""r""e""u""n""u""b""i""q""u""i""t""o""u""s""u""n""u""b""i""q""u""i""t""o""u""s""u""n""u""b""i""q""u""i""t""o""u""s""u""n""u""b""i""q""u""i""t""o""u""s""u""n""u""b""i""q""u""i""t""o""u""s""e""q""u""i""l""i""b""r""i""u""m""e""q""u""i""l""i""b""r""i""u""m""e""q""u""i""l""i""b""r""i""u""m""e""n""t""o""r""e""q""u""i""p""m""e""n""t""o""r""e""q""u""i""p""m""e""n""t""o""r""e""q""u""i""p""m""e""n""t""o""r'"

It will output the following python code (249 characters):
print'h rthtquestionnairequestionnairequestionnairequestionnairequestionnairequestionnairequestionnairequestionnaireunubiquitousunubiquitousunubiquitousunubiquitousunubiquitousequilibriumequilibriumequilibriumentorequipmentorequipmentorequipmentor'

Whose output contains:
8 * questionnaire: 37+36+35+34+33+32+31+30
5 * unubiquitous: 31+30+29+28+27
3 * equipment: 19+18+17
4 * mentor: 11+10+9+8
3 * ore: 3+2+1
6 * me: 2+1

for a total of 514 Points.
Not very sophisticated, i am sure others can do better :)

Maybe you can stuff more stuff in if you rearrange so that it goes "questionairequipmentor"

Agree with Quincunx, addition to that is I believe one can have advantage of creating an algorithm in the generated code that takes advantage of the frequent use of the characters q u i e in the words worth most to create a 500 character output. But I am not sure

JavaScript & REBEL - 198
Initial program:
console.log( "nll(llf  r  e  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  u  n  u  b  i  q  u  i  t  o  u  s  e  q  u  i  p  m  e  n  t  o  r  e  q  u  i  v  a  l  e  n  t  r  i  u  m  p  h  e  q  u  i  l  i  b  r  i  u  m+.+ +.$0+;/ + +//.+/$>$0")+0 ;

Generated program:
nll(llf  r  e  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  u  n  u  b  i  q  u  i  t  o  u  s  e  q  u  i  p  m  e  n  t  o  r  e  q  u  i  v  a  l  e  n  t  r  i  u  m  p  h  e  q  u  i  l  i  b  r  i  u  m+.+ +.$0+;/ + +//.+/$>$0

Output:
nll(llfrequestionnairequipagerunubiquitousequipmentorequivalentriumphequilibrium+.+ +.$0+;

Notes:
Each word is output exactly once, except "me" which is output twice.
You will notice that the generated program is exactly 250 characters long. I didn't notice this until it was written. I consider myself lucky.

Python that outputs C, 947
##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s##q##u##e##s##t##i##o##n##n##a##i##r##e##q##u##i##p##a##g##e##r##e##q##u##i##p##m##e##n##t##o##r##e##q##u##i##v##a##l##e##n##t##r##i##u##m##p##h##u##n##u##b##i##q##u##i##t##o##u##s
print 'main(i,j){for (i=0;i<7;i++) printf("questionnairequipagerequipmentorequivalentriumphunubiquitous");printf("a(jf =i;+pn(utniqpeqpnruanipniiu)rt\"a(jf =i;+pn(utniqpeqpnruanipniiu)rt\"j=+(nppuii)\\)");}'

I use the longest words (that give the best score) and overlapping words too (equipage-pager, as for the example). This is how the score is computed:
me= 2+1+0+0+0+0+0=3
ore= 3+2+1+0+0+0+0=6
pager= 7+6+5+4+3+2+1=28
mentor= 11+10+9+8+7+6+5=56
triumph= 13+12+11+10+9+8+7=70
equipage= 17+16+15+14+13+12+11=98
equipment= 19+18+17+16+15+14+13=112
equivalent= 23+22+21+20+19+18+17=140
unubiquitous= 31+30+29+28+27+26+25=196
questionnaire= 37+36+35+34+33+32+31=238
Total is 947.
Edit: now the generated program should output "exactly every third character from the original sourcecode" :)

Nice! Is your generated C-code actually printing exactly every third character of ALL your Python code? I also think you forgot counting your points for the words ore and me :)

I assumed that the generated code doesn't have to output ALL the Python code (maybe I misinterpreted the sentence "exactly every third character from the original sourcecode"). Will try to fix that.

Javascript and Golfscript - 1074 points
Javascript (1500 chars):
/*e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  m  e  n  t  o  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  m  e  n  t  o  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  m  e  n  t  o  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  m  e  n  t  o  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  a  g  e  r  e  q  u  i  l  i  b  r  i  u  m  u  n  u  b  i  q  u  i  t  o  u  s  q  u  e  s  t  i  o  n  n  a  i  r  e  q  u  i  p  m  e  n  t  o  r*/console.log(  "5{ 2{'equilibriumunubiquitousquestionnairequip'   'ager'}*   'mentor' \\;}*  'cseo 52eibuniiuutniqp ar* eo ; co2biui *o 2u*22  '" );

Generated Golfscript (128 chars): Test GolfScript online
5{ 2{'equilibriumunubiquitousquestionnairequip'   'ager'}*   'mentor' \;}*  'cseo 52eibuniiuutniqp ar* eo ; co2biui *o 2u*22  '

Output (500 chars):
equilibriumunubiquitousquestionnairequipagerequilibriumunubiquitousquestionnairequipmentorequilibriumunubiquitousquestionnairequipagerequilibriumunubiquitousquestionnairequipmentorequilibriumunubiquitousquestionnairequipagerequilibriumunubiquitousquestionnairequipmentorequilibriumunubiquitousquestionnairequipagerequilibriumunubiquitousquestionnairequipmentorequilibriumunubiquitousquestionnairequipagerequilibriumunubiquitousquestionnairequipmentorcseo 52eibuniiuutniqp ar* eo ; co2biui *o 2u*22

Score:
10 * questionnaire (37+36+35+34+33+32+31+30+29+28)    = 325
10 * unubiquitous  (31+30+29+28+27+26+25+24+23+22)    = 265
10 * equilibrium   (29+28+27+26+25+24+23+22+21+20)    = 245
5  * equipage      (17+16+15+14+13)                   = 75
5  * pager         (7+6+5+4+3)                        = 25
5  * equipment     (19+18+17+16+15)                   = 85
5  * mentor        (11+10+9+8+7)                      = 45
4  * ore           (3+2+1)                            = 6
10 * me            (2+1)                              = 3

Total: 1074
UPDATE: Managed to gain some points by changing GolfScript loops from 3*3 to 5*2.


text:
Find all problems that equal an integer
In this challenge, your job is to write a program that allows a user to enter an integer. Then, the program must find all the possible ways of multiplying two numbers to get the user's integer.
Rules:

The program should not show any problem more than once.
The user should be able to enter any integer.
The program should only show problems that contain 2 numbers.
The shortest program (in Bytes) wins.
It does not matter what order the program outputs the problems in.

Example Output (user enters 20, then the program outputs the problems):

20
1 * 20
    2 * 10
    4 * 5

So basically this is just "factor an integer." predicts ridiculously short Mathematica solution

@DoorknobofSnow yes but all possible factorizations.

What do you mean "yes, but all possible factorizations"? That's what factoring is. Unless you mean including non-integer "factors", in which case there are infinite solutions.

This is just factoring, which has been done before: Factorize me!!!, Find prime factors

Perl 6, 54 52 49 characters
my \i=get;i%$_||say $_,"*",i/$_ for 1...^*>i.sqrt

Iterates through each integer from 1 to the first number greater than the square root of the input (* > i.sqrt), excludes that last number (...^), and prints (say $_,"*",i/$_) unless the number doesn't divide the input evenly (i % $_ ||)

Let's give VIM some love (96 chars)
let n=input('')|for x in range(1,n/2-1)|for y in range(1,n)|if x*y==n|ec x."*".y|en|endfo|endfo

The abbreviations ec, en and endfo stand for echo, endif and endfor respectively.
I was rather disappointed that I couldn't use fo; that expands to fold.

python, 85 79 75 73 characters
i,j=1,int(raw_input())
while i*i<=j:
    if j%i==0:
        print i,"*",j/i
    i+=1

This can probably be improved drastically...

Pretty good (for Python!)

Design for readability really kills in codegolf, but I bet Java can't beat that :P

JavaScript, 64 characters
Algorithm: run for loop till square root of the input number and if n % i == 0 alert the pair of numbers.
n=prompt();for(i=1;i<Math.sqrt(n);i++)if(!(n%i))alert(i+"*"+n/i)

C, 75 71 70 characters
n;main(i){scanf("%d",&n);for(;i*i<n;i++)n%i||printf("%d*%d\n",i,n/i);}

Relies on the fact that the program is called with 0 arguments so i is initialized to 1.  I am currently beating the python solution, so I am quite estatic. :D

perl 5 82 characters...
  my $n=20;
  for(1..sqrt($n)){
    say "$_ * ",$n/$_ if $n%$_ == 0;
  }

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
stupid restrictions and desert
So, you were sitting at your desk, golfing a program to calculate the first 20 digits of pi, and along comes your boss and throws your apple IIe out the window. You are now working on a new project and this computer does not yet have any text capability. None. No fonts. Nothing.
Now let's finish that program. Calculate and Display the first 20 characters of pi without using any fonts that are not part of your program. Your output can be displayed or written to standard out as an image file (jpeg, png, gif, svg(as long as you don't use any characters), bmp, xpm). You can use any language, but you can not use your language's font functions, text display or similar.
small bonus (10 characters) If it will work on a Lisa.
Edit: for those who didn't figure it out my inspiration was the first mac, and the title is a pun. A big kudos to @Sukminder whose animated gif is just cool. The contest is not over if a better answer comes along.

I like the challenge, but technically wouldn't such a system also be incapable of displaying source code? Except for Piet, of course.

@ValekHalfHeart you can load the source code from a different machine

@ValekHalfHeart I thought about doing a quine, but I didn't want to check them.

How legible does the text have to be? There's nothing in the rules to prevent extremely small fonts (such as 2x2 bitmap glyphs, which would be unreadable to any human).

@KendallFrey magnifying glasses are ok, but you should use a font that is human readable. (besides 2x2=4<11 and you need all ten digits and a decimal point.) Small fonts may assume a low resolution display. Vectors are also acceptable.

And how do you define human readable? For example, my handwriting is readable to some humans (at least one) and not to others. (By the way, 2^(2x2)=16, enough glyphs for all 11 digits. ;) )

@KendallFrey more readable than your handwriting. Specifically that each character resembles the numeral it represents and is distinct from the other characters in the font and that the numeral system be decimal. I think this can be done in a 3x5 with 1 px between chars.

What math functions can be used?

I still don't think that's specific enough. "resembles" is subjective.

@Gelatin all but PI().

@KendallFrey you don't have to be able to tell between a 6 and a b but you should be able to tell the difference between a 2 and a 3.

Is ASCII art ok?

@Gelatin, why not.

I don't understand the title at all, I don't understand how ASCII art can be ok when we cannot use text display, and the question very much needs a definition of "calculate PI".

What does "calculate pi" really mean? Could I hard-code a bitmap of the first 20 decimals? (Doesn't make use of any built-in PI constant or similar)

@PeterTaylor FireFly, et. al.: I think it's safe to assume that any hard-coding or use of built-in definitions of Pi are out. However, inclusion of ASCII art while built-in font/text display functions are outlawed is... odd. Unless the permission was granted with the presumption that one would write their own such functions and then print ASCII art. That could be a valid solution, but I have doubts that it is competitive in terms of length.

@Iszi, using built-in definitions of pi is ruled out, but using 4*atan(1) seems to be explicitly permitted, which seems bizarre. It's not calculation in any meaningful sense of the word and it's no more interesting than using a built-in constant. And the calculation of pi isn't the interesting part of the challenge anyway (or it would be a duplicate).

“Animated” ? Where ?

Python, 222 chars
n=[10**20*277991633/1963319607/10**i%10 for i in range(19,1,-1)]
print' *     *'
print' * **    '+' '.join(' ** * ***** *****  *'[2*d:2*d+2]for d in n)
print'**     * '+' '.join('**  *    * ** ***** '[2*d:2*d+2]for d in n)

The first line calculates the digits of pi using the approximation pi-3 ~= 277991633/1963319607.  The next three lines output 20 characters of pi using ASCII art Nemeth Braille.
 *     *
 * **    *  ** *  *   * *  ** *  ** *  *   * **  * ** *  ** *
**     *     *     * *  *  *   *     * ** *  ** *     *     **

I'm pushing the boundaries in two directions here, both in the "calculating Pi" and "human readable" senses.

What the heck?  I thought we weren't supposed to use any text output.  How's your computer going to render the *'s and spaces without a font?

@boothby: It's ASCII art.  Think of * as a 1x1 black pixel and   as a 1x1 white pixel.

He's got a point. You can not render a * without using fonts, I think you're disqualified

Python, 217 bytes
Requires the Python Imaging Library
import Image
x=p=141
i=Image.new('1',(x,11))
while~-p:x=p/2*x/p+2*10**19;p-=2
for c in str(x):[i.putpixel((j%7/5*4-~j%7/4*~j/7+p,j%7*3%14%8+j%14/10+2),1&ord('}`7gjO_a\177o'[int(c)])>>j%7)for j in range(17)];p+=7
i.show()

The byte count assumes that the escaped character \177 is replaced with its literal equivalent (char 127).
Output will appear as the following (it will open in your default *.bmp viewer):

Note that this could easily be parameterized to print any number of digits you like. The following will accept an integer input from stdin, and display that many digits:
import Image
n=input()
x=p=n*7|1
i=Image.new('1',(x,11))
while~-p:x=p/2*x/p+2*10**(n-1);p-=2
for c in str(x):[i.putpixel((j%7/5*4-~j%7/4*~j/7+p,j%7*3%14%8+j%14/10+2),1&ord('}`7gjO_a\177o'[int(c)])>>j%7)for j in range(17)];p+=7
i.show()

Output for n=80:

Pi Calculation
while~-p:x=p/2*x/p+2*10**19;p-=2

Yup, that's it. The formula used is the result of applying Euler's Transform to the Leibniz Series, and then factoring out each term from the remainder of the sum. The formula converges linearly; each digit requires log2(10) ≈ 3.32 iterations. For those interested in the derivation, see Appendix A.
Display
PIL is used for image generation, because it's the most convenient library that I know of. A blank 141×11 black and white bitmap is created, and then white lines are drawn on it in a seven-segment fashion, one pixel at a time. The positions required to draw each segment are stored in a bitmask string, with bits corresponding to the following positions:
 000
3   5
3   5
 111
4   6
4   6
 222

The bit of magic (j%7/5*4-~j%7/4*~j/7+p,j%7*3%14%8+j%14/10+2) produces the each pixel in the following order (base-18):
(2, 2), (2, 5), (2, 8), (1, 3), (1, 6), (5, 3), (5, 6),
(3, 2), (3, 5), (3, 8), (1, 4), (1, 7), (5, 4), (5, 7),
(4, 2), (4, 5), (4, 8)

 07e
3   5
a   c
 18f
4   6
b   d
 29g

Appendix A
Euler's Transform is a convergence acceleration technique that works for any series which displays absolute monotonic convergence. The resulting series will converge linearly, typically at the rate of one bit per term (note that if the original series was already super-linear, the resulting series will actually converge slower). The purely mathematical description is a bit hard to follow, so I'll be taking a procedural approach.
We'll start with the Leibniz Series:

Then split each term in half, combining neighboring terms:

Simplified:

Generalized:

Notice that the leading ½ didn't have a partner term, and thus was excluded from the rest of the sum. This is the first term of the transformed series. To find the next term, we repeat the process again:

And again:

And again:

And once more for good measure:

At this point we have the first five terms, and the sixth term is evident. This should be enough to generalize, so
we'll stop here. We'll start by factoring the numerators and denominators:

The denominators evidently contain a Double Factorial of 2n+1, so we'll patch that in:

Everything fits, except for the first two terms which have an unaccounted for 2 in the denominator. We can fix that by multiplying the entire expression by 2:

23 = 2·4, so:

The numerator can now be easily identified as n!.
Notice that the factor added to each successive term, n/(2n+1), approaches ½ as n becomes large, implying a linear convergence at the rate of one bit per term - this is in fact by design. A nice result, but it'd be even nicer without the factorials in there. What we can do here is to factor out each successive term from the rest of the sum, which will generate a nested expression:

This can be rewritten as a recurrence relation:

Where n counts backwards from ⌈log2(10)·d⌉ .. 0, where d is the number of digits required.
It might be interesting to note that the stable point of this recurrence is exactly 2 (or 4 if you've doubled it, as I have in the implmentation above), so you can save a number of iterations by initializing properly. Though, initializing to a random value you need elsewhere, and throwing a few extra iterations on the top is generally cheaper byte-wise.

Very nice, thanks for the lesson! What I don't get is what the p in p/2 * x/p + ... is doing.. AIUI Python supports automatic promotion to a biginteger-ish datatype, so it shouldn't be a precision thing, but somehow those ps matter and don't cancel out like I imagine them to... what am I missing here?

@FireFly p initialized odd, so that p/2/p is equivalent - under integer division - to ((p-1)/2)/p. This produces the 1/3, 2/5, 3/7, etc. terms derived above.

#C – 777 Characters
C – 731 Characters
Prints GIF to stdout.

Quirk: No comma after first 3.

Stitching together GIF from pre-configured header + each digit represented by home brewed (embedded) font of 5x5 pixels.

Result

It is there ---^

Note that GIF vanishes, sometimes, in Chrome after one run.
#include <stdio.h>
#define G 68,30
#define F(e,i)for(i=0;i<e;++i)
#define B w[++k]
unsigned char r[][10]={{4,18,150,199,188,159,10,0},{4,18,102,169,188,122,64,1},{G,160,166,104,217,80,1},{G,160,166,184,140,66,1},{68,96,153,193,135,138,66,1},{G,6,107,199,155,80,40},{68,128,150,22,173,218,90,1},{G,160,182,169,254,84,1},{G,6,138,153,140,10,0},{G,6,138,185,250,66,1},{0,0,0,5,0,5,0,0,2,8}},w[440]={71,73,70,56,57,97,100,0,5,0,144,0,0,255,255,255,0,0,0};int main(){int a=10000,b=0,c=70,d,e=0,f[71],g;int i,j,k=18,s=0;char m[5];for(;b<c;)f[b++]=a/5;for(;d=0,g=c*2;c-=14,e=d%a){for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);sprintf(m,"%d",e+d/a);F(4,i){B=44;B=s++*5;F(10,j)B=r[10][j];F(8,j)B=r[m[i]-'0'][j];B=0;}}B=59;fwrite(w,1,k,stdout);}

Short introduction:
Calculation of PI
Pi is calculated using a slightly modified version of Dik Winter and Achim Flammenkamp's implementation of Rabinowitz and Wagon's algorithm for computing digits of π.
int a=10000,b,c=2800,d,e,f[2801],g;main(){for(;b-c;)f[b++]=a/5;for(;d=0,g=c*2;c
-=14,printf("%.4d",e+d/a),e=d%a)for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);}

GIF generation
GIF images has a canvas property in header. We can use this in combination with displaying multiple images by setting left property for each digit accordingly – where each digit is a (embedded) image in itself.
Documentation.
Example:
Header: Canvas Width  100 pixels
        Canvas Height   5 pixels

3 : left  0 pixels
1 : left  5 pixels
4 : left 10 pixels
… and so on.

Expanded code (with loads of comments)
Messy, but that is part of the minimization:
#include <stdio.h>
#define G 68,30
#define F(e,i)for(i=0;i<e;++i)
#define B w[++k]

/* Font + Image Descriptor + Start of Image Data.
 *
 * Font glyphs are black and white pixels making a 5x5 picture.
 * Each glyph has its own entry in array.
 * Pixels (White,White,Black,Black ...) are further compressed using LZW
 * compression.
 *
 * Next entry in array is Image Descriptor which is added before each glyph.
 * Last entry is start of Image Data.
 *
 * - "0" and comma are 7 and 5 bytes, but hacked to fill 8 bytes to make it
 * easier to handle in minified code.
 * */
unsigned char r[][10]={
        /* Images representing glyphs. */
        { 4,   18, 150, 199, 188, 159, 10,  0}, /* 0 */
        { 4,   18, 102, 169, 188, 122, 64,  1}, /* 1 */
        { 68,  30, 160, 166, 104, 217, 80,  1}, /* 2 */
        { 68,  30, 160, 166, 184, 140, 66,  1}, /* 3 */
        { 68,  96, 153, 193, 135, 138, 66,  1}, /* 4 */
        { 68,  30,   6, 107, 199, 155, 80, 40}, /* 5 */
        { 68, 128, 150,  22, 173, 218, 90,  1}, /* 6 */
        { 68,  30, 160, 182, 169, 254, 84,  1}, /* 7 */
        { 68,  30,   6, 138, 153, 140, 10,  0}, /* 8 */
        { 68,  30,   6, 138, 185, 250, 66,  1}, /* 9 */
        {132, 143, 121, 177,  92,   0,  0,  0}, /* , (removed as not used) */
        {
        /* Image Descriptor */
        /* 0x2C    Image separator (Embedded in code)   */
           0,   /* Image Left   (LSB embedded in code.  */
        0, 0,   /* Image top    (16-bit Little endian)  */
        5, 0,   /* Image Width  (16-bit Little endian)  */
        5, 0,   /* Image Height (16-bit Little endian)  */
        0,      /* Packed byte  (Local color table (not used, etc.)) */
        /* Start of Image Data */
        2,      /* Starting size of LZW 2 + 1 = 3 */
        8       /* Number of bytes in data */
        }
};
/* GIF Header + Global Color table.
 *
 * GIF's has a standard header.
 * Canvas size is the are on which to paint.
 * Usually this is size of whole image, but in this code I've spanned it out
 * and paint glyphs by rendering pictures on a canvas of size:
 * 20 * width_of_1_image (5 * 20 = 100)
 *
 * Each image can have an optional color table, but if not present the global
 * color table is used. In this code only global color table is used. It
 * consist of only black and white. (Though very easy to change if wanted.)
 * */
unsigned char buf[440] = {
        71, 73, 70,     /* Signature     "GIF" */
        56, 57, 97,     /* Version       "89a" */
        100, 0,         /* Canvas width  (16-bit Little endian) 5 * 20 = 100*/
          5, 0,         /* Canvas height (16-bit Little endian) 5 pixels.   */
        144,            /* Packed byte: 1 001 0 000
                                  1 : Has global color table.
                                001 : Color resolution.
                                  0 : Sorted Color Table (No)
                                000 : Size of Global Color table (2^(value+1))
                                        or 2 << value ...
                        */
        0,              /* Background Color index. */
        0,              /* Pixel aspect ratio. */
        /* Global color table. */
        255, 255, 255,  /* Index 0: White */
          0,   0,   0   /* Index 1: Black */
};

int main(void){
        /* PI generation variables. */
        int a = 10000,
            b = 0,
            c = 70,
            d,
            e = 0,
            f[71],
            g;
        /* General purpose variables */
        int i,
            j,
            k = 18,     /* Current Index in out buffer. */
            s = 0;      /* Image counter:
                           (Tells us what "left/x" value should be). */
        char m[5];      /* Print next 4 digits of PI to this buffer. */
        /* Prepare / pre-fill for PI math. */
        for(;b < c;)
                f[b++] = a/5;
        /* Calculate 4 and 4 digits of PI and push onto out buffer. */
        for(; d = 0, g = c * 2; c -= 14 , e = d % a) {
                for (b = c; d += f[b] * a, f[b] = d % --g, d /= g--, --b; d *= b);
                /* sprintf next 4 digits to temprary buffer.     */
                sprintf(m, "%d", e + d/a);
                /* We are served 4 and 4 digits.
                 * Here we transalte them to glyphs and push onto out buffer*/
                for (i = 0; i < 4; ++i) {
                        buf[++k] = 0x2C;     /* 0x2C : Image separator.        */
                        buf[++k] = s++ * 5;  /* xx   : Image left (x) on canvas.*/
                        for (j = 0; j < 10; ++j) {
                                /* Push "Start of Image Data" onto buffer      */
                                buf[++k] = r[11][j];
                        }
                        for (j = 0; j < 8; ++j) {
                                /* Push data of glyph (LZW-compressed) onto buffer. */
                                buf[++k] = r[m[i]-'0'][j];
                        }
                        /* Start of image data informs how big the image data
                         * is. End with zero to mark that this is EOI. */
                        buf[++k] = 0;
                }
        }
        /* 0x3b is Trailer, marking end of file. */
        buf[k] = 0x3b;
        /* Write buffer to standard output.
         * 'k' holds length of data, though as we know this image is
         * 100x5 etc. we can pre-define it as well.
         * */
        fwrite(buf, 1, k, stdout);
}

Looking to use a shorter / other algorithm for calculating π.

I don't see the dot after the first 3 in the image.

Do you have a link to info about the pi decimals generation algorithm? I played around with your code a bit (after stripping the GIF stuff out), but I don't really see why it results in digits of pi...

JavaScript, 680 chars

This can be viewed in a web browser; the numbers are output as SVG paths.

It doesn't compute pi in an interesting way, and JS lacks a number type with precision to display 20 digits.

To save characters, I omitted the path data for "0", since it doesn't show up in the sequence.

Ooh, a vector-based approach. Very nice, good job on the font too.

Java - 866 860 857 853 chars, plus a cheating version with 574 chars
Using the Simon Plouffe formula from 1996, outputs a x.png file with white digital-clock-like numbers in a black background:

This is the compressed code:
import java.math.BigDecimal;class E{static java.awt.Graphics g;public static void main(String[]h)throws Exception{java.awt.image.BufferedImage i=new java.awt.image.BufferedImage(213,17,1);g=i.getGraphics();BigDecimal y=v(-3);for(int n=1;n<99;n++)y=y.add(v(n).multiply(v(2).pow(n)).multiply(f(n).pow(2)).divide(f(2*n),42,0));int j=2;for(char c:y.toPlainString().substring(0,21).toCharArray()){if(j!=12){c-=48;boolean b=c!=1&c!=4;t(b,j,2,8,3);t(c<1|c>3&c!=7,j,2,3,8);t(c<5|c>6,j+5,2,3,8);t(c>1&c!=7,j,7,8,3);t(c%2==0&b,j,7,3,8);t(c!=2,j+5,7,3,8);t(b&c!=7,j,12,8,3);}j+=10;}t(true,17,12,3,3);javax.imageio.ImageIO.write(i,"png",new java.io.File("x.png"));}static BigDecimal v(int k){return BigDecimal.valueOf(k);}static BigDecimal f(int k){return k<2?v(1):f(k-1).multiply(v(k));}static void t(boolean x,int a,int b,int c,int d){if(x)g.fillRect(a,b,c,d);}}

That, with identing and some whitespaces would be this:
import java.math.BigDecimal;

class E {

    static java.awt.Graphics g;

    public static void main(String[] h) throws Exception {
        java.awt.image.BufferedImage i = new java.awt.image.BufferedImage(213, 17, 1);
        g = i.getGraphics();
        BigDecimal y = v(-3);

        // Calculate PI using the Simon Plouffe formula, 1996.
        for (int n = 1; n < 99; n++)
            y = y.add(v(n).multiply(v(2).pow(n)).multiply(f(n).pow(2)).divide(f(2 * n), 42, 0));

        int j = 2;
        for (char c : y.toPlainString().substring(0, 21).toCharArray()) {
            if (j != 12) {
                c -= 48;
                boolean b = c != 1 & c != 4;
                t(b, j, 2, 8, 3);
                t(c < 1 | c > 3 & c != 7, j, 2, 3, 8);
                t(c < 5 | c > 6, j + 5, 2, 3, 8);
                t(c > 1 & c != 7, j, 7, 8, 3);
                t(c % 2 == 0 & b, j, 7, 3, 8);
                t(c != 2, j + 5, 7, 3, 8);
                t(b & c != 7, j, 12, 8, 3);
            }
            j += 10;
        }
        t(true, 17, 12, 3, 3);
        javax.imageio.ImageIO.write(i, "png", new java.io.File("x.png"));
    }

    static BigDecimal v(int k) {
        return BigDecimal.valueOf(k);
    }

    static BigDecimal f(int k) {
        return k < 2 ? v(1) : f(k - 1).multiply(v(k));
    }

    static void t(boolean x, int a, int b, int c, int d) {
        if (x) g.fillRect(a, b, c, d);
    }
}

Cheating the rules and considering that the calculation of PI can be done as "the numeric representation of the String 3.1415926535897934384", this can be reduced to 574 chars:
class F{static java.awt.Graphics g;public static void main(String[]h)throws Exception{java.awt.image.BufferedImage i=new java.awt.image.BufferedImage(213,17,1);g=i.getGraphics();int j=2;for(char c:"3.1415926535897932384".toCharArray()){if(j!=12){c-=48;boolean b=c!=1&c!=4;t(b,j,2,8,3);t(c<1|c>3&c!=7,j,2,3,8);t(c<5|c>6,j+5,2,3,8);t(c>1&c!=7,j,7,8,3);t(c%2==0&b,j,7,3,8);t(c!=2,j+5,7,3,8);t(b&c!=7,j,12,8,3);}j+=10;}t(true,17,12,3,3);javax.imageio.ImageIO.write(i,"png",new java.io.File("x.png"));}static void t(boolean x,int a,int b,int c,int d){if(x)g.fillRect(a,b,c,d);}}

PHP 380
requires gd enabled for image output
<? header('Content-Type: image/png');$i=imagecreatetruecolor(84,5);$n=['71775777770','51115441550','51777771770','51411151510','71771771712'];$c=imagecolorallocate($i,255,255,255);$m=(6.28318/2).(5307*5).(28060387*32);$k=5;while($k--)for($j=0;$j<21;$j++){$p=str_pad(decbin($n[$k][($m[$j]!='.')?$m[$j]:10]),3,'0',0);$l=3;while($l--)$p[$l]&&imagesetpixel($i,$l+$j*4,$k,$c);}imagepng($i);

pi calculation: since base php has a default precision of 14 and i didn't want to recompile the server with the arbitrary precision extensions enabled, i couldn't even aproximate PI with the required decimals, so instead it calculates tau/2 and then the rest of the decimals
since the graphic is made of 0's and 1's, i may try using WBMP as the format later to see if i can remove gd

that image is red on black, and really small, but at 500% you can read it if you look close. (and aren't colorblind.)

@hildred each character is 3x5 with 1 px between chars. the color is red just to reduce 4 chars, but considering that i won't win, i'll change it to white for readability

My comment was not intended as a criticism, but as an explanation, to encourage up votes.

Would imagecreateindex save any characters? does such function exist?

@hildred when working with a pallete image (imagecreate), the first invocation of imagecolorallocate sets the background color, and a second one is needed to set the writing color. so it ends longer

do you have to set a background color? does it have a default?

on pallete, the default background is always the first allocate, even if i allocate it as the color for writing. in this case, i'd wnd up with an image of white on white (not really readable).

oh, well, it was a thought.

@Einacio several micro improvements for 309 bytes: http://codepad.org/LymAC4hX. Most notably, the header may be neglected if it is run from CLI (e.g. php pi-image.php > out.png).

@primo i like the $k*11 and the rest, i'll update it later. i also tought of the header, if there is no display, there is no browser and thus no need for MIME type

@Einacio I just realized (read: discovered by accident) that when using imagecreatetruecolor, it isn't even necessary to allocate colors, you can paint white directly by using 0xFFFFFF. This brings the whole thing down to 291: http://codepad.org/2KyQt01D

Java - 642 622 characters
Copying from my previous answer, using the Simon Plouffe formula from 1996. But outputs ASCII-art instead:
import java.math.BigDecimal;class H{public static void main(String[]h)throws Exception{int[]t={31599,4681,31183,29647,5101,29671,31719,4687,31727,29679,8192};BigDecimal y=v(-3);for(int n=1;n<99;n++)y=y.add(v(n).multiply(v(2).pow(n)).multiply(f(n).pow(2)).divide(f(2*n),42,0));for(int z=0;z<5;z++){for(char c:y.toPlainString().substring(0,21).toCharArray()){if(c<48)c=58;int a=(t[c-48]>>>z*3)&7;e(a/4);e(a/2&1);e(a&1);e(0);e(0);}e(10);}}static void e(int c){System.out.print((char)(c<2?c*3+32:c));}static BigDecimal v(int k){return BigDecimal.valueOf(k);}static BigDecimal f(int k){return k<2?v(1):f(k-1).multiply(v(k));}}

All of that, with some identing and spaces, and a bit of help to the reader understand the meaning of the magic numbers:
import java.math.BigDecimal;

class H {

    public static void main(String[] h) throws Exception {
        // Each block corresponds to a line. Each char has 5 lines with a 3-char width.
        int[] t = {
            0b111_101_101_101_111,
            0b001_001_001_001_001,
            0b111_100_111_001_111,
            0b111_001_111_001_111,
            0b001_001_111_101_101,
            0b111_001_111_100_111,
            0b111_101_111_100_111,
            0b001_001_001_001_111,
            0b111_101_111_101_111,
            0b111_001_111_101_111,
            0b010_000_000_000_000
        };

        // Calculate PI using the Simon Plouffe formula, 1996.
        BigDecimal y = v(-3);
        for (int n = 1; n < 99; n++)
            y = y.add(v(n).multiply(v(2).pow(n)).multiply(f(n).pow(2)).divide(f(2 * n), 42, 0));

        for (int z = 0; z < 5; z++) {
            for (char c : y.toPlainString().substring(0, 21).toCharArray()) {
                if (c < 48) c = 58;
                int a = (t[c - 48] >>> z * 3) & 7;
                e(a / 4);
                e(a / 2 & 2);
                e(a & 1);
                e(0);
                e(0); // Not needed, but makes a better art with the cost of 5 chars.
            }
            e(10);
        }
    }

    static void e(int c) {
        System.out.print((char) (c < 2 ? c * 3 + 32 : c));
    }

    static BigDecimal v(int k) {
        return BigDecimal.valueOf(k);
    }

    static BigDecimal f(int k) {
        return k < 2 ? v(1) : f(k - 1).multiply(v(k));
    }
}

Output:
###         #  # #    #  ###  ###  ###  ###  ###  ###  ###  ###  ###  ###  ###  ###  ###  ###  ###  # #
  #         #  # #    #  #    # #    #  #    #      #  #    # #  # #    #  # #    #    #    #  # #  # #
###         #  ###    #  ###  ###  ###  ###  ###  ###  ###  ###  ###    #  ###  ###  ###  ###  ###  ###
  #         #    #    #    #    #  #    # #    #    #    #  # #    #    #    #    #  #      #  # #    #
###   #     #    #    #  ###  ###  ###  ###  ###  ###  ###  ###  ###    #  ###  ###  ###  ###  ###    #

C, 253 250 chars
Approximates pi using the algorithm in @Sukminder's code (shamelessly borrowing and refactoring their code a bit).  Outputs a binary PBM image, which could then e.g. be converted with ImageMagick.
b,c=70,e,f[71],g;v[71],j,k;L[5]={1072684944,792425072,492082832,256581624};
main(d){for(puts("P4\n8 100");b<c;)f[b++]=2;for(;d=0,g=--c*2;e=d%10){
for(b=c;d+=f[b]*10,f[b]=d%--g,d/=g--,--b;d*=b);v[j++]=e+d/10;}
for(;k<100;k++)putchar(L[k%5]>>3*v[k/5]&7);}

Here's what the output looks like with my Braille-based PPM renderer:

Has the same quirk as @Sukminder's answer in that it lacks a decimal separator.  In addition, the output of mine is vertical, and whether it's human-readable is arguable...
Edit: applied @ugoren's suggestions.

Tiny improvements: move puts into for initialization, define L[5] and omit ,0. Make d a parameter to main (save a comma).

C+LaserWriter printer 599 - 10 = 589
Pipe the output to your LaserWriter! :) This should work on a Lisa (with a C compiler).
It calculates pi in the printer by calculating the sum of the lengths of the line-segments which approximate a Bezier curve sequence which approximates a half-circle, divided by diameter, times 2.
main(){
printf("/dist{dtransform dup mul exch dup mul add sqrt}def");
printf("/len{3 2 roll sub 3 1 roll exch sub dist}def");
printf("/pi{0 0 2 index 0 180 arc closepath flattenpath");
printf("[{2 copy}{2 copy 6 2 roll len 3 1 roll}{}{counttomark -2 roll len\n");
printf("counttomark 2 add 1 roll counttomark 1 sub{add}repeat\n");
printf("exch pop exch pop exch div 2 mul}pathforall}def\n");
printf("matrix setmatrix 100 dup scale 10 setflat 100 pi 10 string cvs\n");
printf("matrix defaultmatrix setmatrix/Palatino-Roman findfont 10 scalefont setfont\n");
printf("100 700 moveto show showpage");
}

Ungolfed Level-1 (1985-compatible) PostScript:
%!
/dist { % dx dy  .  dz
    dtransform
    dup mul exch dup mul add sqrt
} def

/len { % x1 y1 x2 y2  .  dist(y2-y1,x2-x1)
    3 2 roll % x1 x2 y2 y1
    sub 3 1 roll exch sub % y2-y1 x2-x1
    dist
} def

/pi { % rad
    0 0 2 index 0 180 arc closepath % rad
    flattenpath
    [
    { % rad [ x(0) y(0)     (m)print
        2 copy
    } %moveto proc
    { % rad [ ... x(n-1) y(n-1) x(n) y(n)     (l)print
        2 copy 6 2 roll len % rad [ ... x(n) y(n) dist
        3 1 roll % rad [ ... dist x(n) y(n)
    } %lineto proc
    {} %curveto proc % n.b. flattenpath leaves no curve segments
    { % rad [ x(0) y(0) dist(1) dist(2) ... dist(n-1) x(n) y(n)     (c)print
        counttomark -2 roll len % rad [ dist(1) dist(2) ... dist(n)
        counttomark 2 add 1 roll % dist(n) rad [ dist...
        counttomark 1 sub { add } repeat % dist(n) rad [ sum_dist
        exch pop % dist(n) rad sum_dist
        exch pop % dist(n) sum_dist
        exch % sum_dist dist(n)
        div  % length_of_half_circle/diameter
        2 mul % C/d
    } %closepath proc
    pathforall
} def

matrix setmatrix
100 dup scale
10 setflat
100 pi 10 string cvs
matrix defaultmatrix setmatrix
/Palatino-Roman findfont 10 scalefont setfont
100 700 moveto show

Output:

I suppose I need to make a font, too.

Hmm. Never going to get enough digits this way. PS only has 32-bit floats.

cool idea, I like postscript for golfing.

I do have a bitmap font for the digits but golfing will just ruin it!

Java, 1574 2643  1934 characters
Compressed 1934 characters:
    public static void main(String[] args){int[][][]num={{{1,1,1},{1,0,1},{1,0,1},{1,0,1},{1,1,1}},{{0,0,1},{0,0,1},{0,0,1},{0,0,1},{0,0,1}},{{1,1,1},{0,0,1},{1,1,1},{1,0,0},{1,1,1}},{{1,1,1},{0,0,1},{1,1,1},{0,0,1},{1,1,1}},{{1,0,1},{1,0,1},{1,1,1},{0,0,1},{0,0,1}},{{1,1,1},{1,0,0},{1,1,1},{0,0,1},{1,1,1}},{{1,1,1},{1,0,0},{1,1,1},{1,0,1},{1,1,1}},{{1,1,1},{0,0,1},{0,0,1},{0,0,1},{0,0,1}},{{1,1,1},{1,0,1},{1,1,1},{1,0,1},{1,1,1}},{{1,1,1},{1,0,1},{1,1,1},{0,0,1},{0,0,1}},{{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,1}}};BufferedImage image=new BufferedImage(103,5,BufferedImage.TYPE_3BYTE_BGR);for(int q=0;q<103;q++){for(int w=0;w<5;w++){image.setRGB(q,w,0xFFFFFF);}}int loc = 0;String g=String.valueOf(pi(20));for(int w=0;w<g.length()-1;w++){Integer n=0;if(g.charAt(w)=='.'){n=10;}else{n=Integer.parseInt(String.valueOf(g.charAt(w)));}for(int t=0;t<5;t++){for(int q=0;q<3;q++){int c=num[n][t][q]==1?0x000000:0xFFFFFF;image.setRGB(loc+q,t,c);}}loc+=5;}try{BufferedImage bi=image;File f=new File("o.png");ImageIO.write(bi,"png",f);}catch(IOException e){}}public static BigDecimal pi(final int SCALE){BigDecimal a=BigDecimal.ONE;BigDecimal b=BigDecimal.ONE.divide(sqrt(new BigDecimal(2),SCALE),SCALE,BigDecimal.ROUND_HALF_UP);BigDecimal t=new BigDecimal(0.25);BigDecimal x=BigDecimal.ONE;BigDecimal y;while(!a.equals(b)){y=a;a=a.add(b).divide(new BigDecimal(2),SCALE,BigDecimal.ROUND_HALF_UP);b=sqrt(b.multiply(y),SCALE);t=t.subtract(x.multiply(y.subtract(a).multiply(y.subtract(a))));x=x.multiply(new BigDecimal(2));}return a.add(b).multiply(a.add(b)).divide(t.multiply(new BigDecimal(4)),SCALE,BigDecimal.ROUND_HALF_UP);}public static BigDecimal sqrt(BigDecimal A,final int SCALE){BigDecimal x0=new BigDecimal("0");BigDecimal x1=new BigDecimal(Math.sqrt(A.doubleValue()));while(!x0.equals(x1)){x0=x1;x1=A.divide(x0,SCALE,BigDecimal.ROUND_HALF_UP);x1=x1.add(x0);x1=x1.divide(new BigDecimal(2),SCALE,BigDecimal.ROUND_HALF_UP);}return x1;}}

Expanded 2643 characters:
public static void main(String[] args) {
    int[][][] num = { { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 } },
            { { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 } },
            { { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 1 } },
            { { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 } },
            { { 1, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 0, 0, 1 }, { 0, 0, 1 } },
            { { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 1 }, { 0, 0, 1 }, { 1, 1, 1 } },
            { { 1, 1, 1 }, { 1, 0, 0 }, { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 } },
            { { 1, 1, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 } },
            { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 } },
            { { 1, 1, 1 }, { 1, 0, 1 }, { 1, 1, 1 }, { 0, 0, 1 }, { 0, 0, 1 } },
            { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 } } };

    BufferedImage image = new BufferedImage(103, 5, BufferedImage.TYPE_3BYTE_BGR);

    for (int q = 0; q < 103; q++) {
        for (int w = 0; w < 5; w++) {
            image.setRGB(q, w, 0xFFFFFF);
        }
    }

    int loc = 0;

    String g = String.valueOf(pi(20));
    for (int w = 0; w < g.length()-1; w++) {
        Integer n = 0;
        if (g.charAt(w) == '.') {
            n = 10;
        } else {
            n = Integer.parseInt(String.valueOf(g.charAt(w)));
        }
        for (int t = 0; t < 5; t++) {
            for (int q = 0; q < 3; q++) {
                int c = num[n][t][q] == 1 ? 0x000000 : 0xFFFFFF;
                image.setRGB(loc + q, t, c);
            }
        }
        loc += 5;
    }
    try {
        BufferedImage bi = image;
        File outputfile = new File("out2.png");
        ImageIO.write(bi, "png", outputfile);
    } catch (IOException e) {

    }
}

public static BigDecimal pi(final int SCALE) {
    BigDecimal a = BigDecimal.ONE;
    BigDecimal b = BigDecimal.ONE.divide(sqrt(new BigDecimal(2), SCALE), SCALE, BigDecimal.ROUND_HALF_UP);
    BigDecimal t = new BigDecimal(0.25);
    BigDecimal x = BigDecimal.ONE;
    BigDecimal y;

    while (!a.equals(b)) {
        y = a;
        a = a.add(b).divide(new BigDecimal(2), SCALE, BigDecimal.ROUND_HALF_UP);
        b = sqrt(b.multiply(y), SCALE);
        t = t.subtract(x.multiply(y.subtract(a).multiply(y.subtract(a))));
        x = x.multiply(new BigDecimal(2));
    }
    return a.add(b).multiply(a.add(b)).divide(t.multiply(new BigDecimal(4)), SCALE, BigDecimal.ROUND_HALF_UP);

}

public static BigDecimal sqrt(BigDecimal A, final int SCALE) {
    BigDecimal x0 = new BigDecimal("0");
    BigDecimal x1 = new BigDecimal(Math.sqrt(A.doubleValue()));
    while (!x0.equals(x1)) {
        x0 = x1;
        x1 = A.divide(x0, SCALE, BigDecimal.ROUND_HALF_UP);
        x1 = x1.add(x0);
        x1 = x1.divide(new BigDecimal(2), SCALE, BigDecimal.ROUND_HALF_UP);
    }
    return x1;
}

Pi method gathered from: https://stackoverflow.com/questions/8343977/calculate-pi-on-an-android-phone?rq=1

It looks like you used a constant instead of calculating PI.

That is a nice twist. Working on it now.

You may compress it a bit more by adding throws Exception in main and removing the try-catch block. Further, you may rename pi and sqrtmethods and the loc, args, SCALE, x0 and x1 variables to 1 char identifiers. And by the way you must add the complete class, this includes the class Foo{ declaration and the imports.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
"Hello world!", repeating each character n times
In your language of choice, write a program that outputs exactly Hello world!. Each character in your program must be repeated n times - you choose n.
For example, you might choose 2 for n. This means that every character used in your source code must be repeated that many times, or 0.
If I were to choose 3 for n, this program would be valid:
ab(b(b(aa)));;;

Rules:

You cannot use any external resources
No user input can be provided
You must output exactly Hello world!, no more, no less. Newlines are the exception, they are optional.
n must be >= 2, to keep things interesting
It's highly discouraged to use comments to accomplish your goal.

Popularity contest, ending in 14 days. Highest score answer at the end wins!

Let's steal every answers from this topic: http://codegolf.stackexchange.com/questions/18925/hello-world-with-no-repetition with n=1

Oops, let's say that n>=2, @Fabinout

Space counts as a character?

@3ventic Yes, it does.

here's a JSFiddle I threw together for testing if anyone needs it

I'd love to see a HQ9+ solution for this.

@Nate HQ9+ outputs a comma (as noted in a deleted answer). ;-)

Brainfuck
n=57. 45 newlines removed thanks to ratchet freak
++++++++++[>+++++++>++++++++++>+++<<<-]>++.>+.+++++++..+++.>++.<++++++++.--------.+++.------.--------.>+.---------------------------------[.............................................][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]<-<<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

A more readable version:
+++++ +++++ [
    > +++++ ++
    > +++++ +++++
    > +++
    <<< -
]
> ++ .
> + .
+++++ ++.
.
+++ .
> ++ .
< +++++ +++ .
----- --- .
+++ .
----- - .
----- --- .
> + .
---------------------------------[.............................................][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]<-<<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

The last line (on the readable version) is for filling up the character count. They are not comments. The [] are while(0)s, and the ><s are in essence no-ops

couldn't you put the . inside one of the [] and not output the newlines

@ratchet freak Good point. Thanks.

I think ratchet was suggesting moving the [ in the first [] to before the dots, so that it wouldn't output even NULLs.

@Ilmari Karonen Oh right, I see. Thanks.

JavaScript
alert(("aaaeerrttt((,,,HHHoo   wwwddd!!!))","Hello world!"))

This seemed a little too easy.

Python 3, n = 3, no comments
dwwppHottedHen =print((("H[e]l1l1o\\ !w!orrilidn!\""[::2][:12])))== 2

Not too hard for a Pythonist to understand. ;) (Hint: try "abcdefghijk"[::2] and see what it results in)
By the way, a HottedHen is a warmed up chicken, if you were wondering. (The dwwpp before it stands for drinking water with purple pancakes, because that's what the hens were doing when I was writing it. Everyone knows that purple pancakes go well with water. Obviously.)

C, 54
main(Hadmeinwurst015p){{!puts("Hello\40wor\154d!");;}}

You have  a v that doesn't match

@Eduard hm, you're right, it must've slipped in there accidentally because it doesn't seem to have been included in the character count... fixed.

Golfscript - 32
New version with 2 of each used character - 32 - Test online
;"Hello wor\x6cd!" '\Hewrx6cd!';

Old version - 39 - Test online
;;'Hello world!'  "'HHeewworrdd!!\\\"";

EDIT: Updated since rules was updated saying it was discouraged with the use of comments

Much better without comments!

Java - 1221 chars
Each character is repeated (int)'!' number of times.
public class ncharacterHelloworld {
    public static void main(String[] args){
        {;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;
{;{;{;{;{;{;{;{;{;{;{;{
String pppppppppppppppuuuuuuuuuuuuuubbbbbbbbbbbbbbbllllllllllliiiiiiiiiiicccccccccccccaaaaaaaaaaaassssssssssssssnnnnnnnnnnnnnhhhhhhhhhhhhhhhhrrrrrrrrrrrrttttttttttteeeeeeeeeeeeeeHHHHHHHHHHHHHHHooooooooooooowwwwwwwwwwwwwwwdddddddddddddddvvvvvvvvvvvvvvvvmmmmmmmmmmmmmmmSSSSSSSSSSSSSSSgggggggggggggggyyyyyyyyyyyyyyyy="Hello world!",
a=pppppppppppppppuuuuuuuuuuuuuubbbbbbbbbbbbbbbllllllllllliiiiiiiiiiicccccccccccccaaaaaaaaaaaassssssssssssssnnnnnnnnnnnnnhhhhhhhhhhhhhhhhrrrrrrrrrrrrttttttttttteeeeeeeeeeeeeeHHHHHHHHHHHHHHHooooooooooooowwwwwwwwwwwwwwwdddddddddddddddvvvvvvvvvvvvvvvvmmmmmmmmmmmmmmmSSSSSSSSSSSSSSSgggggggggggggggyyyyyyyyyyyyyyyy,
u="\"=============================,,,,,,,,,,,,,,,,,,,,,,...............................",b="\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\\\\\\a",i,l,c,t,H,o,w,m;int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]ffffffffffffffffffffffffffffffff;
        if(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!(!!true)))))))))))))))))))))))))))))))
System.out.println(a);
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
    }

}
I got tired of putting all the = and , and the like in the code, so I ended dumping them all in a String; not a comment, a string. Every valid character is used for a variable name.

Windows Command Script - 33 bytes
3 of everything:
ecHo Hello world!% eHccwwrrdd!!%%

Windows Command Line - 42 Bytes
n=3
ecHo.Hello world! 2>^>2cceHwwrrdd!.. 2>^^!

Batch - 45 Bytes
@ecHo.Hello world! 2>^>2cceHwwrrdd@@..! 2>^^!

2> redirects stderr to a file called >22cceHwwrrdd - > is an invalid character for a file name - redirect the output of that error to a file called ^!.
Realized that I completely ignored ! and >. Dang.

I spy 4 spaces :(

Ruby - 40 Chars (n=2)
print "Hel\x6co World!"||'pintHe\x6cWd!'

How many spaces do you have? Is it correct to say that the first two around p are tabs (or something similar)?

@Quincunx First space was a typo.Now edited

PHP - 30 bytes, n = 2
Hell<?='=s?<;^2s'^RSHSI2VReIV;

Shortest solution thus far. I may be able to reduce this by 2-4 more bytes.

PHP
<?print"H\145llo wor\154d!"; $Hwpintd<>!'$';?>

Shorter version (42 char):
<?print"H\145llo wor\154d!"; 'Hwd<pint?!';

Online page with that source

I think you can:

not end with ?> (which will eliminate the use of >)
treat Hepwintd<! as string - 'Hepwintd<!' which will take care of $

Perl (51 bytes)
print'Hello world!'; ppriinnttHHeeowwdd; "'\"\\!!";

Old post and probably doesn't matter too much, but you can save a few bytes using $' or $" inside a q!! block instead of the \\s.

C, 75 56 54
2 of everything
main(HWacdeimnprstux6) {{!puts("Hel\x6co\ World!");;}}

main( ){puts("Hello Wor\x6cd!\0!;HWacdeimnprstux06{}");}

3 of everything.
main(){puts("Hello World!\000!!;;HHWWaaddeeiimmnnpprrssttuu{}{}\"\()o");}

Puts stops reading after the first null byte (\000), and only outputs everything before it.

In the first i is kind of lonely! :)

Your first two have only one i (easy to fix: change the main argument name). Your last only has one space

@EduardFlorinescu Lol, I posted that exactly at the same time as you :P

Oops, the first was missing. The second had it, just out of place.

JavaScript 40 (n=2)
I took a slightly different approach to @eithedog, using the left over letters to act as a logic trigger, so that it was absolutely essential to use it to activate the alert function.
('Hawtd !')&&alert("He\x6c\x6co world!")

Python 2, 38
deinptw=H=5; print"Hel\154o world\41";

R, 346 characters, n = 12
cat((((((((((intToUtf8(c(40,69,76,76,79,0,55,79,82,76,68,1)+31+1+0+0+0+0+0+0+0+0++0*11111111[1]*22222222222[1]*33333333333[1]*44444444444[1]*5555555555[1]*6666666[1]*7777777[1]*888888888[1]*999999*9[1]*9[1]*9[1])))))))))),"\"\"\"\"\"\"\"\"\"\"\\aaaaaaaaaaaccccccccccfffffffffffiiiiiiiiiiinnnnnnnnnnnoooooooooootttttttttTTTTTTTTTTTUUUUUUUUUUU"[0])

Characters used in this code:
,"()[]*\+0123456789acfinotTU

Jelly, 16 bytes (non-competing)
“⁸ƒẹI4»
“⁸ƒẹI4»

(+trailing newline)
Try it online! (n = 2)
NO COMMENTS AT ALL. I assure you. Just Link 1 and the Main Link.

And yes I know this is not [tag:code-golf].

Hmm... so this answer paved the road to close for this challenge. Nice.

Golfscript, 42
."Hello world!"'\\\'"  HHeeowwrrdd!!'..;;;

Test online

Javascript, 40
alert("Hel\x6Co wor\x6Cd!", !('adtHw,'))

If I'm not mistaken every character appears twice (though I started seeing double, so I'm not sure)
edit: And, if abusing the rules - 36:
alert("Hel\x6Co wor\x6Cd!")( !wdatH)

(abuse = while output is given as a prompt, the console displays the error - don't know how to treat this).

r appears 3 times while w only appears once. (in both versions) Just replace the final r with w to fix it

Oh, dyslexia, you cruel mistress... Thanks!

Python:
With 3 characters each.
print 'Hello world!'#He's aware#paints#Hipos!nddwt!

nddwt is a rhino!

Bash, 39
echo -e "H\r--w\"!wccdd!\rHello world!"

This displays exactly Hello world!, and is 39 chars if you omit the trailing newline (bash doesn't seem to need it).
If you need a case-sensitive version, it becomes 42 chars:
echo -e "HhhH\r--w\"!wccdd!\rHello world!"

JavaScript (52 characters)
alert(['He\x6C\x6Co world!'][(!1,0)-0], +-1+"Hadtw")

Each character is used 2 times, and it doesn't use any comments!
Note: I posted this answer here first.

Golfscript x4 -- No extra symbols -- Using all possible commands
'HHHeeelWWWrrrd'!!! do do 'Hello world!'

I tried to do one that didn't have any extra symbols beyond what was absolutely necessary (though I could have chosen " instead of ' or ")
As a secondary goal I also wanted to put as few characters as possible into a string
as possible, so I used the ! operator as such, and I also squeezed in to do operators.

Classic ASP (VBScript; 62 characters)
Hel<%REspOnsE.wRite Chr((0<0>-.6&"!")+&H6C+h-dinptO)%>o world!

Uses each character exactly 2 times!

Edit: This code is a bit shorter:
Hel<%= Chr((0<0>we=6&"!")+&H6C+hd)%>o world!

And so is this:
Hel<%= CHr((0<1>wedC=8&"!&")++108)%>o world!

Turtlèd, n=3, (noncompeting)
N=3, because of "Hello world!" having three ls.
'!' ' HHeeowwrrdd"Hello world!""!

Try it online
Explanation:
'!                                write exclamation mark
  ' '                             write space twice on the same cell as exclamation mark
      HHeeowwrrdd                 balances chars in Hello world!, moves the pointer
                 "Hello world!"   Write Hello world! to grid
                               "! Write the exclamation mark again, on top of the last one

Befunge 98 - 26 bytes
Since I had to duplicate the r anyway, I figured I may as well make the source text read left-to-right rather than typical gnirts Befunge style. There's nothing particularly notable about this; I'm not sure if having code that simply isn't executed counts as a comment, but the six characters Hel w! are just ignored.
rHel w!@,dk"Hello, world!"


text:
Calculate Chinese Zodiac sign
Given that the Chinese New Year is coming, here is a challenge to calculate the Chinese Zodiac, element and Taijitu for a given date.
The input should be a date:
1/31/2014

The date used here is the US style mm/dd/yyyy, but may alternatively be ISO-8601 style: yyyy-mm-dd so the style of date input is not strict.
The output should be the animal sign in the Chinese Zodiac including the element that corresponds to the date, and its Taijitu counterpart:
Horse - Wood - Yang

A table showing the Zodiac - element - Taijitu relationship can be seen here: Chinese Zodiac - Years
The output format is not strict but should contain animal, element and Taijitu component, and should be delimited in some fashion.
Examples of valid output for the above date might include:
(horse, wood, yang)
["Horse", "Wood", "Yang"]

Your program should return valid output for a range of at least 100 years, including today's date. This means that it will need to account for at least two 60 year (Sexagenary) cycles.

Do you have a convenient link to how to calculate the start of a zodiac year?

@Hand-E-Food Unfortunately no, I am trying to figure out and come with details, but other than that it seems pretty simple.

You have no idea how to calculate the zodaic year but it "seems pretty simple". Perhaps we should close this question for now, and reopen it when you have those little details ironed out?

@LegoStormtroopr "other than that seems pretty simple" i.e. the beginning of the new Chinese year. I provided the link to Wikipedia an there is the table which is to big to bring it up here

Another thing to note is that it is always between Jan 21 and Feb 21 inclusive.

@Quincunx It has to do with the new moon http://en.wikipedia.org/wiki/New_moon#Determining_new_moons:_an_approximate_formula

This and this might be useful.

The table you link is of no use unless you add a restriction that it is unnecessary to give the correct output for dates outside that range.

Eduard Florinescu, two things you should clarify in the question: 1) input date range as @PeterTaylor points out, and 2) does the output format have to be exactly as you specify in your example?  Every character counts so please make this objective. Thanks.

I missed the latest edit; it fixes the previous problems, but introduces one new ambiguity: given that the requirement is now to take a date as input, can people opt to take dates in a sensible (e.g. ISO 8601) format as opposed to U.S. middle-endian?

@PeterTaylor you can opt to ISO 8601 see edit, but the question is closed

Python 2: 360* 387 586 594 - Characters
Reduced further
m,n,p=map(int,raw_input().split("/"));p-=1924;d=int("5od2nauh6qe4obvj8rf5pd2math6re3ocvi8sf5pd2l9uh6rf3nbvi7sg5pd2k9th6rf4navj7sg5oc1m9ti7qe3navj8sg5pc1math6qd3nbvj8sf4oc1ma"[p],36);p-=31*m-31+n<(d<21)*31+d;print"Rat Ox Tiger Rabbit Dragon Snake Horse Goat Monkey Rooster Dog Pig".split()[p%12],"Wood Fire Earth Metal Water".split()[p%10/2],["Yang","Yin"][p%2]

The above code works for the following interval:  5 Feb 1924 – 31 Dec 2043
Example: after pasting the above code in the python interpreter cursor
>>> m,n,p=map(int,raw_input().split("/"));p-=1924;d=int("5od2nauh6qe4obvj8rf5pd2math6re3ocvi8sf5pd2l9uh6rf3nbvi7sg5pd2k9th6rf4navj7sg5oc1m9ti7qe3navj8sg5pc1math6qd3nbvj8sf4oc1ma"[p],36);p-=31*m-31+n<(d<21)*31+d;print"Rat Ox Tiger Rabbit Dragon Snake Horse Goat Monkey Rooster Dog Pig".split()[p%12],"Wood Fire Earth Metal Water".split()[p%10/2],["Yang","Yin"][p%2]

and then press Enter, input a date like this
6/13/2018

and then press Enter again, output will be
Dog Earth Yang

* reduced further 27 bytes with Brian's help see comments.

Did you notice your base-36 number contains “math” twice? :)

@Timwi :D No, I didn't, and that is both nice and spooky!

Eduard, could you explain the d=int(base 36 number) part? I came across your answer doing research in stackoverflow for a similar problem. I need to expand the year calculations to the range of years 1500 - 2043. Thanks in advance for any help.

@LMNYC Every letter in the string contains the day date of the beginning of the Chinese year between 1924 and 2043 in base 36,
if the day is less than 21 then it is February else it is January.
Basically this is my way of compressing all those dates. So this is not an year calculation but more like just storing the dates, with a lunar-solar year calculation this will be way bigger

Very cool and even more so when the string math shows up twice, as somebody indicated before. Thank you very much for the explanation.

You can save another 23 characters with some microoptimisations.  See http://www.reddit.com/r/Python/comments/2oqobw/code_golf_calculate_chinese_zodiac_sign/cmppcy1

@Brian Great tips, thanks, can I put them in the answer?

Sure, go ahead.

@Timwi 1math6 and 2math6. Even the preceeding 5 and the following 3 are mirrored with different chars inbetween. That's 3spooky5me.

Mathematica 63
Okay, this may be getting old, but it works (date input is ambiguous in many cases):
z=WolframAlpha[#<>" Chinese zodiac",{{"Result",1},"Plaintext"}] &

Example:
z@"1/31/2014"

"Horse (Yang Wood)"

The breadth of Mathematica amazes me. Your output format is incorrect, but I'm sure that's easily fixed.

@DarrenStone it is somewhat inglorious because Mathematica simply calls W|A. Do you think the output has to fit exactly the OP´s formatting?

It looks like other answers are formatted exactly like the question's example output and it certainly takes extra code to do so in any language.  But that's really a question for @EduardFlorinescu

@DarrenStone true. This will certainly add quite a bit of overhead. W&C...

C# – 357 337 339 bytes
string Z(System.DateTime d){var c=new System.Globalization.ChineseLunisolarCalendar();var y=c.GetSexagenaryYear(d);var s=c.GetCelestialStem(y)-1;return",Rat,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Goat,Monkey,Rooster,Dog,Pig".Split(',')[c.GetTerrestrialBranch(y)]+" - "+"Wood,Fire,Earth,Metal,Water".Split(',')[s/2]+" - Y"+(s%2>0?"in":"ang");}

Formatted:
string Z(System.DateTime d)
{
  var c = new System.Globalization.ChineseLunisolarCalendar();
  var y = c.GetSexagenaryYear(d);
  var s = c.GetCelestialStem(y) - 1;
  return
    ",Rat,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Goat,Monkey,Rooster,Dog,Pig".Split(',')[c.GetTerrestrialBranch(y)]
    + " - "
    + "Wood,Fire,Earth,Metal,Water".Split(',')[s / 2]
    + " - Y" + (s % 2 > 0 ? "in" : "ang");
}

+1 Also, you can save over 20 characters by avoiding string.Format.

Yeah, right, thanks, I tried to golf the various s%2 == 0 etc., and forgot the big one. :-) And, actually, it was exactly 20 characters, IIANM.

Ruby, 340
m,d,y=gets.split(?/).map(&:to_i);y+=1if 31*m+d-51>"d88jac8mlbuppp21ygmkjsnfsd4n3xsrhha4abnq9zgo6g2jupc39zav84434f75op4ftfhdcsa3xhc8nsw1ssw8p9qns1tf14mncy8j18msr9rsb7j7".to_i(36)>>5*y-9625&31
$><<[%w(Goat Monkey Rooster Dog Pig Rat Ox Tiger Rabbit Dragon Snake Horse)[y%12],%w(Metal Water Wood Fire Earth)[(y-1)/2%5],%w(Yin Yang)[y%2]]*' - '

This will work for dates between Feb  5, 1924 and Jan 29, 2044.

What the hell is that "magic" number?

@tomsmeding, it's a 600-bit integer encoded in Base 36 for compactness. Broken into bitfields, it's a table of the first day of the lunar calendar for each year between 1924 and 1944.

GolfScript (212 chars)
This uses non-printable characters, so here's the output from xxd:
0000000: 272d 272f 6e2a 7e5c 2833 312a 2b5c 3a5e  '-'/n*~\(31*+\:^
0000010: 3139 2a22 d4e3 275a 747f 878c 70cb 996d  19*"..'Zt...p..m
0000020: a4f9 19e9 699e d818 bb61 c4e3 2232 3536  ....i....a.."256
0000030: 6261 7365 2033 6261 7365 5e31 3932 322d  base 3base^1922-
0000040: 3c7b 282d 7d2f 3330 2532 312b 3e5e 352d  <{(-}/30%21+>^5-
0000050: 2b3a 5e31 3225 2752 6174 0a4f 780a 5469  +:^12%'Rat.Ox.Ti
0000060: 6765 720a 5261 6262 6974 0a44 7261 676f  ger.Rabbit.Drago
0000070: 6e0a 536e 616b 650a 486f 7273 650a 476f  n.Snake.Horse.Go
0000080: 6174 0a4d 6f6e 6b65 790a 526f 6f73 7465  at.Monkey.Rooste
0000090: 720a 446f 670a 5069 6727 6e2f 3d6e 5e32  r.Dog.Pig'n/=n^2
00000a0: 2f35 2527 576f 6f64 0a46 6972 650a 4561  /5%'Wood.Fire.Ea
00000b0: 7274 680a 4d65 7461 6c0a 5761 7465 7227  rth.Metal.Water'
00000c0: 6e2f 3d6e 5e31 2627 5961 6e67 0a59 696e  n/=n^1&'Yang.Yin
00000d0: 276e 2f3d                                'n/=

An equivalent program which uses string escapes and is hence a bit longer is:
'-'/n*~\(31*+\:^19*"\xD4\xE3'Zt\x87\x8Cp\xCB\x99m\xA4\xF9\x19\xE9i\x9E\xD8\x18\xBBa\xC4\xE3"256base 3base^1922-<{(-}/30%21+>^5-+:^12%'Rat
Ox
Tiger
Rabbit
Dragon
Snake
Horse
Goat
Monkey
Rooster
Dog
Pig'n/=n^2/5%'Wood
Fire
Earth
Metal
Water'n/=n^1&'Yang
Yin'n/=

The interesting part is computing, given the date, whether it is before or after the Chinese New Year which falls in that Gregorian year. Taking inspiration from the Easter calculation algorithm which I've used on a previous question, I looked for a reasonably simple calculation of the New Year date. In the end I've gone with a simple formula which gets me most of the way there, plus a lookup table for the error term.
The simple calculation is day_of_year = 21 + (19 * year % 30). The error term ranges from 0 to 8 over the range of interest (1924 to 2044), and never changes from year to year by more than one, so the lookup table is encoded in balanced ternary and the error is computed by summing the error terms of a prefix of the table.

Nice, shortest thus far, except for the Mathematica one is using an external resource. +1

C#, 630 611 604 572 570 bytes, 120 years
(add ~2⅔ bytes per additional year if you know the offset)
This is good for people born 31-Jan-1900 through 24-Jan-2020 and will likely crash outside of that range.  Are there bonus points for the number of years covered?
string Z(DateTime date)
{
    int[] days = new int[] {  3, 22, 11,  1, 19,  7, -3, 16,  5, -6, 13,  2,
                             21,  9, -2, 17,  6, -5, 14,  4, 23, 11,  0, 19,
                              8, -3, 16,  5, -5, 13,  2, 20,  9, -2, 17,  7,
                             -4, 14,  3, 22, 11, -1, 18,  8, -3, 16,  5, -6,
                             13,  1, 20,  9, -1, 17,  6, -4, 15,  3, 21, 11,
                              0, 18,  8, -3, 16,  5, -7, 12,  2, 20,  9, -1,
                             18,  6, -5, 14,  3, 21, 10,  0, 19,  8, -3, 16,
                              5, 23, 12,  1, 20,  9, -1, 18,  7, -5, 13,  3,
                             22, 10,  0, 19,  8, -4, 15,  4, -6, 12,  1, 21,
                             10, -2, 17,  6, -5, 13,  3, 22, 11,  0, 19,  8 };
    string[] signs = "Rat,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Goat,Monkey,Rooster,Dog,Pig".Split(',');
    string[] elements = "Metal,Water,Wood,Fire,Earth".Split(',');
    string[] polarities = new string[] { "Yang", "Yin" };
    int year = date.Year - 1900;
    int x = year - (date.DayOfYear < days[year] + 28 ? 1 : 0);
    return signs[x % 12] + " - " + elements[x / 2 % 5] + " - " + polarities[x % 2];
}

Or condensed (with added line breaks):
string Z(DateTime d){
int y=d.Year-1900,
x=y-(d.DayOfYear<new[]{3,22,11,1,19,7,-3,16,5,-6,13,2,21,9,-2,17,6,-5,14,4,23,11,0,19,8,-3,16,5,-5,13,2,20,9,-2,17,7,-4,14,3,22,11,-1,18,8,-3,16,5,-6,13,1,20,9,-1,17,6,-4,15,3,21,11,0,18,8,-3,16,5,-7,12,2,20,9,-1,18,6,-5,14,3,21,10,0,19,8,-3,16,5,23,12,1,20,9,-1,18,7,-5,13,3,22,10,0,19,8,-4,15,4,-6,12,1,21,10,-2,17,6,-5,13,3,22,11,0,19,8}[y]+28?1:0);
return "Rat,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Goat,Monkey,Rooster,Dog,Pig".Split(',')[x%12]+" - "+"Metal,Water,Wood,Fire,Earth".Split(',')[x/2%5]+" - "+new[]{"Yang","Yin"}[x%2];
}

One of the tricks was to have the offset table's origin at 28-Jan.  This proved to have the lowest character count.
If by chance it is insisted the input is a string, add 22 characters to change the method signature to:
string Z(string i){

and add the line:
var d=DateTime.Parse(i);

EDITS:

Put all strings in one array and added offsets to the output selectors.
Changed the day offset to 28-Jan.
string.Split() Inspiration taken from Eduard Florinescu's answer.
Inlined all arrays.  It only saved me 2 characters.  :-/

Save 5 characters by changing " - "+new[]{"Yang","Yin"}[x%2] to " - Y"+(x%2<1?"ang":"in") :)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/