text:
Rosetta Stone Challenge: What's Average Anyways?
The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism!
The Challenge
When people use the term "average," they generally mean the arithmetic mean, which is the sum of the numbers divided by the number of numbers.  There are, however, many more meanings to the word "mean," including the harmonic mean, the geometric mean, the arithmetic mean, the quadratic mean, and the contraharmonic mean.
Your challenge is to write a program which inputs a list of numbers and outputs those 5 different means.  Additionally, you are trying to write programs in as many languages as possible. You are allowed to use any sort of standard library function that your language has, since this is mostly a language showcase.
Input
Input will be a list of positive numbers.
1,2,3,4,5
1.7,17.3,3.14,24,2.718,1.618
8.6
3,123456
10.1381,29.8481,14.7754,9.3796,44.3052,22.2936,49.5572,4.5940,39.6013,0.9602
3,4,4,6.2,6.2,6.2

Output
Output will be the five means in the order listed above (harmonic, geometric, arithmetic, quadratic, contraharmonic).  Conveniently, this is the same as increasing order.
2.18978,2.6052,3,3.31662,3.66667
3.01183,4.62179,8.41267,12.2341,17.7915
8.6,8.6,8.6,8.6,8.6
5.99985,608.579,61729.5,87296.6,123453.
5.95799,14.3041,22.5453,27.9395,34.6243
4.5551,4.74682,4.93333,5.10425,5.28108

There will be some reasonable leniency in I/O format, but I do want several decimal places of accuracy.  Since I want floating-point output, you can assume floating-point input.
The Objective Winning Criterion
As for an objective winning criterion, here it is: Each language is a separate competition as to who can write the shortest entry, but the overall winner would be the person who wins the most of these sub-competitions. This means that a person who answers in many uncommon languages can gain an advantage. Code-golf is mostly a tiebreaker for when there is more than one solution in a language: the person with the shortest program gets credit for that language.
If there is a tie, the winner would be the person with the most second-place submissions (and so on).
Rules, Restrictions, and Notes
Your program can be written in any language that existed prior to September 2th, 2014. I will also have to rely on the community to validate some responses written in some of the more uncommon/esoteric languages, since I am unlikely to be able to test them.
Please keep all of your different submissions contained within a single answer.
Also, no shenanigans with basically the same answer in a slightly different language dialects. I will be the judge as to what submissions are different enough.

Current Leaderboard
This section will be periodically updated to show the number of languages and who is leading in each.

Algoid (337) - Beta Decay
APL (42) - algorithmshark
Awk (78) - Dennis
BBC BASIC (155) - Beta Decay
C (136) - Dennis
C++ (195) - Zeta
C# (197) - Martin Büttner
CJam (43) - Dennis
Clojure (324) - Michael Easter
Cobra (132) - Ourous
CoffeeScript (155) - Martin Büttner
Commodore BASIC (104) - Mark
Common Lisp (183) - DLosc
Erlang (401) - Mark
Fortran (242) - Kyle Kanos
Fortran 77 (286) - Beta Decay
GNU bc (78) - Dennis
GolfScript (83) - Dennis
Groovy (157) - Michael Easter
Haskell (140) - Zeta
J (28) - algorithmshark
Java (235) - Michael Easter
JavaScript (ES6) (112) - Dennis
JRuby (538) - Michael Easter
Julia (79) - Martin Büttner
Lua (113) - AndoDaan
Mathematica (65) - Martin Büttner
Matlab (63) - Martin Büttner
Octave (68) - Dennis
Openscript (849?) - COTO
Pascal (172) - Mark
Perl (76) - Grimy
PHP (135) - Dennis
POV-Ray 3.7 (304) - Mark
Prolog (235) - DLosc
Pyth (52) - Dennis
Python 2 (96) - Dennis
Python 3 (103) - DLosc
Q (53) - algorithmshark
Q'Nial (68) - algorithmshark
QBasic (96) - DLosc
R (91) - plannapus
Ruby (118) - Martin Büttner
Rust (469) - Vi.
Scala (230) - Michael Easter
T-SQL (122) - MickyT
TI-Basic (85) - Ypnypn
TypeScript (393) - rink.attendant.6
VBA (Excel) (387) - Stretch Maniac
wxMaxima (134) - Kyle Kanos

Current User Rankings

Dennis (10)
Martin Büttner (6)
Michael Easter (5)
Mark, DLosc, algorithmshark (4)
Beta Decay (3)
Zeta, Kyle Kanos (2)
Ourous, AndoDaan, COTO, Grimy, plannapus, Vi., MickyT, Ypnypn, rink.attendant.6, Stretch Maniac (1)

(If I made a mistake in the above rankings, let me know and I'll fix it.  Also, the tiebreaker has not been applied yet.)

When you say you're lenient on I/O, does that mean functions are allowed, too, or does everything have to be a program (as far as that notion makes sense in some languages)?

You missed my favourite mean: the logarithmic mean (a-b)/ln(a/b). I'll admit that only today did I find out how it generalises to a sample set of more than two :-) http://en.wikipedia.org/wiki/Logarithmic_mean

Somebody should really write the Perl code... (then I could plageri... be inspired to implement it in Befunge'98 with the 0"LREP"4( fingerprint)... (win/win)...

I wonder if you should count ECMAScript 5 and ECMAScript separately. Any ES5 answer is bound to be much, much longer.

It will be tricky to enforce "I do want several decimal places of accuracy". At the very least, consider requiring a sample run against the test data.

September 2th, eh?

Would you accept an entry in Labview? Not sure how you define "short"...

Also - when it comes to built in commands in Linux, do you consider bc, awk etc to be "languages" or "commands" - so would the different ways to implement this from a shell be counted at different languages?

@Floris If in doubt: http://meta.codegolf.stackexchange.com/a/2073/8478

@Floris How would you measure the length of a Labview program?

@BetaDecay - interesting question. I suppose you could look at the size of the binary file?

Languages: 1
Openscript (many hundreds)
(My favourite obscure and sadly defunct programming language, because I learned to program on it many years ago. ;)
openFile "inputs.txt"
readFile "inputs.txt" to EOF

put it into my input_string

closeFile "inputs.txt"

local inputs[]

fill the inputs with my input_string in [item] order

put 0 into the harmonic_mean
put 0 into the geometric_mean
put 0 into the arithmetic_mean
put 0 into the quadratic_mean

put the length of the inputs into n

step i from 1 to n
    get inputs[i]
    increment the harmonic_mean by 1/it
    increment the geometric_mean by log( it )
    increment the arithmetic_mean by it
    increment the quadratic_mean by it*it
end

get "outputs.txt"
createFile it

writeFile n/harmonic_mean                & "," to it
writeFile exp( geometric_mean/n )        & "," to it
writeFile arithmetic_mean/n              & "," to it
writeFile sqrt( quadratic_mean/n )       & "," to it
writeFile quadratic_mean/arithmetic_mean to it

closeFile it

put the length of the inputs into n? O_O I love this language already.

The syntax reminds me of Chef.

The syntax reminds me of COBOL.

That is a beautiful-looking language!

@DLosc Try applescript if you like poetic languages...

For an even more extreme (and usage specific) "natural" looking language, check out Inform 7.

@Beska I wouldn't really call Inform a programming language...

@Beta A quick search shows that it is turing complete, which seems like a very reasonable standard for "programming language". A very strange one though. Their hello world program...

inform 7 is a real language - it's just that the I/O is a text adventure.  People have written chess engines in it and Dijkstra's shortest path is at: http://en.literateprograms.org/Dijkstra's_algorithm_(Inform_7)

Languages: 13
I think this list should now contain every programming language that I know sufficiently well to solve at least simple problems in. I'll try to keep this list complete over time as I look into some new languages. (I used to know some Smalltalk and Delphi, but I'd have to look up to much for adding them to feel right.)
C, 196 190 171 165 bytes
main(int c,char**v){float n=c-1,x,h,g=1,q,a=h=q=0;for(;c-1;h+=1/x,g*=pow(x,1/n),a+=x/n,q+=x*x/n)sscanf(v[--c],"%f",&x);printf("%f,%f,%f,%f,%f",n/h,g,a,sqrt(q),q/a);}

Reads the input as individual command line arguments and writes a comma-separated list of the means to STDOUT.
Thanks for some improvements to Quentin.
C++, 200 bytes
This is the same as the above C code, plus two includes. I'm including this because it's longer than the winning C++ submission, so I guess no harm is done, and I'd like this post to actually contain every language I know. :)
#include <cmath>
#include <cstdio>
main(int c,char**v){float n=c-1,x,h,g=1,q,a=h=q=0;for(;c-1;h+=1/x,g*=pow(x,1/n),a+=x/n,q+=x*x/n)sscanf(v[--c],"%f",&x);printf("%f,%f,%f,%f,%f",n/h,g,a,sqrt(q),q/a);}

C#, 220 197 bytes
namespace System{using Linq;class F{double[]f(double[]l){double n=l.Length,a=l.Sum()/n,q=l.Sum(x=>x*x)/n;return new[]{n/l.Sum(x=>1/x),l.Aggregate((p,x)=>p*Math.Pow(x,1.0/n)),a,Math.Sqrt(q),q/a};}}}

Defines a function in a class taking a List of doubles and returning an array of doubles with the five means.
Thanks for some improvements to Visual Melon and Bob.
CJam, 52 bytes
ea_,:L;:d_Wf#:+L\/\_:*1Ld/#\_:+L/:A\2f#:+L/:QmqQA/]p

Takes the input as command-line arguments and prints a list with the five values to STDOUT.
CoffeeScript, 155 bytes
This is almost the same as the JavaScript solution further down (and initially I didn't count it for that reason), but the OP included it in the scoreboard anyway, so I promoted it to a full submission. They are technically different languages after all.
f=(l)->l.r=l.reduce;n=l.length;[n/l.r(((s,x)->s+1/x),0),Math.pow(l.r(((p,x)->p*x),1),1/n),a=l.r(((s,x)->s+x),0)/n,Math.sqrt(q=l.r(((s,x)->s+x*x),0)/n),q/a]

JavaScript (ES6), 155 153 bytes
f=l=>{l.r=l.reduce;n=l.length;return[n/l.r((s,x)=>s+1/x,0),Math.pow(l.r((p,x)=>p*x,1),1/n),a=l.r((s,x)=>s+x,0)/n,Math.sqrt(q=l.r((s,x)=>s+x*x,0)/n),q/a]}

Defines a function taking a array of numbers and returning a array with the five means.
Thanks for some improvements to William Barbosa.
Julia, 79 bytes
f(l)=(n=length(l);[n/sum(1/l),prod(l)^(1/n),a=mean(l),q=norm(l)/sqrt(n),q*q/a])

Defines a function taking a list of numbers and returning a list with the five means.
Lua, 120 bytes
f=function(l)h=0;q=0;a=0;g=1;for i=1,#l do x=l[i]h=h+1/x;a=a+x/#l;g=g*x^(1/#l)q=q+x*x/#l end;return#l/h,g,a,q^.5,q/a end

Defines a function taking a list of numbers and returning 5 separate values for the means.
Mathematica, 73 67 65 bytes
f[l_]:={1/(m=Mean)[1/l],GeometricMean@l,a=m@l,Sqrt[q=m[l*l]],q/a}

Defines a function taking a list of floating point numbers and returning a list with the five means.
Fun fact: Mathematica has all 5 means built in (and that was my original submission), but three of them can be implemented in fewer characters than their function names.
Matlab, 65 63 bytes
l=input('');a=mean(l);q=rms(l);harmmean(l)
geomean(l)
a
q
q*q/a

Requests the input as an array of numbers from the user and outputs the five means individually.
Thanks for some improvements to Dennis Jaheruddin.
PHP ≥ 5.4, 152 149 143 bytes
function f($l){$g=1;$n=count($l);foreach($l as$x){$q+=$x*$x/$n;$h+=1/$x;$g*=pow($x,1/$n);}return[$n/$h,$g,$a=array_sum($l)/$n,sqrt($q),$q/$a];}

Same functional implementation as the earlier ones.
Thanks for some improvements to Ismael Miguel.
Python 2, 127 bytes
def f(l):n=len(l);a=sum(l)/n;q=sum(x*x for x in l)/n;return[n/sum(1/x for x in l),reduce(lambda x,y:x*y,l)**(1./n),a,q**.5,q/a]

Same functional implementation as the earlier ones.
Ruby, 129 118 bytes
f=->l{n=l.size
r=->l{l.reduce :+}
[n/r[l.map{|x|1/x}],l.reduce(:*)**(1.0/n),a=r[l]/n,(q=r[l.map{|x|x*x}]/n)**0.5,q/a]}

Same functional implementation as the earlier ones.

I realize this is quite after the fact, but you can lose 3 Julia bytes by using norm(l)/n^.5 in place of norm(l)/sqrt(n).

4 languages
J - 32 28 char!
A function taking the list of numbers as its sole argument.
%a,^.a,[a(,,]%%)*:a=.+/%#&.:

a here is an adverb, which is J's take on second-order functions.

+/ % # is a train in J, meaning Sum Divided-by Count, the definition of the arithmetic mean.
&.: is a conjunction called Under, where u&.:v(y) is equivalent to vi(u(v(y))) and vi is the functional inverse of v. Yes, J can take functional inverses.
Finally, a useful feature of J is that certain functions can automatically loop over lists, because J knows to apply them pointwise if it wouldn't make sense to apply them on the whole argument. So the square of a list is a list of the squares, for instance.

Thus a takes a function on the left, and returns a mean that "adjusts" the values by the function, takes the arithmetic mean, and then reverses the adjustment afterwards.

%a is the harmonic mean, because % means Reciprocal, and is its own inverse.
^.a is the geometric mean, because ^. is the natural logarithm and its inverse is the exponential. (Π x)^(1/n) = exp(Σ log(x)/n)
[a is the arithmetic mean, because [ is the identity function.
*:a is the quadratic mean, because *: is Square, and its inverse is the square root.
The contraharmonic gives us a whole host of trouble—mean of the squares divided by mean—so we do a little math to get it: (*:a divided by ([a divided by *:a)). This looks like [a(]%%)*:a. While we're at it, we prepend each of the means, [a(,,]*%~)*:a.

Finally, we use commas to append the rest of the results together. We require no further parens because concatenation is (in this case at least) associative.
In use at the J REPL:
   (%a,^.a,[a(,,]%%)*:a=.+/%#&.:) 1,2,3,4,5   NB. used inline
2.18978 2.60517 3 3.31662 3.66667
   f =: %a,^.a,[a(,,]%%)*:a=.+/%#&.:          NB. named
   f 1.7,17.3,3.14,24,2.718,1.618
3.01183 4.62179 8.41267 12.2341 17.7915
   f 8.6
8.6 8.6 8.6 8.6 8.6
   f 3,123456
5.99985 608.579 61729.5 87296.6 123453
   f 10.1381,29.8481,14.7754,9.3796,44.3052,22.2936,49.5572,4.5940,39.6013,0.9602
5.95799 14.3041 22.5453 27.9395 34.6243
   f 3,4,4,6.2,6.2,6.2
4.5551 4.74682 4.93333 5.10425 5.28108

Q - 53 char
Single argument function. We just make a list of all the means we want.
{s:(a:avg)x*x;(1%a@1%x;exp a log x;a x;sqrt s;s%a x)}

The same thing in other versions of k is below.

k4, 51 char: {s:(a:avg)x*x;(%a@%x;exp a log x;a x;sqrt s;s%a x)}
k2, 54 char: {s:(a:{(+/x)%#x})x*x;(%a@%x;(*/x)^%#x;a x;s^.5;s%a x)}

APL - 42 char
Function taking list as argument.
{(÷M÷⍵)(*M⍟⍵)A(S*.5),(S←M⍵*2)÷A←(M←+/÷≢)⍵}

Explained by explosion:
{                                         } ⍝ function with argument ⍵
                                   +/÷≢     ⍝ Sum Divide Length, aka mean
                                 M←         ⍝ assign function to M for Mean
                              A←(M     )⍵   ⍝ arithmetic Mean, assign to A
                     (S←M⍵*2)               ⍝ Mean of squares, assign to S
                      S      ÷A             ⍝ S divide A, aka contraharmonic mean
              (S*.5)                        ⍝ sqrt(S), aka quadratic mean/RMS
                    ,                       ⍝ concatenate into a list
             A                              ⍝ prepend A (APL autoprepends to lists)
        *M⍟⍵                                ⍝ exp of Mean of logs, aka geometric
       (    )                               ⍝ prepend (auto)
  ÷M÷⍵                                      ⍝ recip of Mean of recips, aka harmonic
 (    )                                     ⍝ prepend (auto)

Q'Nial - 68 char
You're going to love this one.
op\{$is/[+,tally];^is$*[pass,pass];[1/$(1/),exp$ln,$,sqrt^,/[^,$]]\}

Q'Nial is another array-oriented language, an implementation of Nial, which is based on an obscure Array Theory in the sam way Haskell is based on category theory. (Get it here.) It's very different from any of the other three—it parses left-to-right, first of all!—but it is still more related to them than to any other languages.

I knew there was a better way to do this in APL. So I can deference a variable I defined at its right; wouldn't have thought of that myself... -- That J code is impressive! Every time I see one of your answers, I say to myself You have to learn that language., but then I start reading some documentation/tutorial and I suddenly don't know if I'm in English class or at a train station... :P

@Dennis Yeah, APL/J/K assignments return values (most of the time!). And thanks. :) When learning J, it can start to get confusing as to what corresponds to what parts of your home language, so Iverson essentially banned the F-word (function) when writing the docs to try to force you to start fresh. Rolling with it and coming up with your own analogy later is the easiest way to do it.

I still maintain APL is by far the most readable array language. So much for "write-only" snarks! Too bad GNU APL does not support any of the modern syntax (nested D-funs, lexical scoping, conditional return, hooks and trains… hell, it chokes on /⍨) It was probably meant for porting really old code. What do you use? Dyalog? NARS2000? I think it's really unfortunate that J took the ASCII noise approach. That language's implementation is otherwise a work of genius. But I can't be bothered to mentally parse ]a(,,]*%~)*:a

@Tobia I briefly used Dyalog, but I actually barely know enough APL to get by. I'm a J/K fanboy mostly because ASCII is portable, and the rank models make more sense than APL's. ([0.5]? Ew.) With practice, you get used to tacit J, though. It gets far worse than this.

12 languages

CJam, 45 44 43 bytes
q~:Q,:LQWf#:+/Q:*LW##Q:+L/_Q2f#:+L/_mq\@/]`

Reads an array of floats (e.g., [1.0 2.0 3.0 4.0 5.0]) from STDIN. Try it online.

APL, 67 61 53 52 50 bytes
{(N÷+/÷⍵)(×/⍵*÷N)A(Q*÷2),(Q←+/(⍵*2)÷N)÷A←+/⍵÷N←⍴⍵}

Try it online.

Pyth, 55 52 bytes
JyzKlJ=YcsJK=Zcsm^d2JK(cKsmc1kJ ^u*GHJc1K Y ^Z.5 cZY

Reads space-separated numbers (e.g., 1 2 3 4 5) from STDIN.

Octave, 68 bytes
#!/usr/bin/octave -qf
[mean(I=input(''),"h") mean(I,"g") a=mean(I) q=mean(I.*I)**.5 q*q/a]

Not counting the shebang. Reads an array (e.g., [1 2 3 4 5]) from STDIN.

GNU bc, 78 bytes
#!/usr/bin/bc -l
while(i=read()){h+=1/i;g+=l(i);a+=i;q+=i*i;n+=1}
n/h;e(g/n);a/n;sqrt(q/n);q/a

Counting the shebang as 1 byte (-l switch). Reads whitespace separated floats from STDIN, followed by a zero.

Awk, 78 bytes
#!/usr/bin/awk -f
{h+=1/$0;g+=log($0);a+=$0;q+=$0^2;n++}END{print n/h,exp(g/n),a/n,(q/n)^.5,q/a}

Not counting the shebang. Reads one number per line from STDIN.

GolfScript, 86 83 bytes
n%{~.2.-1:$??./*\`,10\?/\+\;}%..,:^0@{$?+}//p.{*}*^$??p.{+}*^/.p\0\{.*+}/^/.2$??p\/

GolfScript has no built-in support for floats, so the code is parsing them. Therefore, the input format is rather restrictive: you must input 1.0 and 0.1 rather than 1, 1. or .1.
Reads floats (as explained above) one by line, from STDIN. Try it online.

Perl, 90 85 bytes
#!/usr/bin/perl -n
$h+=1/$_;$g+=log;$a+=$_;$q+=$_**2}{$,=$";print$./$h,exp$g/$.,$a/$.,($q/$.)**.5,$q/$a

Counting the shebang as 1 byte (-n switch). Reads one number per line from STDIN.

Python 2, 102 96 bytes
#!/usr/bin/python
h=a=q=n=0;g=1
for i in input():h+=1/i;g*=i;a+=i;q+=i*i;n+=1
print n/h,g**n**-1,a/n,(q/n)**.5,q/a

Not counting the shebang. Reads a list of floats (e.g., 1.0,2.0,3.0,4.0,5.0) from STDIN.

ECMAScript 6 (JavaScript), 114 112 bytes
m=I=>{for(g=1,h=a=q=n=0,p=Math.pow;i=I.pop();h+=1/i,g*=i,a+=i,q+=i*i)n++;
return[n/h,p(g,1/n),a/n,p(q/n,.5),q/a]}

Not counting the LF. Expects an array (e.g., [1,2,3,4,5]) as argument.

PHP, 135 (or 108?) bytes
#!/usr/bin/php
<?for($c=1;$c<$argc;$c++){$i=$argv[$c];$h+=1/$i;$g+=log($i);$a+=$i;$q+=$i*$i;$n++;}
print_r([$n/$h,exp($g/$n),$a/$n,sqrt($q/$n),$q/$a]);

Not counting shebang or LF. Reads floats as command-line arguments.
I have a shorter solution, but I don't know how to count the bytes:
php -R '$i=$argn;$h+=1/$i;$g+=log($i);$a+=$argn;$q+=$i^2;$n++;' \
-E 'print_r([$n/$h,exp($g/$n),$a/$n,sqrt($q/$n),$q/$a]);'

Counting the bytes in each code string and adding two for -R and -E, this approach would score 108.

C, 172 140 139 137 136 bytes
float i,h,g=1,a,q,n;main(){for(;scanf("%f",&i)+1;n++)h+=1/i,g*=i,a+=i,q+=i*i;
printf("%f %f %f %f %f",n/h,pow(g,1/n),a/n,sqrt(q/n),q/a);}

Not counting the LF. Compile with gcc -lm. Reads whitespace separated floats from STDIN.

You can save one byte in C: while(cond)...,n++; vs for(;cond;n++)...;

Do we really need to include shebang lines in our counts?

@OregonTrail: I've included the shebangs in the code since it's easier than explaining run this as interpreter switches script for every submission. Convention is that shebang lines are not counted, unless the contain non-default switches. As stated in my answer, I've counted #!/usr/bin/awk -f as zero bytes (-f means read program from file), but #!/usr/bin/perl -n as one byte (-n means iterate over input lines).

Shouldn't you count -q for Octave and -lm for C?

-q is just to quiet output. -lm is needed by GCC. Other compilers may noy require it.

J (50):
This is the sort of thing J is good at:
(#%+/@:%),(#%:*/),(+/%#),%:@(%@#*+/@:*:),+/@:*:%+/

As always: an explosion in the smiley factory. However, some of the smileys were left intact this time around: :) and :*: (that's a guy with four eyes and a gem embeded in his face)
My interactive session that was used to create this: http://pastebin.com/gk0ksn2b
In action:
   f=:(#%+/@:%),(#%:*/),(+/%#),%:@(%@#*+/@:*:),+/@:*:%+/
   f 1,2,3,4,5
2.18978 2.60517 3 3.31662 3.66667
   f 1.7,17.3,3.14,24,2.718,1.618
3.01183 4.62179 8.41267 12.2341 17.7915
   f 8.6
8.6 8.6 8.6 8.6 8.6
   f 3,123456
5.99985 608.579 61729.5 87296.6 123453
   f 10.1381,29.8481,14.7754,9.3796,44.3052,22.2936,49.5572,4.5940,39.6013,0.9602
5.95799 14.3041 22.5453 27.9395 34.6243
   f 3,4,4,6.2,6.2,6.2
4.5551 4.74682 4.93333 5.10425 5.28108

Explanation:
As you might expect, there are actually 5 functions that are bundled into a list with a train of forks and hooks. (Don't worry about it, it's just a convenient way of making multiple functions output to a single list).
The lines that I used to make J generate this answer might be a bit clearer:
   f=:harmonic , Geometric , arithmatic , rms , contraharmonic
   f
harmonic , Geometric , arithmatic , rms , contraharmonic
   f f.
(# % +/@:%) , (# %: */) , (+/ % #) , %:@(%@# * +/@:*:) , +/ %~ +/@:*:

Let's look at them separately.
Harmonic
(# % +/@:%)

# - Length (of the array)
% - Divided by
+/@:% - The sum (+/, or fold + in the array (+/1 2 3 4 == 1+2+3+4)) atop divide, but this time in the monadic case. What this means here, is that J automatically "guesses" that 1 would be the most useful value.

Geometric
(# %: */)

# - Length (of the array)
%: - Root (4 %: 7 would mean 'the fourth (or tesseract) root of seven)
*/ - Product (*/ is similar in meaning to +/, see the previous function for this)

Arithmetic
(+/ % #)

+/ - sum, should be familiar now
% - divided by
# - Lenght

Root mean square
%:@(%@# * +/@:*:)

Ehm, yeah...

%: - The root of

%@# - The inverse of the lenght
* - Times
+/@:*: - The sum of the squares (*: is squared, even though *~ is as well.)

Contraharmonic
+/@:*: % +/

+/@:*: - The sum of the squares
% - divided by
+/ - the sum.

 I actually found out that my function was one byte two bytes too long by explaining this, so that's good!

If J were just this good at processing strings, we'd be winning a lot more golfing competitions...

Is that RegEx?? :P

@LittleChild Nope. It's J. (http://jsoftware.com)

@LittleChild: Be glad it's not APL

J certainly does a great job in both terseness and in the smiley department -- I also found %) and :@( ...

Languages: 3
Unless noted otherwise, numbers need to be seperated by space.
C: 181 163
Takes numbers till end of input.

#include<math.h>
main(){double h=0,g=1,a=0,q=0,k,n=0;for(;scanf("%lf",&k);++n)h+=1/k,g*=k,a+=k,q+=k*k;printf("%f %f %f %f %f\n",n/h,pow(g,1/n),a/n,sqrt(q/n),q/a);}

(ISO) C++: 195
Takes numbers till end of input.

#include<iostream>
#include<cmath>
int main(){double h=0,g=1,a=0,q=0,k,n=0;for(;std::cin>>k;++n)h+=1/k,g*=k,a+=k,q+=k*k;std::cout<<n/h<<" "<<pow(g,1/n)<<" "<<a/n<<" "<<sqrt(q/n)<<" "<<q/a<<"\n";}

Haskell: 185 180 164 159 149 140
Takes arbitrarily many lists of numbers seperated by newline.
Implementation
m=map
f x=let{s=sum;n=s$m(\_->1)x;t=s$m(^2)x}in[n/s(m(1/)x),product x**(1/n),s x/n,sqrt$t/n,t/s x]
main=getLine>>=print.f.m read.words>>main

50 41 (thanks shiona) bytes are just for IO :/.
Example
(Powershell's echo aka Write-Output prints every parameter on a single line)

PS> echo "1 2 3 4 5" "1.7 17.3 3.14 24 2.718 1.618" | runhaskell SO.hs
[2.18978102189781,2.605171084697352,3.0,3.3166247903554,3.6666666666666665]
[3.011834514901806,4.621794669196026,8.412666666666668,12.234139719108438,17.791525635945792]

you should be able to inline some of the definitions in the haskell answer. for example, instead of writing ;c=t/a in the let clause, write [h,g,a/z,r,t/a] after the in.

@proudhaskeller: Good point, thanks!

also, writing s$m(1/)x is shorter than s.m(1/)$x, as is s$m(^2)x.

@proudhaskeller: Again thanks. One can probably tell that the code gradually evolved from a non-golfed version. Also replaced fromIntegral.length$x with foldr(\_ x->x+1)0x.

nice trick! but now that you made me look at it, i found this: s$m(const 1)x.

@proudhaskeller: Good find, which brought me to s$m(\_->1)x.

You should be able to omit the include for stdio.h.

If ending in an error is not a problem (AFAIK it usually isn't in codegolf), you can change your Haskell IO to a slightly shorter main=getLine>>=print.f.m read.words>>main.

Languages: 5
POV-Ray 3.7 Scene Description Language: 304 bytes
#fopen I"i"read#declare S=0;#declare N=0;#declare Q=0;#declare P=1;#declare R=0;#while(defined(I))#read(I,V)#declare S=S+V;#declare N=N+1;#declare Q = Q+V*V;#declare P=P*V;#declare R=R+1/V;#end#warning concat(str(N/R,0,5),",",str(pow(P,1/N),0,5),",",str(S/N,0,5),",",str(sqrt(Q/N),0,5),",",str(Q/S,0,5))

(POV-Ray SDL doesn't have console input functions, so I've substituted file input.  Output is to the console, but is surrounded by a good deal of program status output.)
Commodore BASIC: 111 104 bytes
1 P=1:O┐1,0
2 I/#1 V:IF V=0T|G┌4
3 S=S+V:N=N+1:Q=Q+V*V:P=P*V:R=R+1/V:G┌2
4 ?N/R,P↑(1/N),S/N,(Q/N)↑.5,Q/S

(Not all of the characters in this program can be represented in Unicode.  | is used to represent SHIFT+H, ┌ represents SHIFT+O, ┐ represents SHIFT+P, / represents SHIFT+N.  Because of the limitations in Commodore Basic I/O, the input is entered one number at a time, with an input of -1 to indicate the end of input.  Output is tab-delimited.)
QBasic: 96 bytes
P=1:INPUT V:WHILE V:S=S+V:N=N+1:Q=Q+V*V:P=P*V:R=R+1/V:INPUT V:WEND:?N/R;P^(1/N);S/N;(Q/N)^.5;Q/S

Uses the same I/O scheme as DLosc's entry; I golfed 15 bytes off by using the fact that INPUT V returns 0 (which evaluates to false) when an empty line is input (at least in MS-DOS QBasic 1.1 -- I don't know if it also works in QB64).
Pascal (FPC compiler): 172 bytes
program M;uses math;var v,p,s,n,q,r:real; begin p:=1;while not eoln do begin read(v);s:=s+v;n:=n+1;q:=q+v*v;p:=p*v;r:=r+1/v end;write(n/r,p**(1/n),s/n,(q/n)**0.5,q/s);end.

The input is separated by spaces, not commas, and is newline terminated.  Output is space-separated.
Erlang: 401 bytes
-module(means).
-import(io).
-import(math).
-import(string).
-import(lists).
-export([means/6]).

means(S,N,Q,P,R,[]) -> io:fwrite("~f,~f,~f,~f,~f~n", [N/R,math:pow(P,(1/N)),S/N,math:sqrt(Q/N),Q/S]);
means(S,N,Q,P,R,[V|T]) -> means(S+V,N+1,Q+V*V,P*V,R+1/V,T).

means:means(0,0,0,1,0,lists:map(fun({F,R}) -> F end, lists:map(fun(X) -> string:to_float(X) end, string:tokens(io:get_line(""), ",\n")))).

String handling in Erlang is a royal pain.  Consequently, all floating-point numbers must be entered with at least one digit after the decimal point -- string:to_float/1 will not convert 1, but will convert 1.0.
(More to come, especially if I figure out how to do this in RoboTalk, a language with neither floating-point operations nor I/O)

I loved my Commodore 64

Ditto ... and the amiga

A fellow QBasic fan! I independently came up with the same thing after realizing that we didn't have to handle 0 as a valid input. ;) I see you've used (Q/N)^.5 to my SQR(q/n), but that doesn't affect the length. Maybe we could share the lead? (I make the byte count 96, not including the trailing newline.)

@DLosc, My byte counter (wc) includes the trailing newline, which I suppose gives us both the lead -- at least until I figure out how to get rid of that duplicate INPUT V.

Good luck.  :^)  I tried some fancy stuff with GOTOs instead of the loop, but couldn't get any further reduction.

Languages - 4
I always love an excuse to pull out good old
QBasic, 112 96 bytes
g=1:INPUT x:WHILE x:h=h+1/x:g=g*x:a=a+x:q=q+x^2:n=n+1:INPUT x:WEND:?n/h;g^(1/n);a/n;SQR(q/n);q/a

QBasic isn't good with variable numbers of inputs, so the program requires one number per line, terminated with 0 or an empty line.  Output is separated with spaces.
(Shortened once I realized that 0 isn't a valid number and can be used for input termination.)
Tested using QB64:

Common Lisp, 183 bytes
(defun m(l)(let((a(apply #'+ l))(q(apply #'+(map'list #'(lambda(x)(* x x))l)))(n(length l)))(list(/ n(apply #'+(map'list #'/ l)))(expt(apply #'* l)(/ n))(/ a n)(sqrt(/ q n))(/ q a))))

For some reason I expected this to be shorter.  I'm not any kind of Lisp expert, so tips are appreciated.  Ungolfed version:
(defun means (l)
  (let ((a (apply #'+ l))                                    ; sum of numbers
        (q (apply #'+ (map 'list #'(lambda (x) (* x x)) l))) ; sum of squares
        (n (length l)))
    (list                                 ; Return a list containing:
      (/ n (apply #'+ (map 'list #'/ l))) ; n over sum of inverses
      (expt (apply #'* l) (/ n))          ; product to the power of 1/n
      (/ a n)                             ; a/n
      (sqrt (/ q n))                      ; square root of q/n
      (/ q a)                             ; q/a
    )
  )
)

Probably the best way to test is by pasting the function into the clisp REPL, like so:
$ clisp -q
[1]> (defun m(l)(let((a(apply #'+ l))(q(apply #'+(map'list #'(lambda(x)(* x x))l)))(n(length l)))(list(/ n(apply #'+(map'list #'/ l)))(expt(apply #'* l)(/ n))(/ a n)(sqrt(/ q n))(/ q a))))
M
[2]> (m '(1 2 3 4 5))
(300/137 2.6051712 3 3.3166249 11/3)
[3]> (m '(8.6))
(8.6 8.6 8.6 8.6 8.6)
[4]> (m '(3 123456))
(246912/41153 608.5787 123459/2 87296.58 5080461315/41153)

I love how Lisp uses exact fractions instead of floats when dividing two integers.
Prolog, 235 bytes
Prolog isn't great at math, but we're gonna use it anyway.  Tested with SWI-Prolog.  I think the sumlist predicate may not be standard Prolog, but whatever, I'm using it.
m(L,H,G,A,Q,C):-length(L,N),h(L,I),H is N/I,p(L,P),G is P^(1/N),sumlist(L,S),A is S/N,q(L,R),Q is sqrt(R/N),C is R/S.
p([H|T],R):-p(T,P),R is H*P.
p([],1).
q([H|T],R):-q(T,P),R is H*H+P.
q([],0).
h([H|T],R):-h(T,P),R is 1/H+P.
h([],0).

Ungolfed:
m(L, H, G, A, Q, C) :-
        length(L, N),   % stores the length into N
        h(L, I),        % stores the sum of inverses into I
        H is N/I,
        p(L, P),        % stores the product into P
        G is P^(1/N),
        sumlist(L, S),  % stores the sum into S
        A is S/N,
        q(L, R),        % stores the sum of squares into R
        Q is sqrt(R/N),
        C is R/S.

% Helper predicates:

% p calculates the product of a list
p([H|T], R) :-
        p(T, P),     % recursively get the product of the tail
        R is H*P.    % multiply that by the head
p([], 1).            % product of empty list is 1

% q calculates the sum of squares of a list
q([H|T], R) :-
        q(T, P),     % recursively get the sum of squares of the tail
        R is H*H+P.  % add that to the square of the head
q([], 0).            % sum of empty list is 0

% h calculates the sum of inverses of a list
h([H|T], R) :-
        h(T, P),     % recursively get the sum of inverses of the tail
        R is 1/H+P.  % add that to the inverse of the head
h([], 0).            % sum of empty list is 0

On Linux, with the code in a file called means.pro, test like this:
$ swipl -qs means.pro
?-  m([1,2,3,4,5],H,G,A,Q,C).
H = 2.18978102189781,
G = 2.605171084697352,
A = 3,
Q = 3.3166247903554,
C = 3.6666666666666665.

Gives a correct but rather amusing result when there's only one number:
 ?- m([8.6],H,G,A,Q,C).
 H = G, G = A, A = Q, Q = C, C = 8.6.

Python 3, 103 bytes
h=a=q=n=0;g=1
for x in eval(input()):h+=1/x;g*=x;a+=x;q+=x*x;n+=1
print(n/h,g**(1/n),a/n,(q/n)**.5,q/a)

Same strategy as Dennis's Python 2 version.  Takes a comma-separated list of numbers; handles both ints and floats.  A single-number input must be wrapped in square braces (and a list of numbers always may be); a fix would cost 4 bytes.

8 Languages
Fortran 77 - 286
      READ*,l
      b1=0
      b2=1
      b3=0
      b4=0
      DO 10 i=1,l
        READ*,j
        b1=b1+1/j
        b2=b2*j
        b3=b3+j
        b4=b4+j**2
   10 CONTINUE
      h=l/b1
      g=b2**(1/l)
      a=b3/l
      q=(b4/l)**0.5
      c=b4/b3
      PRINT*,h,g,a,q,c
      END

BBC BASIC - 131
INPUT l
b=0:d=1:e=0:f=0
FOR i=1 TO l
  INPUTj:b+=1/j:d*=j:e+=j:f+=j^2
NEXT l
h=l/b:g=d^(1/l):a=e/l:q=(f/l)^0.5:c=f/e
PRINTh,g,a,q,c

Output:
5
5
100
12
15
1
9.7914836236097695 26.600000000000001 45.596052460711988 78.15789473684211

C++ - 292
#include <iostream>
#include <cmath>
using namespace std;int main(){cout << "Length of sequence?: ";cin >> l;int b=0;int d=1;int e=0;int f=0;int j;int seq[l];for(int i=0;i<l;i++){cin >> j;b+=1/j;d*=j;e+=j;f+=pow(j,2);}
    h=l/b;g=pow(d,(1/l));a=e/l;q=pow((f/l),0.5);c=f/e;cout << h,g,a,q,c;}

Python 3 - 151
s=input().split(',');l=len(s);b=0;d=1;e=0;f=0
for i in s:i=float(i);b+=1/i;d*=i;e+=i;f+=i**2
h=l/b;g=d**(1/l);a=e/l;q=(f/l)**0.5;c=f/e
print(h,g,a,q,c)

Output:
5,100,12,15,1       # Input
3.6764705882352944 9.7914836236097695 26.600000000000001 45.596052460711988 78.15789473684211

Java - 421
class Sequences {
    public static void main( String[] args){
        System.out.println("Length of sequence?: ");Scanner reader = new Scanner(System.in);l=reader.nextInt();int b=0;int d=1;int e=0;int f=0;int j;int seq[l];
        for(int i=0;i<l;i++){j=reader.nextInt();b+=1/j;d*=j;e+=j;f+=Math.pow(j,2);}
        h=l/b;g=Math.pow(d,(1/l));a=e/l;q=Math.sqrt(f/l);c=f/e;System.out.println(h+' '+g +' '+ a+' '+q+' '+c);}}

Javascript - 231
I'm not a Javascripter so any tips would be greatly appreciated
console.log("Length of sequence?: ");
var l=readline(),b=0,d=1,e=0,f=0;
for(var i = 0;i<l;i++) {var j=readline();b+=1/j;d*=j;e+=j;f+=pow(j,2);}
h=l/b;g=pow(d,(1/l));a=e/l;q=sqrt(f/l);c=f/e;
console.log(h+' '+g+' '+a+' '+q+' '+c);

Algoid - 337
Look it up on the Google Play Store or the Raspberry Pi Store
text.clear();
set l=text.inputNumber("Length of sequence?: ");set b=0;set d=1;set e=0;set f=0;set seq=array{};
for(set i=1; i<=l; i++){set j=text.inputNumber(i..": ");b+=1/j;d*=j;e+=j;f+=math.pow(j,2);}
set h=l/b;set g=math.pow(d,(1/l));set a=e/l;set q=math.sqrt(f/l);set c=f/l;set str=h.." "..g.." "..a.." "..q.." "..c;text.output(str);

var'aQ - 376
This is syntactically correct and all, but all current interpreters just don't work...
0 ~ b cher
1 ~ d cher
0 ~ e cher
0 ~ f cher
'Ij mI'moH ~ l cher
l {
    'Ij mI'moH ~ j cher
    b 1 j wav boq ~ b cher
    d j boq'egh ~ d cher
    e j boq ~ e cher
    f j boqHa'qa boq ~ f cher
} vangqa'
l b boqHa''egh ~ h cher
d 1 l boqHa''egh boqHa'qa  ~ g cher
e l boqHa''egh ~ a cher
f l boqHa''egh loS'ar ~ q cher
f e boqHa''egh c cher
h cha'
g cha'
a cha'
q cha'
c cha'

You can save 1 character using sqrt(b4/l) instead of (b4/l)**0.5 and many more by using a,b,c,d instead of b1-4. You're also making me cry by using 77 instead of the more-modern F90+.

@Kyle Haha, I'll start learning F99 then

I'm more impressed by the fact that even after seeing the programming train that is Martin, you still decide to go for 6 (more?) languages... Nah, just kidding. I'm most impress by people knowing more than a couple of languages.

In JS, you can use comma operator to avoid repeating var: var l=readline(),b=0,d=1,e=0,f=0;. Not sure what readline function is, though.

@Oriol readline() is a way of getting console input.

You should be able to save some bytes by omitting Length of sequence? or at least making it shorter.

Languages: 3
CJam, 58
qS%:d:A{1\/}%:+A,\/SA:*1.A,/#SA:+A,/:BSA{2#}%:+A,/:CmqSCB/

TI-Basic, 85
Input L1:{dim(L1)/sum(1/(L1),dim(L1)√prod(L1),mean(L1),√(mean(L1²)),mean(L1²)/mean(L1

Java, 457
import java.util.*;class C{public static void main(String[]s){List r=new ArrayList();double[]d=Arrays.stream(new Scanner(System.in).nextLine().split(",")).mapToDouble(Double::new).toArray();double x=0,y,z;for(double D:d){x+=1/D;}r.add(d.length/x);x=1;for(double D:d){x*=D;}r.add(Math.pow(x,1./d.length));r.add(y=Arrays.stream(d).average().getAsDouble());x=1;for(double D:d){x+=D*D;}r.add(Math.sqrt(z=x/d.length));r.add(z/y);r.forEach(System.out::println);}}

Can you add the sample output for Java? How many decimal places of accuracy does it give compared to the output in OP?

Trivially shorter for TI-BASIC is {dim(Ans)/sum(Ansֿ¹),dim(Ans)√(prod(Ans)),mean(Ans),√(mean(Ans²)),mean(Ans²)/mean(Ans

Languages - 2
Cobra - 132
def f(l as number[])
    a,b,c,d=0d,1d,0d,0d
    for i in l,a,b,c,d=a+1/i,b*i,c+i,d+i**2
    print (e=l.length)/a,b**(1/e),c/e,(d/e)**0.5,d/c

Python - 129
def f(l):a,b,c=len(l),sum(i*i for i in l),sum(l);print(a/sum(1/i for i in l),eval('*'.join(map(str,l)))**(1/a),c/a,(b/a)**.5,b/c)

The Python version works in both Python 2 and 3, but note that the output format isn't exactly the same.

Languages: 5
Some entries strive to avoid rounding errors (to 4 decimal places), using Java's BigDecimal instead of float/double, and accept IO rules per OP.
Newer entries relax both IO rules and BigDecimal.
Groovy - 409 400 164 157 chars
float i=0,j=1,k=0,l,n=0,m=0,p;args.each{x=it as float;i+=1/x;j*=x;k+=x;m+=x*x;n++};l=k/n;p=m/n;println "${n/i},${Math.pow(j,1f/n)},$l,${Math.sqrt p},${p/l}"

sample run:
bash$ groovy F.groovy 10.1381 29.8481 14.7754 9.3796 44.3052 22.2936 49.5572 4.5940 39.6013 0.9602
5.957994213465398,14.304084339049883,22.545269,27.939471625408938,34.62429631138658

Java - 900 235 chars
class F{public static void main(String[]a){float i=0,j=1,k=0,l,n=0,m=0,p;for(String s:a){float x=Float.valueOf(s);i+=1/x;j*=x;k+=x;m+=x*x;n++;}l=k/n;p=m/n;System.out.println(n/i+","+Math.pow(j,1f/n)+","+l+","+Math.sqrt(p)+","+p/l);}}

sample run:
bash$ java F 10.1381 29.8481 14.7754 9.3796 44.3052 22.2936 49.5572 4.5940 39.6013 0.9602
5.957994,14.304084906138343,22.545269,27.939471625408938,34.6243

Clojure - 524 324 chars
(defn r[x](/ (reduce + 0.0 x)(count x)))
(defn s[x](reduce #(+ %1 (* %2 %2)) 0.0 x))
(defn f[x](let[n (* 1.0 (count x))][(/ n(reduce #(+ %1 (/ 1.0 %2)) 0.0 x))(Math/pow(reduce * x)(/ 1.0 n))(r x)(Math/sqrt(/(s x) n))(/(/(s x) n)(r x))]))
(doseq [x(f(map #(Float/valueOf %) *command-line-args*))](print(str x ",")))
(println)

sample run (it does have a trailing comma at the end):
bash$ java -jar clojure-1.6.0.jar m2.clj 10.1381,29.8481,14.7754,9.3796,44.3052,22.2936,49.5572,4.5940,39.6013,0.9602
5.957994368133907,14.30408424976292,22.545269936323166,27.93947151073554,34.62429460831333,

Scala - 841 663 230 chars
import java.math._
object F{def main(a:Array[String]){
var i,j,k,l,m,p=0f;var n=0
a.foreach{y=>var x=y.toFloat;i+=1/x;j*=x;k+=x;m+=x*x;n+=1}
l=k/n;p=m/n;System.out.println(n/i+","+Math.pow(j,1f/n)+","+l+","+Math.sqrt(p)+","+p/l)}}

sample run:
bash$ scala F.scala 10.1381 29.8481 14.7754 9.3796 44.3052 22.2936 49.5572 4.5940 39.6013 0.9602
5.957994,0.0,22.545269,27.939471625408938,34.6243

JRuby - 538 chars
It is unclear if JRuby differs from Ruby: this must run on the JVM. Yet it is Ruby syntax. Either way, I'm including it in the spirit of a Rosetta Stone.
require 'java'
java_import 'java.math.BigDecimal'
o=BigDecimal::ONE
z=BigDecimal::ZERO
def b(s) java.math.BigDecimal.new s end
def p(x,y) java.lang.Math::pow(x.doubleValue,y.doubleValue) end
def d(x,y) x.divide y,5,BigDecimal::ROUND_UP end
def r(x,n) d(x.inject(b(0)){|a,v|a.add v},n) end
def s(x) x.inject(b(0)){|a,v|a.add(v.multiply v)} end
x=[]
ARGV[0].split(",").each{|i|x<<b(i)}
n=b x.size
puts "#{d n,x.inject(z){|a,v|a.add(d o,v)}},#{p x.inject(o){|a,v|a.multiply v},d(o,n)},#{r(x,n)},#{p d(s(x),n),b("0.5")},#{d d(s(x),n),r(x,n)}"

sample run (does print a warning to stderr):
bash$ jruby Mean.rb 10.1381,29.8481,14.7754,9.3796,44.3052,22.2936,49.5572,4.5940,39.6013,0.9602
5.95781,14.30408436301878,22.54527,27.939471541172715,34.62430

1 Language
Golfscript, 162
n/:@,:^;'(1.0*'@'+'*+')/'+^+'('@'*'*+')**(1.0/'+^+')'+^'/(1.0/'+@'+1.0/'*+')'+'(1.0/'^+'*('+@'**2+'*+'**2))**0.5'+'('@'**2+'*+'**2)/'+4$+'*'+^+]{'"#{'\+'}"'+~}%n*

Yes, it's huge. And it can definitely be made smaller. Which I will do sometime later. Try it out here.
It expects the input to be newline separated. If that is not allowed, I'll fix it (+2 chars). It outputs the list newline separated.
Here's a slightly more readable version:
n/:@,:^;
'(1.0*'@'+'*+')/'+^+
'('@'*'*+')**(1.0/'+^+')'+
^'/(1.0/'+@'+1.0/'*+')'+
'(1.0/'^+'*('+@'**2+'*+'**2))**0.5'+
'('@'**2+'*+'**2)/'+4$+'*'+^+
]{'"#{'\+'}"'+~}%
n*

Looks like more Ruby than GolfScript. :P

@Dennis It is. ;-)

Why are you sorting the means?

@Dennis I don't need to? "Conveniently, the results will be in increasing order."

That's a comment, not a requirement. The harmonic mean is less or equal to the geometric mean, which is less or equal to the arithmetic mean, etc. By the way, you have a bug in your contraharmonic mean. The result should be l*l times higher, where l is the number of floats.

1 language

R, 92 91
f=function(x){n=length(x);s=sum;d=s(x^2);c(n/s(1/x),prod(x)^(1/n),mean(x),(d/n)^.5,d/s(x))}

Takes a vector of value and output a vector of means.

You can save a character if you use d=s(x^2) and replace the latter two uses of s(x^2) with d.

Languages 2
Fortran: 242
I've ungolfed it for clarity, but the golfed version is what is counted. you first need to input the number of values to be added, then the values.
program g
   real,allocatable::x(:)
   read*,i
   allocate(x(i));read*,x
   print*,m(x)
 contains
   function m(x) result(p)
      real::x(:),p(5)
      n=size(x)
     p(1:4)=[n/sum(1/x),product(x)**(1./n),sum(x)/n,sqrt(sum(x**2)/n)]
     p(5)=p(4)**2/p(3)
   endfunction
end

wxMaxima 134
Copy this into the editor, ctrl+enter and then call via m([1,2,3,4,5]),numer to get floating point output (otherwise you get symbolic output).
m(x):=block([n:length(x),d:0,c:mean(x)],for i:1 thru n do(g:x[i],d:d+g*g),return([1/mean(1/x),apply("*",x)^(1/n),c,sqrt(d/n),d/n/c]));

Maybe you could additionally include the golfed version, so people could check the count?

Perl, 86 76
$,=$";$h+=1/uc,$g+=log,$a+=lc,$q+=$_**2for<>;print$./$h,exp$g/$.,$a/$.,sqrt$q/$.,$q/$a

Input: one number per line.
EDIT: this is one character longer, but since apparently shebang lines aren’t counted toward the total, it ends up being better:
#!perl -pl
$"+=1/uc,$,+=log,$}+=lc,$;+=$_**2}for($./$",exp$,/$.,$}/$.,sqrt$;/$.,$;/$}){

It's customary to count a shebang containing two non-default switches as two bytes. That being said, very impressive solution!

T-SQL, 136 122
With the number lists stored in table S with I (integer) identifying the list and V (float) the value.
SELECT COUNT(*)/SUM(1/V),EXP(SUM(LOG(V))/COUNT(*)),AVG(V),SQRT((1./COUNT(*))*(SUM(V*V))),SUM(V*V)/SUM(V) FROM S GROUP BY I

SQLFiddle
Saved 14 thanks to Alchymist

Beat me to it on the SQL solution.  You can save quite a few characters on the last 2 with sqrt(sum(vv)/count()) and sum(v*v)/sum(v)
Also, in Oracle SQL, you can save another character as the function is ln rather than log.

@Alchymist Thanks a lot.  Face palm :)

Languages 1
lua - 113
e=arg s=#e h,g,a,r=0,1,0,0 for i=1,s do x=e[i]h=h+1/x g=g*x a=a+x/s r=r+x^2/s end print(s/h,g^(1/s),a,r^.5,r/a)

Languages - 1
 Groovy:
def input = [1.7,17.3,3.14,24,2.718,1.618];
def arithmeticMean
def harmonicMean
def geometricMean
def quadraticMean
def contraharmonicMean

def sum = 0
def product = 1
// Arithmetic Mean
for(each in input){
    sum += each
}
arithmeticMean = sum / input.size()

// Harmonic Mean
sum = 0
for(each in input){
    sum += (1/each)
}
harmonicMean = input.size() / sum

// Geometric Mean
for(each in input){
    product *= each
}
geometricMean = Math.pow(product,1/input.size());

// Quadratic Mean
sum = 0
for(each in input){
    sum += (each*each)
}
quadraticMean = Math.pow(sum/input.size() ,(1/2))

// Contraharmonic Mean
sum = 0
def sum2 = 0
for( each in input ){
    sum += each
    sum2 += (each * each)
}
contraharmonicMean = (sum2/input.size()) / (sum/input.size())

println "Arithmetic Mean: $arithmeticMean"
println "Harmonic Mean: $harmonicMean"
println "Geometric Mean: $geometricMean"
println "Quadratic Mean: $quadraticMean"
println "Contraharmoic Mean: $contraharmonicMean"

The aim is to write the shortest possible code for each language, so you probably want to use single-character identifiers and omit whitespace where possible.

@PeterTaylor Oh, okay! Didn't know that. New here.

@LittleChild Feel free to edit your code to be as short as possible. Don't forget to write the number of characters you used at the top of your post.

2 Languages
Java - 243 bytes
class M{public static void main(String[]a){float h=0,l=a.length,p=1,s=0,q=0;for(int i=0;i<l;i++){float v=Float.valueOf(a[i]);q+=v*v;s+=v;h+=1/v;p*=v;}System.out.println(l/h+"\n"+Math.pow(p,1.0/l)+"\n"+s/l+"\n"+Math.sqrt((1.0/l)*q)+"\n"+q/s);}}

expanded:
class Means {
    public static void main(String[] a) {
        float h = 0, l = a.length, p = 1, s = 0, q = 0;
        for (int i = 0; i < l; i++) {
            float v = Float.valueOf(a[i]);
            q += v * v;
            s += v;
            h += 1 / v;
            p *= v;
        }
        System.out.println(l / h + "\n" + Math.pow(p, 1.0 / l) + "\n" + s / l
                + "\n" + Math.sqrt((1.0 / l) * q) + "\n" + q / s);
    }
}

vba - excel, 387 bytes
Fill in values in the first column, then press the button (that triggers this code) and it outputs the values in the second column.
Private Sub a_Click()
Dim d,s,q,h,p As Double
Dim y As Integer
h=0
q=0
s=0
p=1
y=1
While Not IsEmpty(Cells(y,1))
s=s+Cells(y,1)
q=q+Cells(y,1)*Cells(y,1)
h=h+1/Cells(y,1)
p=p*Cells(y,1)
y=y+1
Wend
y=y-1
Cells(1,2)=y/h
Cells(2,2)=p^(1/y)
Cells(3,2)=s/y
Cells(4,2)=((1/y)*q)^0.5
Cells(5,2)=q/s
End Sub

1 language
Rust - 469
(rustc 0.11.0-pre (3851d68 2014-06-13 22:46:35 +0000))
use std::io;use std::from_str::from_str;use std::num;fn main(){loop{let a:Vec<f64>=io::stdin().read_line().ok().expect("").as_slice().split(',').map(|x|std::from_str::from_str(x.trim_chars('\n')).expect("")).collect();let n:f64=num::from_uint(a.len()).expect("");let s=a.iter().fold(0.0,|a,b|a+*b);let q=a.iter().fold(0.0,|a,b|a+*b* *b);println!("{},{},{},{},{}",n / a.iter().fold(0.0,|a,b|a+1.0/ *b),(a.iter().fold(1.0,|a,b|a**b)).powf(1.0/n),s/n,(q/n).sqrt(),q/s,);}}

Ungolfed version:
use std::io;
use std::from_str::from_str;
use std::num;

fn main() {
    loop {
        let a : Vec<f64>  = io::stdin().read_line().ok().expect("").as_slice().split(',')
                               .map(|x|std::from_str::from_str(x.trim_chars('\n')).expect("")).collect();
        let n : f64 = num::from_uint(a.len()).expect("");
        let s = a.iter().fold(0.0, |a, b| a + *b);
        let q = a.iter().fold(0.0, |a, b| a + *b * *b);
        println!("{},{},{},{},{}",
                 n / a.iter().fold(0.0, |a, b| a + 1.0 / *b),
                 (a.iter().fold(1.0, |a, b| a * *b)).powf(1.0/n),
                 s / n,
                 (q / n).sqrt(),
                 q / s,
                 );
    }
}

Compacted 430-byte version without loop or input, for testing in playrust:
use std::from_str::from_str;use std::num;fn main(){let a:Vec<f64>="1,2,3,4".as_slice().split(',').map(|x|std::from_str::from_str(x.trim_chars('\n')).expect("")).collect();let n:f64=num::from_uint(a.len()).expect("");let s=a.iter().fold(0.0,|a,b|a+*b);let q=a.iter().fold(0.0,|a,b|a+*b**b);println!("{},{},{},{},{}",n / a.iter().fold(0.0, |a, b| a + 1.0 / *b),(a.iter().fold(1.0, |a, b| a * *b)).powf(1.0/n),s/n,(q/n).sqrt(),q/s);}

Updated for newer Rust:
Ungolfed:
use std::io;
fn main(){
    let mut s=String::new();
    io::stdin().read_line(&mut s);
    let a:Vec<f64>=s
        .split(',')
        .map(|x|x.trim().parse().expect(""))
        .collect();
    let n:f64=a.len() as f64;
    let s=a.iter().fold(0.0,|a,b|a+*b);
    let q=a.iter().fold(0.0,|a,b|a+*b**b);
    println!("{},{},{},{},{}",
        n / a.iter().fold(0.0, |a, b| a + 1.0 / *b),
        (a.iter().fold(1.0, |a, b| a * *b)).powf(1.0/n),s/n,
        (q/n).sqrt(),q/s);
}

Golfed (402 bytes):
use std::io;fn main(){ let mut s=String::new(); io::stdin().read_line(&mut s); let a:Vec<f64>=s .split(',') .map(|x|x.trim().parse().expect("")) .collect(); let n:f64=a.len() as f64; let s=a.iter().fold(0.0,|a,b|a+*b); let q=a.iter().fold(0.0,|a,b|a+*b**b); println!("{},{},{},{},{}", n / a.iter().fold(0.0, |a, b| a + 1.0 / *b), (a.iter().fold(1.0, |a, b| a * *b)).powf(1.0/n),s/n, (q/n).sqrt(),q/s);}

Languages: 4
CoffeeScript, 193
Takes a comma-separated string of input:
m=(q)->m=Math;q.r=q.reduce;q=q.split(',').map Number;l=q.length;x=q.r ((p,v)->(p+v)),0;y=q.r ((p,v)->(p+v*v)),0;[l/q.r(((p,v)->(p+1/v)),0),m.pow(q.r(((p,v)->(p*v)),1),1/l),x/l,m.sqrt(y/l),y/x];

JavaScript (ES5), 256
Again, takes a comma-separated string of input:
function m(q){m=Math,q=q.split(',').map(Number),q.r=q.reduce,l=q.length,x=q.r(function(p, v){return p+v;},0),y=q.r(function(p,v){return p+v*v},0);return[l/q.r(function(p,v){return p+1/v},0),m.pow(q.r(function(p,v){return p*v},1),1/l),x/l,m.sqrt(y /l),y/x]}

PHP, 252
Same concept:
<?function m($q){$r=array_reduce;$q=explode(',',$q);$l=count($q);$x=array_sum($q);$y=$r($q,function($p,$v){return $p+$v*$v;});return[$l/$r($q,function($p,$v){return $p+1/$v;}),pow($r($q,function($p,$v){return $p*$v;},1),1/$l),$x/$l,sqrt($y/$l),$y/$x];}

TypeScript, 393*
Since TypeScript is a superset of JavaScript, I could have just submitted the same code but that wouldn't really be fair now. Here's a minified TypeScript code with all functions, variables, and parameters fully typed:
function m(q:String):number[]{var a:number[]=q.split(',').map(Number),l:number=a.length,x:number=a.reduce(function(p:number,v:number):number{return p+v},0),y:number=a.reduce(function(p:number,v:number):number{return p+v*v},0);return[l/a.reduce(function(p:number,v:number):number{return p+1/v},0),Math.pow(a.reduce(function(p:number,v:number):number{return p*v},1),1/l),x/l,Math.sqrt(y/l),y/x]}

Could have cheated and used the type any as well... but, you know.

Excel - 120
Not sure if this counts as a "programming" language, but thought people may actually use a spreadsheet for this type of thing
With the numbers in A2:J2
L2 (harmonic) =HARMEAN(A2:J2)
M2 (geometric) =GEOMEAN(A2:J2)
N2 (arithmetic) =AVERAGE(A2:J2)
O2 (quadratic) =SQRT(SUMSQ(A2:J2)/COUNT(A2:J2))
P2 (contraharmonic) =(SUMSQ(A2:J2)/COUNT(A2:J2))/AVERAGE(A2:J2)

I don't have Excel, but I think you can use the range A:A to target the entire column A.

VBA (Excel) - 105
a=1:for each n in i:a=a*n:b=b+1/n:c=c+n:d=d+n*n:next:x=ubound(i)+1:?x/b","a^(1/x)","c/x","(d/x)^0.5","d/c

Ungolfed :

a=1:               set a variable to 1 (for the geometric mean)
for each n in i:   loop through the list
    a=a*n:            product of the list
    b=b+1/n:          sum of inverses of the list
    c=c+n:            sum of the list
    d=d+n*n:          sum of squares of the list
next:              end loop
x=ubound(i)+1:     get the number of elements in the list
?                  prepare to print
 x/b","               harmonic = count / sum(inverses)
 a^(1/x)","           geometric = product^(1/count)
 c/x","               arithmetic = sum / count
 (d/x)^0.5","         quadratic = square root of ( sum of squares / count )
 d/c                  contraharmonic = sum of squares / sum

This code has to be run in the immediate window, and the array must be called i. Since there is no error collection, no cleaning, no variable dropping/releasing, if you want to test this code you can use the following piece of code (just paste in the immediate window and run the lines in order) :
b=0:c=0:d=0:set i = nothing:i= array(1,2,3,4,5)
a=1:for each n in i:a=a*n:b=b+1/n:c=c+n:d=d+n*n:next:x=ubound(i)+1:?x/b","a^(1/x)","c/x","(d/x)^0.5","d/c

Nothing very special, just the choice to use the immediate window with : to replace line breaks, which saves a few bytes vs setting up a sub or function and closing it; using ? to print rather than debug.print (only in the immediate window); and relying on how vba determines implicit values (adding a value to an un-set variable returns the value) and implicit operations (anything involving a string is implicitly concatenation).

authors: ทยิดา เก่งชัย


text:
Draw centered polygonal numbers
A centered polygonal number is able to be put into an arrangement of multiple concentric polygons, each with a side length of one more than the inner one. For example (image from linked page),

the above image has 31 dots, so 31 is a centered pentagonal number.
Write a program which receives a number as input (any typical input method is fine), and displays a picture similar to the above.
In particular:

There must be a centered dot.
Each concentric polygon contains an increasing number of dots, all connected through a line.
The angles must be correct for the appropriate regular polygon.
The distance between connected dots must be the same throughout the picture.
Each polygon must be centered inside the surrounding polygon.

The input will be between 2 and 1000, and is guaranteed to be a centered polygonal number of some kind.
If there are multiple possible solutions, display them all. For example, an input of 181 should display both a centered square (of 9 "rings") and a centered pentagon (of 8 "rings").
No hardcoding answers.

181 is also the count of a single-ringed henahectaoctacontagon (i.e. a 180-gon). In fact, any integer x > 3 is the count of a single-ringed (x-1)-gon. 181 is also the count of a two-ringed hexacontagon, a three-ringed triacontagon, a four-ringed octadecagon and a five-ringed dodecagon. (If it's all greek to you, see http://faculty.kutztown.edu/schaeffe/Tutorials/General/Polygons.html). Some of these, particularly the first one, are very big.

HTML + JS, 913 857 675 bytes
(Line breaks are added for readability)
<body><script>
function O(X,x,y,R){X.beginPath();X.arc(x,y,R,0,M.PI*2,true);X.closePath();X.fill()}
Z=300,P=3,H=Z/2,$=+prompt(),M=Math;for(S=3;S<$;S++){for(C=1;C<30;C++){if(S*C*C+S*C+2==$*2){
V=document.createElement("canvas");V.width=V.height=Z;document.querySelector("body").appendChild(V);X=V.getContext("2d");
O(X,H,H,P);for(R=1;R<=C;R++){
D=[],A=R*(H-P)/C,G=0;X.beginPath();X.moveTo(H+A,H);D.push([H+A,H]);for(s=1;s<S;s++){x=M.cos(G+=M.PI*2/S)*A,y=M.sin(G)*A;X.lineTo(H+x,H+y);D.push([H+x,H+y])}X.closePath();X.stroke();
for(j=0;j<D.length;j++){x=D[j][0],y=D[j][1],q=D[(j+1)%S][0]-x,w=D[(j+1)%S][1]-y;O(X,x,y,P);for(k=0;k<R-1;k++)O(X,x+=q/R,y+=w/R,P)}
}break}}}
</script></body>

This is working jsfiddle example, and ungolfed source. It gets input from prompt(). You can adjust output size by adjusting sz = 300, and dot size by pt = 3 (in pixels).
Example (31 dots)

Being code golf, you can cut most of html and still having a working page (doctype, meta, head and so on)

body and script are required here, but removing the html tags will save you 13 bytes.

Python - 189, 258, 251, 249, 239, 222 219
from pylab import*
m=input()-1;R=arange
for j in R(1,m):
 i=2.*m/(j*j+j);f=2*pi/i
 if i%1==0:
  figure();axis('equal')
  for r in R(j+1):o=f*R(i);s=R(r+1)[:,None];t=r-s;plot(t*cos(o)+s*cos(o+f),t*sin(o)+s*sin(o+f),'.-')

Example output for n = 31:
(Not sure if the first one is valid...)

This seems to be missing some dots.

@PeterTaylor: Oh sorry, I totally forgot to draw the smaller line segments. Fixed it at the cost of 69 characters. :-/

HTML5 + JS (378 364 chars)
<script>P='<svg><path stroke=red fill=none d='
C=''
N=prompt()-1
M=Math
for(i=t=1;N>t*2;t+=i)for(r=148/i,j=++i;N%t<1&&j--;)for(A=2*M.PI*t/N,y=150,x=j*r+310*i,P+='M'+x+','+y,a=s=0;s<N;s+=t)for(a+=A,k=-!j;k++<j;P+='L'+x+','+y,C+='<circle fill=red r=2 cx='+x+' cy='+y+' />')if(j)x+=(M.cos(a)-M.cos(a-A))*r,y+=(M.sin(a)-M.sin(a-A))*r
document.write(P+' />'+C)</script>

Online demo. Sorry about the long line, but it cannot be split without increasing the character count. Every semicolon which could be replaced by a newline courtesy of JavaScript's semicolon insertion has been replaced. Every space character is inside a string literal.
As with my previous "drawing in HTML" answer, SVG is slightly shorter than canvas.
Since the question doesn't say anything about positioning, I've saved a couple of characters by not guaranteeing that the diagrams will be evenly spaced.

I may be doing something wrong, but the fiddle doesn't seem to work for me.  I can enter input numbers (e.g. 31 or 181), but conversely to the other answer, I don't see the output drawn anywhere.  I tried with firefox and chrome.

@DigitalTrauma, there's about a 330px margin on it. Here's a screenshot taken in an old version of Chrome. (Edit: that's an old version of the fiddle, but the same thing applies).

Does the fiddle need updating?  Here's what I see

Is there any error message in the console?

No, the console is empty

I've reproduced the issue in Firefox. It's creating a box in the layout which is large enough for the contents of the SVG, and if I use Firebug to set attributes width=100% height=100% on the svg element then it displays ok. Since the spec says that in their absence these attributes should be interpreted as 100%, I claim that it's a browser bug rather than a bug in my code.

Python 2.7.6, 272 bytes
I'm still learning python, so I'm sure there is more room to golf this.  This is more of a challenge to myself than a competitive entry:
from turtle import*
from math import*
def f(n):pu();fd(20*n);pd()
P=input()
for n in range(2,P):
 a=2*P-2;b=n*n-n;m=a/b
 if a%b==0:
    f(n);dot(5)
    for r in range(1,n):
     f(1);rt(90-180/m)
     for s in [1]*m:
        rt(360/m)
        for t in [1]*r:dot(5);fd(40*sin(pi/m))
     lt(90-180/m)

Add exitonclick() to the end if you want the display to stay open after rendering.
Output for input of 31:

BBC BASIC, 281 ASCII characters, tokenised filesize 236
Emulator at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html
Newlines are required and included in the score.
  c=400INPUTa:n=1t=0REPEATt+=n:s=(a-1)/t:r%=c/n/2CLS:MOVEc,c:s%=s:IFs%=s u=r%*2:v=0FORp=1TOs%q%=r%*COS(p/s%*2*PI)x=q%*2q%=r%*SIN(p/s%*2*PI)y=q%*2q=FNt(n)u=x:v=y:NEXT:q=GET
  n+=1UNTILs<=3END
  DEFFNt(d)PLOT153,8,0MOVEBY-8,0IFd MOVEBY u,v:q=FNt(d-1)DRAWBY x-u,y-v:q=FNt(d-1)MOVEBY-x,-y
  =0

A centered s-gonal number is of the form (triangular number t[n])*s+1. I take an input a, then iterate through the triangular numbers until a-1 is not greater than 3*t[n]. If s is an integer, we clear the screen and plot the drawing. After plotting, we wait for the user to press a key (the screen will be cleared again for the next drawing if there is one.) To check if s s an integer, we store it in an integer variable s% (integer variables are identified by the % suffix) and compare the two. In this program I use casting to integer variables several times as a means of converting reals to integers.
The polygon is plotted wedge by wedge. The radial vectors for the first two points (u,v) and (x,y) are calculated. All the code for this must be on the same line as the  IF statement. Unfortunately the resolution of the plotting of this BBC basic emulator is only to the nearest multiple of 2, so in order to avoid problems we ensure that the vector parameters are multiples of 2 (by storing the values of the trig calculations in an integer variable q% then multiplying by 2. (the vectors themselves are real variables, to save characters.) There is also a variable q which serves only to accept return values of functions (required for syntax reasons.)
In order to avoid trying to do too much in the first IF statement, it is natural to put the plotting operation in a function, and having done that it may as well be recursive.  The function plots the wedge as a binary tree with overlapping branches. This is short, but highly inefficent (exponential time in number of rings.) With the largest sizes some points are plotted literally millions of times. The worst case is 976, where there are 25 triangular rings, which is expected to take several hours to run :-) This only happens for a very small number of inputs and is fixable for a few extra characters (currently 15) but I don't see speed as essential to the rules.
Ungolfed Code
  c=400                        :REM Approx half the height of the screen area
  INPUTa
  n=1                          :REM Number of rings
  t=0                          :REM t=triangular number n
  REPEAT
    t+=n                       :REM Update t to the next triangular number
    s=(a-1)/t                  :REM Number of sides of polygon
    r%=c/n/2                   :REM Choose a good length for (half)the radius of the first ring.
    CLS:MOVEc,c                :REM Clear screen and move graphics cursor to middle
    s%=s                       :REM Store the number of sides in an integer variable
    IFs%=s                     :REM If real variable and integer variable are equal (all the following indent MUST be on the same line as the IF)
      u=r%*2:v=0:              :REM initialise (u,v) to 360 deg.
      FORp=1TOs%:              :REM Loop through the sides.
        q%=r%*COS(p/s%*2*PI):  :REM Calculate x/2, assign to integer variable
        x=q%*2:                :REM assign to x, ensuring x is a multiple of 2.
        q%=r%*SIN(p/s%*2*PI):  :REM ditto y.
        y=q%*2:                :REM ditto y.
        q=FNt(n):              :REM Plot the wedge from n down to 0 (the first row is the centre dot, which will be overdrawn s times)
        u=x:v=y:               :REM Reinitialise u and v with the last values of x and y
      NEXT:                    :REM in order to plot the next wedge.
      q=GET                    :REM Allow user to view output, wait for keypress.
    n+=1                       :REM increment n ready to try the next triangular number
  UNTILs<=3                    :REM If number of sides already <=3
  END                          :REM exit program.

  DEFFNt(d)                    :REM BBC basic puts the nut & bolt functions at the end!
    PLOT153,8,0:MOVEBY-8,0     :REM Draw a filled circle radius 8 centred at the current graphics cursor position. After drawing, return cursor to centre of circle.
    IFd                        :REM if this is not the final iteration (all the following indent MUST be on the same line as the IF)
      MOVEBY u,v:              :REM move to the point where the first circle of the next ring is to be drawn
      q=FNt(d-1):              :REM draw the circle and the rest of the branch
      DRAWBY x-u,y-v:          :REM draw the concentric line to the second circle of the next ring
      q=FNt(d-1):              :REM draw the circle and the rest of the branch
      MOVEBY-x,-y              :REM return cursor to where it was before calling the function
  =0                           :REM supply a return value to exit the function.

Output, 31 dots
I know the dots are small, but that comes in handy for the larger numbers.

source: Stack Exchange

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

sort: votes


text:
Write a program that turns every 17th bit of a text file to a 1
My coworker and I work on a legacy piece of software that we hate sometimes.
Whenever you run it, debug asserts come flying everywhere, and it's never a guarantee that anything will work. The motivation for this round of code golf came from my coworker saying the following about our software.
"It's like every time you run this program, you're agreeing to some terms of service that says every 17th bit on your hard drive will be turned into a 1"
Goal: Write a program that will make an exact copy of a file and turn every 17th bit of a text file into a 1

You may NOT turn EVERY bit of the file to a 1. i.e. your program must show some intelligence that it is only targeting every 17th bit
You may NOT write to the original file in any way shape or form
The Winner is the smallest program submission at the end of the month

Have fun with this one! Go!

Every question needs an objective winning criterion. Most questions are code-golf, i.e., shortest code in bytes wins. A code-challenge needs a well specified scoring system. 2. Turning every 18th bit of a hard drive into a 1 is only possible by writing directly to the drive. This cannot be accomplished by creating and/or modifying files. 3. Doing this will render the entire drive unusable, so a compliant solution will be destructive. I don't know how well the community will receive a request to write malware...

@Dennis I agree with the closing of the question, but I do not agree with the reason (I see you were not among the close voters.) I personally had no problem with the insult question, but requesting malware is different. It's irresponsible and potentially criminal, so this question should remain closed. Given that a stack exchange employee closed the insult question (and many people lost a lot of reputation overnight) this question would definitely be deleted too. http://meta.codegolf.stackexchange.com/q/1638/15599.

If the most votes wins, you need to have tagged this a [tag:popularity-contest]

I am not requesting malware! I had a funny experience at work yesterday and thought "Hmm, maybe that would be a fun way to jump into the code golf community." Anyway, I modified the rules a little bit because I see your point. My intention was not to be criminal or irresponsible.

@matrixugly if you have a the popularity contest tag, you should remove the code challenge tag

I made a bunch of edits, can it not be off topic anymore?

@matrixugly OK, I realise you're new round here, but if the rules state that the submitted program must corrupt the hard drive that's what valid entries must do, and we don't want to become a manual for writing malware. Changing it to text is a lot more innocuous, and most people know the structure of text files anyway. I've changed my downvote to an upvote, but I'm holding off on the reopen vote, because I think a question like this would go best as code-golf (shortest code) and not popularity-contest (most votes.)

I'd vote to re-open this question, if only I had enough rep. :/

@steveverrill I'll change it to code golf, however I'm going to change it from 18th bit to 17th bit, to make things interesting.

@matrixugly 17th bit certainly is more interesting. Bear in mind that it is not good form to change the rules in a way that invalidates existing answers (that's why questions get put on hold, in order to avoid answers being posted that make the question impossible to fix.) However the existing answer doesn't comply with other current rules anyway, so it's not a big problem in this case.

How is the file read in? stdin?

Do we have to write the edited file to another file or can we just leave it?

Do the file need to be written to the disk or a memory/printed representation is ok ?

CJam, 22 bytes
q256b2H#b1f|2H#b256b:c

Try it online.
Touches every 17th bit, counting from the last.
I've used STDIN and STDOUT since CJam has no file I/O. If that's not allowed, the program can be wrapped in a Bash script at the cost of 24 extra bytes:
cjam <(echo q256b2H#b1f\|2H#b256b:c)<"$1">"$2"

How it works
q                      " Read from STDIN.                                                 ";
 256b                  " Convert to integer by considering the input a base 256 number.   ";
     2H#b              " Convert to array by considering the integer a base 2**17 number. ";
         1f|           " Set the LSB of every integer in the array element to 1.          ";
            2H#b       " Convert to integer by considering the array a base 2**17 number. ";
                256b   " Convert to array by considering the integer a base 256 number.   ";
                    :c " Turn character codes into characters.                            ";

+1, I really need to look into CJam. Awesome how much obfuscation you can get into a 22 byte code that still serves a purpose...

Well done. It converted "Take the every 17th bit and turn it to a 1" into ""Tike vhe eöery 17th fiv and turn yt(to c 1"

Why does this work? I don't follow..

@Claudiu: The basic idea is to take an array of 8-bit integers (bytes), convert it into an array of 17-bit integers, set the LSB of each integer to 1 and undo the array conversion.

Oh gotcha. I didn't realize "Set the LSB to 1" meant "Set the LSB of each element in the array to 1"

Technically, the rule was to make a copy of a file. I'm on the fence as to whether I'll end up accepting this answer since CJam doesn't do file I/O. But I absolutely applaud the creativity and give a "thumbs up"

Yes, I wasn't sure if I should post it, but since the Perl answer did basically the same... A Bash wrapper to meet the file I/O requirements would elevate the byte count to 46. More than twice as long, but still the shortest answer.

@matrixugly sorry! the spec left your file IO intent a little ambiguous. i personally didn't recognize an issue. not to keep harping on the merits of the codegolf sandbox, but the question getting closed and this requirement confusion probably could have been avoided. enjoyed the challenge regardless

Perl 59
regex substitution on bit strings:
$/=$\;$_=unpack"B*",<>;s|(.{16}).|${1}1|g;print pack"B*",$_

usage:
perl this.pl < infile.txt > outfile.txt

the endianness can be toggled by switching between b and B in the pack templates

C, 125
Assumes big-endian and 16-bit integers.
Works by applying a bitwise-OR on every two bytes.
Input file is y, output is z.

unsigned a,b;main(c){void*f=fopen("y","r"),*g=fopen("z","w");while(b=fread(&c,1,2,f))c|=a,a?a/=2:(a=32768),fwrite(&c,1,b,g);}

Ungolfed

// The commented out /* short */ may be used if int is not 16 bits, and short is.
unsigned /* short */ a = 0,b;
main(/* short */ c){
    void *f = fopen("y", "r"), *g = fopen("z", "w");
    while(b = fread(&c, 1, 2, f)){
      // __builtin_bswap16 may be used if you are using GCC on a little-endian machine.
      //c = __builtin_bswap16(c);
        c |= a;
        if(a) a >>= 1;
        else a = 32768;
      //c = __builtin_bswap16(c);
        fwrite(&c, 1, b, g);
    }
}

rules on this question have been updated...

@steveverrill and the answer has now been updated accordingly

@Comintern What should happen around the time when a becomes 0: 00000000 00000001    00000000 00000000    10000000 00000000, thus a should be zero at certain points. The machine must use big endian (or else you would have 00000000 10000000 instead of 10000000 00000000, which would give the wrong value).

Hrm... Never mind.  Taking out c = __builtin_bswap16(c); corrected it.

Python 2, 112 bytes
b=open('i').read().encode('hex')
open('o','w').write(('%x'%(int('1'+b,16)|16**len(b)/131071))[1:].decode('hex'))

This sets every 17th big-endian bit, starting 17th from the beginning.  It uses no libraries.  It works by converting the input file to a gigantic n-bit integer and bitwise ORing with 2**n/(2**17 - 1) == 0b10000000000000000100000000000000001….

C - 139
Reads from a file named "i", outputs to a file named "o".
c;main(){unsigned char b,m=1;void *i=fopen("i","r"),*o=fopen("o","w");for(;(b=fgetc(i))<129;fputc(b,o))((c+=8)%17<8)?b|=m=(m-1)?m/2:128:0;}

With line breaks:
c;main()
{
    unsigned char b,m=1;
    void *i=fopen("i","r"),*o=fopen("o","w");
    for(;(b=fgetc(i))<129;fputc(b,o))
        ((c+=8)%17<8)?b|=m=(m-1)?m/2:128:0;
}

Counts bits of input and then uses a floating bitmask to set every seventeenth bit.

Java - 247
Uses a BitSet and a simple loop instead of handling/masking the bytes manually. Of course this being java, the boilerplate is half the program, so it's not exactly short.
Still, not last! :D
import java.util.*;import java.nio.file.*;class F{public static void main(String[]a)throws Exception{BitSet b=BitSet.valueOf(Files.readAllBytes(Paths.get(a[0])));for(int j=0;j<b.size();b.set(j),j+=17);Files.write(Paths.get("o"),b.toByteArray());}}

No-scroll version:
import java.util.*;
import java.nio.file.*;
class F{
    public static void main(String[]a)throws Exception{
        BitSet b=BitSet.valueOf(Files.readAllBytes(Paths.get(a[0])));
        for(int j=0;j<b.size();b.set(j),j+=17);
        Files.write(Paths.get("o"),b.toByteArray());
    }
}

Python - 98 bytes
Read from i, write to o. Uses bitarray library https://pypi.python.org/pypi/bitarray
from bitarray import*;a=bitarray();a.fromfile(open('i','rb'));a[::17]=1;a.tofile(open('o','wb'))

ungolfed
from bitarray import *
a=bitarray()
a.fromfile(open('i','rb'))
a[::17]=1
a.tofile(open('o','wb'))

Wouldn't it need to be a[::17]=1?

Also, I believe you can save a byte with from bitarray import* and a=bitarray().

Cobra - 308
use System.Text.RegularExpressions
class P
    def main
        t,b='',File.readAllBytes('x')
        for n,i in b.numbered,for l in 8,b[n]=if(l,b[n],0)+if(Regex.replace(t+='00000000'[(j=Convert.toString(i,2)).length:]+j,'.{17}',do(m as Match)='[m]'[:-1]+'1')[n*=8:n+8][7-l]<c'1',0,2**l)to uint8
        File.writeAllBytes('y',b)

Every time I do one of these 'manipulate the individual bits of something' challenges, I wish that either Cobra or the .NET standard library had a binary string => integer converter.

Javascript (+HTML5), 282
Probably not the shortest, but it's user friendly :D
It's cross browser, but it seems that chrome is the only one allowing it when the html file is a local file (= access with file://...). For the other browsers, you need to put it on a web server.
The output file should be saved to the default download directory, maybe with a file prompt (depending on your configuration).
<input type=file onchange="r=new FileReader();r.onloadend=function(){w=window;a=new Uint8Array(r.result);for(i=17;i<a.length*8;i+=17)a[i/8>>0]|=1<<8-i%8;w.location.replace(w.URL.createObjectURL(new Blob([a],{type:'application/octet-binary'})));};r.readAsArrayBuffer(this.files[0])">

Ungolfed version :
<input type=file onchange="
    var reader = new FileReader();
    reader.onloadend = function() {
        var arr = new Uint8Array(reader.result);
        for(var i = 17 ; i < arr.length * 8 ; i += 17) {
            arr[Math.floor(i / 8)] |= 1 << (8 - (i % 8));
        }
        window.location.replace(
            window.URL.createObjectURL(
                new Blob([arr], {type: 'application/octet-binary'})
            )
        );
    };
    reader.readAsArrayBuffer(this.files[0]);
">

Python 3 - 187 bytes

Reads in from i and writes to o.
Code:
o=open;j="".join;f=list(j(format(x,"08b")for x in o("i","rb").read()))
f[16::17]="1"*(len(f)//17)
with o("o","wb") as f2:f2.write(bytes(int(j(f[i*8:(i+1)*8]),2)for i in range(len(f)//8)))

Ungolfed:
# read file and convert to binary string e.g. "101010010101010101"
f = list("".join(format(x, "08b") for x in open("in.txt", "rb").read()))
# set every 17th bit to 1
f[16::17] = "1" * (len(f)//17)
with open("out.txt","wb") as f2:
    data = []
    for i in range(len(f)//8)): # for each byte
        byte = "".join(f[i*8:(i+1)*8] # get each byte
        data.append(int(byte),2) # convert to int
    f2.write(bytes(data)) # convert to byte string and write

Python 3 - 103 chars
Change f to the path of the file you want to read and o to path of the file you want to write to.
l=open;t=list(l(f,'r').read())
for i in range(len(t)):
 if i%18==0:t[i]='1'
l(o,'w').write(''.join(t))

It's every 17th bit, not byte.

Also, it's 17th, not 18th.

authors: Виктория Тесла

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


text:
Counting rods; count your rods
Some background
Counting rods are small bars (3-14 cm long) that were used by mathematicians from many asian cultures for more than 2000 years to represent any whole number or fraction. (In this chqllenge we'l focus on unsigned integers though) There was also a written version, called rod numerals.
Here's how it works:
(If at any point you get confused, go check out the ascii representation of each digit and some examples I have included at the bottom)
Rod numerals are a true positional numeral system with digits for 1-9 and blank for 0.
The digits consist of horizontal and vertical lines; the more lines, the higher the digit. Once you get past five, you put a horizontal line on top to add 5 to the numer of lines below.
One vertical line is 1, two vertical lines 2, five vertical lines is 5, one vertical line with a horizontal line on top is 6, four vertical lines with a horizontal line on top is 9 (the highest digit).
A vertical 3 digit:
 |||
 |||
 |||
 |||
 |||

To make reading rod numerals easier though, they used different notation for each alternating digit. The second notation swaps the role of the horizontal and vertical lines. so that 3 is represented by three horizontal lines and 8 by three horizontal lines with a vertical line on top.
A horizontal 8 digit:
  |
  |
__|__
_____
_____

Knowing which notation to use is easy, as previously said, tehy are used alternatingly and Sun Tzu wrote that "one is vertical, ten is horizontal". So the rightmost digit is vertical and we alternate from there on.
The challenge
These rods were used to represent negative numbers and fractions (as explained in the wikipedia article on them. For the purpose of this challenge we'll only focus on positive integers though. The objective is simple:
Write a function or full program that takes an integer value as input in any way and prints the rod numeral representation of this integer to STDOUT (you may also write to a file if that works out better). Shortest code in bytes wins.
Every digit will be represented by 5x5 ascii characters and seperated by two collumns of 5 spaces. The exact representation you'll use for each digit is as follows:
space between two digits (two colums):

0 digit, both vertical and horizontal (five columns):

1 digit, vertical:
  |
  |
  |
  |
  |

2 digit, vertical:
 | |
 | |
 | |
 | |
 | |

3 digit, vertical:
 |||
 |||
 |||
 |||
 |||

4 digit, vertical:
|| ||
|| ||
|| ||
|| ||
|| ||

5 digit, vertical:
|||||
|||||
|||||
|||||
|||||

6 digit, vertical:
_____
  |
  |
  |
  |

7 digit, vertical:
_____
 | |
 | |
 | |
 | |

8 digit, vertical:
_____
 |||
 |||
 |||
 |||

9 digit, vertical:
_____
|| ||
|| ||
|| ||
|| ||

1 digit, horizontal:

_____

2 digit, horizontal:

_____
_____

3 digit, horizontal:

_____
_____
_____

4 digit, horizontal:

_____
_____
_____
_____

5 digit, horizontal:
_____
_____
_____
_____
_____

6 digit, horizontal:
  |
  |
  |
  |
__|__

7 digit, horizontal:
  |
  |
  |
__|__
_____

8 digit, horizontal:
  |
  |
__|__
_____
_____

9 digit, horizontal:
  |
__|__
_____
_____
_____

The digits are to be printed next to each other. Trailing spaces beyond the bounding box of the last digit are not allowed. Trailing spaces to complete the bounding box of the last digit(s) are required. You should end the output with a single trailing newline. Leading spaces that do not belong to the bounding box of the first digit are also forbidden.
Standard loopholes apply.
Example output
Lines starting with > are to be interpreted as input.
>12
        | |
        | |
        | |
        | |
_____   | |

>8037
  |                  _____
  |                   | |
__|__         _____   | |
_____         _____   | |
_____         _____   | |

>950
_____  _____
|| ||  _____
|| ||  _____
|| ||  _____
|| ||  _____

by "trailing spaces", do you mean only those past the bounding box of the last digit, or also those at the end of the last digit?

@JanDvorak only those past the bounding box of the last digit. If trailig spaces are needed to represent the entire bounding box of a digit, they are required.

Looking at the examples, leading spaces are forbidden too. Are they?

@edc65 yes, thanks for pointing that out.

Python 2 - 216
My first shot, might be some stuff to take out, but my brain hurts, so it's good enough for now
x=raw_input()
for l in range(5):print'  '.join((' '*7+'|   | |  ||| || '+'|'*7+'__|'+'_'*7)[[7*(4-l<n%6+n/6)+(n>5)*(l<10-n)-(l==10-n),n%6+n/6+(l<1)*(n>5)*(12-n)][(len(x)-i)%2]*5:][:5]for i,n in enumerate(map(int,x)))

JavaScript (ES6) 223
Function with numeric parameter, output to console. NB If the input parameter could be a string, the code would be 5 char shorter and without the limit of 17 significative digits of JS numbers.
F=n=>{
  for(r=s='',n+=s;r<5;r++,s+=q)
    for(f=q='\n',p=n.length;f=!f,p--;q=(p?'  ':'')+'     1  |  1 | | 1 ||| 1|| ||1|||||1_____1__|__'.split(1)[d]+q)
      if(d=~~n[p])e=d+r,d=d>5?f?e<10?1:e>10?6:7:r?d-5:6:f?e>4?6:0:d;
  console.log(s)
}

Test
Test in Firefox console.
F(12)
Output
        | |
        | |
        | |
        | |
_____   | |

F(8037)
Output
  |                  _____
  |                   | |
__|__         _____   | |
_____         _____   | |
_____         _____   | |

F(950)
Output
_____  _____
|| ||  _____
|| ||  _____
|| ||  _____
|| ||  _____

Ungolfed
F=n=>{
  z='     1  |  1 | | 1 ||| 1|| ||1|||||1_____1__|__'.split(1);
  s='';
  n+=s;

  for (r = 0; r < 5; r++)
  {
    for(q='\n',f=1,p=n.length;f=!f,p--;)
    {
      d = ~~n[p];
      if (d)
      {
        e=d+r;
        if (d > 5)
        {
          if (f)
          {
            d = e < 10 ? 1 : e >10 ? 6 : 7;
          }
          else
          {
            d = r ? d-5 : 6;
          }
        }
        else
        {
          if (f)
            d = e > 4 ? 6 : 0;
        }
      }
      q = (p ? '  ' : '') + z[d] + q;
    }
    s+=q
  }

  console.log(s)
}

PowerShell, 229 bytes
$n="$args"
0..4|%{$l=$_;$h=$n.Length%2
($n|% t*y|%{(' '*7+'|   | |  ||| || '+'|'*7+'_'*7+'|__')|% S*g(5*(('0123456666'+'0123451234'*4+'00000611110000661117000666117600666617660666667666')[50*($h=!$h)+10*$l+"$_"]-48))5})-join'  '}

Try it online!
Where this string present digits:
# 0       1       2       3       4       5       6       7
# '     '.'  |  ',' | | ',' ||| ','|| ||','|||||','_____','__|__'

vertical rods:
"       |   | |  ||| || |||||||____________________"+   # 0123456666
"       |   | |  ||| || |||||||  |   | |  ||| || ||"+   # 0123451234
"       |   | |  ||| || |||||||  |   | |  ||| || ||"+   # 0123451234
"       |   | |  ||| || |||||||  |   | |  ||| || ||"+   # 0123451234
"       |   | |  ||| || |||||||  |   | |  ||| || ||"    # 0123451234

horizontal rods:
"                         _____  |    |    |    |  "+   # 0000061111
"                    __________  |    |    |  __|__"+   # 0000661117
"               _______________  |    |  __|_______"+   # 0006661176
"          ____________________  |  __|____________"+   # 0066661766
"     ___________________________|_________________"    # 0666667666

Unrolled script:
$digits=' '*7+'|   | |  ||| || '+'|'*7+'_'*7+'|__'
$positions = '0123456666'+'0123451234'*4+'00000611110000661117000666117600666617660666667666'

$n="$args"
0..4|%{
    $line=$_
    $horizontal=$n.Length%2
    $chunks=$n|% toCharArray|%{
        $horizontal=!$horizontal
        $startFrom = 5*($positions[50*$horizontal+10*$line+"$_"]-48)
        $digits|% Substring $startFrom 5
    }
    $chunks-join'  '
}

227 if you take it as a string

What is 'any way' in the rule Write a function or full program that takes an integer value as input in any way? I did not dare to interpret 'an integer' as 'a string'. :)

Yeah, it's a bit vague and probably not what OP intended but figured I'd point out the easy golf.

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