text:
Swapping numbers
This is a common puzzle many of you have solved manually. Now this is the time to write an algorithm to solve the same.
There are equal number match sticks lined up in two different side facing each other's direction. There is a single empty space between them. Say something like the following figure (if total number of match sticks are 4).

Each stick can either slide one step in forward direction (if the immediate front space is free), or it can be jumped over one stick in their front, and land into the free space (if that space is free). The move in reverse direction is not possible (even the space is free). No reverse jump is also allowed. Only one move is allowed in one step.
Now, you have to write an algorithm to find the minimum steps required using which all the left hand side match sticks will land in right hand side and all the right hand side match sticks will land in left hand side.
For ex: If there are total 2 match sticks (1 in each side) then steps will be:

Note: In the above figure the left side stick been moved first. Another solution exists when the right side stick moves first. But for this problem, you have to give only one solution and that is also assuming that the left side stick moves first.
The following figure describes the moves with 4 match sticks (2 in each side):

Note: In the above figure the left side stick been moved first. Another solution exists when the right side stick moves first. But for this problem, you have to give only one solution and that is also assuming that the left side stick moves first.
[Assumption: The input can be any even number between 02 to 14 (i.e. 1 to 7 match sticks in each side). For inputs outside this range, you do not need to do any validation, neither need to provide any error message. Note: In the output, each step is separated by a '|' (pipe) character. COBOL programmers should always assume PIC 9(2) as input size & may also assume the output to be fixed maximum length 450 characters, padded with spaces at right.]

Sample Input:
02

Sample Output:
01To02|03To01|02To03|

Sample Input:
04

Sample Output:
02To03|04To02|05To04|03To05|01To03|02To01|04To02|03To04|

Sample Input:
06

Sample Output:
03To04|05To03|06To05|04To06|02To04|01To02|03To01|05To03|07To05|06To07|04To06|02To04|03To02|05To03|04To05|

If you can't include the images directly, can you supply links for someone else to edit them in?

I made some quick images. Hopefully they conform to the original author's intent.

Condition for victory?

APL 129
The code below takes screen input and outputs to the screen in the format specified:
n←n,n++\1↓z←(⌽z),((¯1*~2|n)×n⍴2),z←⌽∊(¯1*2|⍳n)×¨1,((⍳(n←.5×⍎⍞)-1)⍴¨2),¨1⋄(∊(((¯2↑¨'0',¨⍕¨n),¨⊂'To'),¨(¯2↑¨'0',¨⍕¨n-z)),¨⊂'|')~' '

A good third of the code is taken up formatting the output. The logic is complete by the occurrence of the ⋄ symbol in the code.
Below is the result for an input of 08 as a check:
04To05|06To04|07To06|05To07|03To05|02To03|04To02|06To04|08To06|09To08|07To09|05To07|03To05|01To03|02To01|04To02|06To04|08To06|07To08|05To07|03To05|04To03|06To04|05To06|

I always feel like APL is cheating >.<

@Shmiddty I am afraid that any purely symbol based language such as APL, J, GolfScript etc will most likely win code golf against more verbose word based languages ;)

Javascript 178 174 161
prompts for n then alerts answer. (No 0 padding)
Latest:
t=1+(m=prompt(s=i='')/2);for(z=Math.abs;i++<m*2;)for(j=m-z(m-i),s+=(t+=a=(m%2^z(m+.5-i)%2-.5)*-2+1)+'To'+(t-a)+'|';j--;)s+=(t+=a=i%2*4-2)+'To'+(t-a)+'|';alert(s)

2:
z=Math.abs;t=m=prompt(o=[])/2;t++;for(s=i='';i++<m*2;)for(j=m-z(m-i),o.push((z(m+.5-i)%2-.5)?-1:1);j--;)o.push(i%2?2:-2);o.map(function(a){s+=(t+=a)+'To'+(t-a)+'|'});alert(s)

1:
t=m=prompt(o=[])/2+1;for(s=i='';++i<m;)for(j=i,o.push(i%2?-1:1);j--;)o.push(i%2?2:-2);o.concat(o.slice().reverse().slice(m-1)).map(function(a){s+=(t+=a)+'To'+(t-a)+'|'});alert(s)

This uses the concept that the pattern is mirrored:
Key
R='Jump Right'
r='Shift Right'
L='Jump Left'
l='Shift Left'
m='Move'
j='Jump'

So, where n=2, the pattern of movement is:
rLr
mjm

Which equates to
+1 -2 +1

This pattern repeats like so (n=8)
rLlRRrLLLlRRRRlLLLrRRlLr
mjmjjmjjjmjjjjmjjjmjjmjm
+1 -2 -1 +2 +2 +1 -2 -2 -2 -1 +2 +2 +2 +2 -1 -2 -2 -2 +1 +2 +2 -1 -2 +1

We can notice a few patterns here:

Movement alternates between left and right
The number of movements in a particular direction increases from 1 to n/2, which repeats 3 times, then decreases back to 1.
The type of movement alternates between shifting and jumping, the number of shifts in a row being a constant 1, and the number of sequential jumps increasing from 1 to n/2 then decreasing back to 1.
The summation of the movements is always 0. (Not sure if this is actually relevant)

n=14:
rLlRRrLLLlRRRRrLLLLLlRRRRRRrLLLLLLLrRRRRRRlLLLLLrRRRRlLLLrRRlLr
mjmjjmjjjmjjjjmjjjjjmjjjjjjmjjjjjjjmjjjjjjmjjjjjmjjjjmjjjmjjmjm

Sample output:
f(2):
1To2|3To1|2To3|

f(8):
4To5|6To4|7To6|5To7|3To5|2To3|4To2|6To4|8To6|9To8|7To9|5To7|3To5|1To3|2To1|4To2|6To4|8To6|7To8|5To7|3To5|4To3|6To4|5To6|

f(40):
20To21|22To20|23To22|21To23|19To21|18To19|20To18|22To20|24To22|25To24|23To25|21To23|19To21|17To19|16To17|18To16|20To18|22To20|24To22|26To24|27To26|25To27|23To25|21To23|19To21|17To19|15To17|14To15|16To14|18To16|20To18|22To20|24To22|26To24|28To26|29To28|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|12To13|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|31To30|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|10To11|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|33To32|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|8To9|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|35To34|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|6To7|8To6|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|36To34|37To36|35To37|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|5To7|4To5|6To4|8To6|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|36To34|38To36|39To38|37To39|35To37|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|5To7|3To5|2To3|4To2|6To4|8To6|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|36To34|38To36|40To38|41To40|39To41|37To39|35To37|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|5To7|3To5|1To3|2To1|4To2|6To4|8To6|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|36To34|38To36|40To38|39To40|37To39|35To37|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|5To7|3To5|4To3|6To4|8To6|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|36To34|38To36|37To38|35To37|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|5To7|6To5|8To6|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|36To34|35To36|33To35|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|7To9|8To7|10To8|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|34To32|33To34|31To33|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|9To11|10To9|12To10|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|32To30|31To32|29To31|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|11To13|12To11|14To12|16To14|18To16|20To18|22To20|24To22|26To24|28To26|30To28|29To30|27To29|25To27|23To25|21To23|19To21|17To19|15To17|13To15|14To13|16To14|18To16|20To18|22To20|24To22|26To24|28To26|27To28|25To27|23To25|21To23|19To21|17To19|15To17|16To15|18To16|20To18|22To20|24To22|26To24|25To26|23To25|21To23|19To21|17To19|18To17|20To18|22To20|24To22|23To24|21To23|19To21|20To19|22To20|21To22|

Here's some pseudo code to demonstrate the method:
var mid=cursor=N/2,delta
cursor++                 // the cursor is where the empty space is.
for(i=0; i++<N;){
  delta = (mid%2^abs(mid+.5-i)%2-.5)*-2+1;  // 1 or -1
  print((cursor+delta) + 'To' + cursor + '|')
  cursor+=delta
  for(j=mid-abs(mid-i);j--;)
  {
    delta = i%2*4-2  // 2 or -2
    print((cursor+delta) + 'To' + cursor + '|')
    cursor+=delta
  }
}

You're right that the pattern is more clear with l/L/r/R and m/j. I like the idea of separating the distance moved from the direction

C - 216 213
My solution is based on two facts:

The "to" field is the "from" field of the previous move (since you always create an empty slot in the space you move from, and ou always move to an empty slot)
There is a very regular pattern to the distances and directions that are moved. For the first 3 test cases, they are:
1 -2 1
1 -2 -1 2 2 -1 -2 1
1 -2 -1 2 2 1 -2 -2 -2 1 2 2 -1 -2 1

With that in mind I basically just wrote a program to produce and continue that pattern. I'm pretty sure there must be a really beautiful and much more elegant recursive way to write this, but I haven't figured it out yet:
#include <stdio.h>

int main(int argc, const char *argv[])
{
   int upper_bound = atoi(argv[1]) / 2;
   int len;
   int from;
   int to = upper_bound + 1;
   int direction = 1;
   int i;

   for(len = 1; len <= upper_bound; ++len){
      for(i = len-1; i >=0; --i){
         from = to - direction*(1 + (i!=0));
         printf("%02dTo%02d|",from,to);
         to = from;
      }
      direction*=-1;
   }
   for(i=1; i < len; ++i){
      from = to - direction*2;
      printf("%02dTo%02d|",from,to);
      to = from;
   }
   direction*=-1;
   for(--len; len >= 0; --len){
      for(i = 0; i < len; ++i){
         from = to - direction*(1 + (i!=0));
         printf("%02dTo%02d|",from,to);
         to = from;
      }
      direction*=-1;
   }
   return 0;
}

And golfed (even though this was a code-challenge, not golf):

#define B {F=T-D*(1+(i!=0));printf("%02dTo%02d|",F,T);T=F;}D*=-1;
L,F,T,D,i;main(int U,char**A){U=atoi(A[1])/2;T=U+1;D=1;for(L=1;L<=U;++L){for(i=L-1;i>=0;--i)B}for(i=1;i<L;++i)B for(--L;L>=0;--L){for(i=0;i<L;++i)B}}

#define B {F=T-D*(1+(i!=0));printf("%02dTo%02d|",F,T);T=F;}D*=-1;
L,F,T,D,i;main(int U){scanf("%d",&U);U/=2;T=U+1;D=1;for(L=1;L<=U;++L){for(i=L-1;i>=0;--i)B}for(i=1;i<L;++i)B for(--L;L>=0;--L){for(i=0;i<L;++i)B}}

When I run your golfed version, I get a segfault.

Oh sorry, I forgot to mention that the input is given as a command line argument - if you run it with no arguments it will segfault. But actually now that you mention it, I don't know why I thought command line arguments would be shorter than scanf. I'm updating my answer with a better version.

The pattern is more noticeable when you use L/R/l/r (big being "jump"): N(2)=rLr, N(4)=rLlRRlLr, N(6)=rLlRRrLLLrRRlLr, etc.

Mathematica
This approach builds a Nested sequence of the size and direction of the moves, formatted as {fromPosition,toPosition}, beginning with position n, where n refers to the number of match pairs. It then Folds the sequence into a function that begins with move {n, n+1}.
z@n_:=(p=1;h@t_:=Append[{Table[2 (-1)^t,{t}]},{(-1)^(t+1)}];
k=Join[Reverse@Drop[#,n],#]&[Flatten@Nest[Prepend[#,h[p++]]&,{},n]];
Fold[Append[#,{#[[-1,1]]-#2,#[[-1,1]]}]&,{{n,n+k[[1]]}},Rest@k])

z[1]

{{1, 2}, {3, 1}, {2, 3}}

z[4]

{{4, 5}, {6, 4}, {7, 6}, {5, 7}, {3, 5}, {2, 3}, {4, 2}, {6, 4}, {8,
    6}, {9, 8}, {7, 9}, {5, 7}, {3, 5}, {1, 3}, {2, 1}, {4, 2}, {6,
    4}, {8, 6}, {7, 8}, {5, 7}, {3, 5}, {4, 3}, {6, 4}, {5, 6}}

z[7]

{{7, 8}, {9, 7}, {10, 9}, {8, 10}, {6, 8}, {5, 6}, {7, 5}, {9, 7}, {11, 9}, {12, 11}, {10,12}, {8, 10}, {6, 8}, {4, 6}, {3, 4}, {5, 3}, {7, 5}, {9, 7}, {11, 9}, {13, 11}, {14, 13}, {12, 14}, {10, 12}, {8, 10}, {6, 8}, {4, 6}, {2, 4}, {1, 2}, {3, 1}, {5, 3}, {7, 5}, {9, 7}, {11, 9}, {13, 11}, {15, 13}, {14, 15}, {12, 14}, {10, 12}, {8, 10}, {6, 8}, {4, 6}, {2, 4}, {3, 2}, {5, 3}, {7, 5}, {9, 7}, {11, 9}, {13, 11}, {12, 13}, {10, 12}, {8, 10}, {6, 8}, {4, 6}, {5, 4}, {7, 5}, {9, 7}, {11, 9}, {10, 11}, {8, 10}, {6, 8}, {7, 6}, {9, 7}, {8, 9}}

Visualizing the Swaps
r, b, and o are images or a red match, a blue match, and no match, respectively.

The following formats the output from z to display the swaps with matches.
swaps[n_]:=FoldList[Grid[{Permute[#[[1,1]],Cycles[{#2}]],Range[2n+1]}]&,
Grid[{Join[Table[r,{n}],{o},Table[b,{n}]],Range[2n+1]}],z[n]]

swapMatches[n_]:=Grid[Partition[swaps[n],2,2,1,""],Dividers->All]

swaps produces a list of states by using the ordered pairs of z as commands to permute the initial list and subsequent lists.
swaps[1]

swapMatches displays the states in a grid.
swapMatches[2]

swapMatches[3]

Javascript 191
function f(N) {
    n=N>>=i=c=a='1';n++
    s=z='0'
    for(k=b='34';i<N;k=i%2?a+=z+z:b+='44',i++)c=k+c
    t=''
    i=N*(N+1)/2
    l=2*i+N
    for(;l;n+=(i>=1?r=c[i-1]:i<=-N?c[-i-N]:k[1])-2,t+=(s=n>9?'':z)+n+a+'|',--l,--i)a='To'+s+n
    return t
}

Characters counted using grep =|tr -d \ |wc -c

Hi and welcome to codegolf! I think you'll find your solution doesn't produce the correct output for any of the test cases (http://jsfiddle.net/SJwaU/). For the input 02, the values are correct, but it's missing the trailing |. For the other two cases, the values are way off, and the formatting of 10 is also wrong. Also not sure about your character counting method. Why are you only counting the function body minus the return?

@gordon Oops, seems I made a mistake in my most recent optimization. Thanks for pointing out.  I count the body only because on a REPL, that's all you need.  I've put the function decoration only for the sake of convenience.

You do need to count relevant whitespace (e.g. newlines) towards your total.

@shmiddty tr -d \ |wc -c takes newlines into account


text:
Fastest code to find the next prime
The problem is as follows.
Input: An integer n
Output: The smallest prime bigger than n.
The challenge is to give the fastest code possible to do this.  I will test the code on values starting at size   roughly 10^8 10^200 and doubling in size until it takes more than one minute 10 seconds on my computer.
The winning code will find the next prime for the largest input size.
By way of comparison, a simple sieve written in python is able to find the next prime bigger than 10^8 in about 20 seconds.
The requirement that I can test it on my 4GB RAM ubuntu computer is strict. All code must be free (in both senses) and if it uses libraries they must also be free and easily installable. Any false primes reported will immediately disqualify the submission.
I will award separate commendations for the winners in each programming language too if the code is entirely written in that language without the use of external libraries. I will  also keep a running table of the fastest times as the competition goes on so people can see how they are doing.
Table so far

Python. An astonishing 357 digit prime 343239883006530485749095039954069660863471765007165270469723172959277159169882802606127982033072727748864815569574042901856099399985832190628701414555752857600000000000000000000000000000000000000002872284792758930912601189043411951050852357613658978971208596097634095500808832510259693761982135208603287199546795000697807728609476163156438356035166156820611 was the final number under 10 seconds using the code supplied by primo. Will anyone beat this first entry?

Almost an exact duplicate of Code-Challenge:The Nearest Prime

@PeterTaylor That question is about time complexity I think. This is about practical speed in seconds. I think those two things can be quite different.

Sure, if you stick to small test cases. But since no-one bothered to implement AKS for the other question, you're going to get the same answers.

@PeterTaylor There is already an amazing new answer here.  I will have to test with huge test cases now!

For some value of new. He does say that it was an answer from another question: I think the space of questions about primes is pretty much mined out now.

@PeterTaylor You are right. I suppose what will be new here is the comparison of how large a prime you can find it practice.

@PeterTaylor allow me to disagree. Eventually, 90% of a site's traffic should come from search engines. A google search for fast semiprime factorization and Multiple Polynomial Quadratic Sieve return the original problem I've taken my code from at place #2 and #4 respectively. I imagine at some point, this problem will rank fairly high for fast next prime function as well.

@primo, that's the generic text, and not really applicable to codegolf. This site isn't a question-and-answer site in the general style of stackexchange. Having said that, I'm not sure quite what you're disagreeing with; if you want to start a discussion on meta about the line between duplicate and not, I'll chip in.

@PeterTaylor what I'm disagreeing with is position that a new question should be closed on the sole condition that a similar question has already been asked. Particularly if the 'duplicate' question has no accepted answer, and is already several years old.

It might be fun to compare the results with math software. For instance, in Mathematica, use NextPrime[n] to find the next prime after n. On my laptop, NextPrime[10^1000] took around 1 second to compute.

I think the OP has failed to update his tests of the answers...

Python ~451 digits
This is part of the library I wrote for a semiprime factorization problem, with unnecessary functions removed. It uses the Baillie-PSW primality test, which is technically a probabilistic test, but to date, there are no known pseudoprimes – and there's even a cash reward if you're able to find one (or for supplying a proof that none exist).
Edit: I hadn't realized that Python has built-in modular exponentiation. Replacing my own for the built-in results in a performance boost of about 33%.
my_math.py
# legendre symbol (a|m)
# note: returns m-1 if a is a non-residue, instead of -1
def legendre(a, m):
  return pow(a, (m-1) >> 1, m)

# strong probable prime
def is_sprp(n, b=2):
  d = n-1
  s = 0
  while d&1 == 0:
    s += 1
    d >>= 1

  x = pow(b, d, n)
  if x == 1 or x == n-1:
    return True

  for r in range(1, s):
    x = (x * x)%n
    if x == 1:
      return False
    elif x == n-1:
      return True

  return False

# lucas probable prime
# assumes D = 1 (mod 4), (D|n) = -1
def is_lucas_prp(n, D):
  P = 1
  Q = (1-D) >> 2

  # n+1 = 2**r*s where s is odd
  s = n+1
  r = 0
  while s&1 == 0:
    r += 1
    s >>= 1

  # calculate the bit reversal of (odd) s
  # e.g. 19 (10011) <=> 25 (11001)
  t = 0
  while s > 0:
    if s&1:
      t += 1
      s -= 1
    else:
      t <<= 1
      s >>= 1

  # use the same bit reversal process to calculate the sth Lucas number
  # keep track of q = Q**n as we go
  U = 0
  V = 2
  q = 1
  # mod_inv(2, n)
  inv_2 = (n+1) >> 1
  while t > 0:
    if t&1 == 1:
      # U, V of n+1
      U, V = ((U + V) * inv_2)%n, ((D*U + V) * inv_2)%n
      q = (q * Q)%n
      t -= 1
    else:
      # U, V of n*2
      U, V = (U * V)%n, (V * V - 2 * q)%n
      q = (q * q)%n
      t >>= 1

  # double s until we have the 2**r*sth Lucas number
  while r > 0:
      U, V = (U * V)%n, (V * V - 2 * q)%n
      q = (q * q)%n
      r -= 1

  # primality check
  # if n is prime, n divides the n+1st Lucas number, given the assumptions
  return U == 0

# primes less than 212
small_primes = set([
    2,  3,  5,  7, 11, 13, 17, 19, 23, 29,
   31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
   73, 79, 83, 89, 97,101,103,107,109,113,
  127,131,137,139,149,151,157,163,167,173,
  179,181,191,193,197,199,211])

# pre-calced sieve of eratosthenes for n = 2, 3, 5, 7
indices = [
    1, 11, 13, 17, 19, 23, 29, 31, 37, 41,
   43, 47, 53, 59, 61, 67, 71, 73, 79, 83,
   89, 97,101,103,107,109,113,121,127,131,
  137,139,143,149,151,157,163,167,169,173,
  179,181,187,191,193,197,199,209]

# distances between sieve values
offsets = [
  10, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6,
   6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4,
   2, 4, 8, 6, 4, 6, 2, 4, 6, 2, 6, 6,
   4, 2, 4, 6, 2, 6, 4, 2, 4, 2,10, 2]

max_int = 2147483647

# an 'almost certain' primality check
def is_prime(n):
  if n < 212:
    return n in small_primes

  for p in small_primes:
    if n%p == 0:
      return False

  # if n is a 32-bit integer, perform full trial division
  if n <= max_int:
    i = 211
    while i*i < n:
      for o in offsets:
        i += o
        if n%i == 0:
          return False
    return True

  # Baillie-PSW
  # this is technically a probabalistic test, but there are no known pseudoprimes
  if not is_sprp(n): return False
  a = 5
  s = 2
  while legendre(a, n) != n-1:
    s = -s
    a = s-a
  return is_lucas_prp(n, a)

# next prime strictly larger than n
def next_prime(n):
  if n < 2:
    return 2
  # first odd larger than n
  n = (n + 1) | 1
  if n < 212:
    while True:
      if n in small_primes:
        return n
      n += 2

  # find our position in the sieve rotation via binary search
  x = int(n%210)
  s = 0
  e = 47
  m = 24
  while m != e:
    if indices[m] < x:
      s = m
      m = (s + e + 1) >> 1
    else:
      e = m
      m = (s + e) >> 1

  i = int(n + (indices[m] - x))
  # adjust offsets
  offs = offsets[m:]+offsets[:m]
  while True:
    for o in offs:
      if is_prime(i):
        return i
      i += o

A sample test script:
from time import clock
from my_math import *

n = i = 317**79
while True:
  i *= 317
  time1 = clock()
  n, o = next_prime(i), n
  span = clock()-time1
  if span > 10:
    break
  print(len(str(n)), span)
print(o)

A factor of 317 was chosen, because it's approximately the square root of 10000, adding roughly 2.5 digits per iteration (and because doubling was too slow to sit through). Output shows the current number of digits, and the time taken.
Sample results:
201 0.13121248650317288
203 0.059535499623555505
206 0.9157767258129175
208 0.2583420518529589
211 0.15367400046653978
213 0.32343915218274955
216 1.3962866788935466
218 0.5986165839513125
221 0.973842206202185
223 2.346910291671148
...
428 0.932809896229827
431 4.345940056627313
433 9.511724255457068
436 6.089835998709333
438 1.3793498894412721
441 4.290633027381972
443 3.5102506044762833
446 3.1629148397352083
448 3.364759208223404
451 7.34668009481652
1551197868099891386459896063244381932060770425565921999885096817830297496627504652115239001983985153119775350914638552307445919773021758654815641382344720913548160379485681746575245251059529720935264144339378936233043585239478807971817857394193701584822359805681429741446927344534491412763713568490429195862973508863067230162660278070962484418979417980291904500349345162151774412157280412235743457342694749679453616265540134456421369622519723266737913

All code is now python 3 compatible.

That is astonishingly fast!  I will run it properly with doubling size in a few days (and a deterministic primality test) and put the biggest number in the table.  I suspect you may already be the winner though.

FWIW, in Sage, next_prime((2^520)*(10^200)) about 15 seconds on my machine, so at first blush this is quite impressive.  However... next_prime((2^520)*(10^200),proof=False) takes 0.4 seconds because it only checks for pseudoprimality.  Your claim "there are no known pseudoprimes" is vanishingly convincing as the number of bits goes over 64.  For 357 digits,  I'm not even remotely convinced by a lack of counterexamples.

@boothby it's worth noting that this is the very same method used by Maple. That the method was published 33 years ago, and there still no known pseudoprimes speaks for its degree of accuracy.

This is why I use Sage.  "Not known to fail" is really actually not the same as "known to work".  Suppose there was one false pseudoprime under 400 digits.  It would take trillions of years to find it -- but it'd still be there, foiling any attempt to prove 'pseudoprime = prime'.  I will always downvote "solutions" that use probabalistic methods with zero guarantee.  Monte Carlo? Sure thing.  "It's prime 'cause a wizard told me it probably was"?  Nope.

@boothby Is sage running AKS to check?

@felipa Where pseudoprimality is known sufficient, Sage uses PARI's nextprime -- otherwise, it repeatedly increments and uses PARI's isprime.  The ultimate fallback there is isprimeAPRCL.   AKS is not competitive until ln(ln(ln(n))) > 12... about 10^(70k) digits.  AKS-PL is competitive around a googol digits.  That is... never in our lifetimes.

@boothby What is isprimeAPRCL implementing? And do you mean 12 for AKS? I thought they got it down to 6 or is that something else?

@boothby  I am guessing http://en.wikipedia.org/wiki/Adleman%E2%80%93Pomerance%E2%80%93Rumely_primality_test .

@felipa, 12 is AKS proper, AKS-PL brings it down to 6 (whence the googol digits).  Correct on APRCL.  Let's stop commenting on Primo's answer, shall we?  This is getting rather long.  ;)

@boothby You need to add an answer so we can comment under it :)

Just $30! Surprising.

C++ with GMP: 567 digits
Uses the Miller-Rabin implementation in GMP.  It might return a false positive, but good luck actually hitting one with probability 2^-200.
#include <gmp.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/time.h>

double time() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_usec  * 1e-6 + t.tv_sec;
}

int main(int argc, char *argv[]) {
  mpz_t n, m;
  mpz_init_set_ui(n, 10);
  mpz_pow_ui(n, n, 200);
  mpz_init(m);
  for (int i = 0; true; i++, mpz_mul_ui(n, n, 2)) {
    double start = time();
    for (mpz_add_ui(m, n, 1); !mpz_millerrabin(m, 100); mpz_add_ui(m, m, 2)) ;
    double t = time() - start;
    gmp_printf("%d %Zd %f\n", i, m, t);
    if (t > 10.0) break;
  }
}

Finds the prime 10^200 * 2^1216 + 361 (567 digits) before running over time on my slow laptop.

Perl with GMP module, 1300 digits
Using my module Math::Prime::Util and its GMP back end.  The exact crossover point will depend on your computer and whether you have the latest GMP library.  All code is free (the modules are on github and CPAN, and GMP is freely available).  I've run them on AWS's Ubuntu as well as a desktop Ubuntu (and Fedora, and AIX, and NetBSD, etc.).
The core code is in C and C+GMP.  next_prime from MPU sees the number is too large and forwards it to the GMP back end (or pure Perl code if the back end isn't installed).  That stringiifies and converts to a mpz, and will convert the result back into the input object type or Math::BigInt.  next_prime itself does:

a mod 30 wheel
keeps track of the remainder mod 23# so it can do native modulos for primes up to 23
probable prime test on things that pass these.

The probable prime test is:

check for tiny divisors using mpz_gcd_ui (in 64-bit two of these check up to 101)
check for small divisors using singly-calculated large primorials.  This is either primes up to 10k or 40k depending on the input size.
for values larger than 2^1600, performs further trial division using a treesieve.  This could be done more efficiently.
finally, ES BPSW is done (Miller-Rabin test with base 2 followed by an extra strong Lucas test).

Everything prior to the ES BPSW is just optimization, which of course we want for next_prime.  next_prime is also implemented in Perl using the Math::BigInt module (in core with optional Pari and GMP back ends).  That does AES BPSW (like Pari) but isn't as optimized.
I have thought about the merits of a partial-sieve-based version, using a range of, for instance, 2 merits.  I'm just not sure if this would really be better, as most of the time we'd be doing unnecessary sieving as the gap was small, and sometimes for a large gap we'd have to repeat it multiple times.
The library implements ECPP (including certificates) so we could run a proof on the result, but 1200 digits is really too large for the tiny default set of included polynomials (there is a method for downloading larger sets -- proofs would take a bit under 15 minutes which is a bit faster than Pari's APR-CL but a bit slower than WraithX's mpz_aprcl).  One downside of ECPP vs. APR-CL is that it has more time variance so there is a good chance of it exceeding 10 seconds on some number before the average time gets there.  With a proof I think we're limited to something in the 400 digit range unless we allow multi-threaded software.
#!/usr/bin/env perl
use warnings;
use strict;
use Math::Prime::Util ":all";
use Math::Prime::Util::GMP;  # Barf if the backend isn't installed
use Time::HiRes qw(gettimeofday tv_interval);
use Math::GMP;

my $n = Math::GMP->new(10) ** 200;
while (1) {
  my $start = [gettimeofday];
  my $np = next_prime($n);
  my $sec = tv_interval($start);
  my $len = length($n);
  die "next_prime $len = +",$np-$n," in $sec seconds\n" if $sec > 10;
  warn "  next_prime $len = +",$np-$n," in $sec seconds\n";
  $n *= 10;
}

I decided to try with the same sequence used by primo.  It got to 1191 digits, as that is where we hit a gap of 18138.  I also tested primo's code using the latest my_math.py.  It gets to 630 digits with the 10^e sequence and 641 with his sequence.  Very impressive for compact all-Python code without lots of pretests.

I still can't get over how fast this module is. It's resparked my interest in perl as a number-crunching tool. I'm currently rewriting Math::GMP in a way that isn't quite so wasteful with mpz reference creation/destruction.

The real work is all in C+GMP, so it could all work in Python as well.  Python has some serious advantages over Perl 5 for big numbers, that I wish could be solved.  Math::GMPz, by the way, is faster than Math::GMP and has basically the entire mpz API exposed, though more brittle and a bit weird to call sometimes.  Fixing some things in Math::GMP is on my todo list behind too many other things.
Re MPU, I've thought about inverting the development and make it into two C libraries, then have the Perl module just use that.  It would help get it used elsewhere.

I'm making good progress. The following loop runs over 10 times as fast, solely due to better reference management: $x = new Math::GMP(0); $x += 3 for 1..1000000. I'll post to cpan when I'm finished; you'll be one of the first to know ;)

pari/gp, 703 digits
Try it online!
n = i = 317^79;

{
while(1,
  i *= 317;
  time1 = gettime();
  n = nextprime(i);
  o = n;
  span = gettime() - time1;

  if (span > 10*1000, break);

  print("Length: ", #Str(n), ", Time: ", span, "ms");
);
}

print(o);

source: Stack Exchange

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

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

sort: votes


text:
Shortest 2-Player Game of Halma
In Chess, it's possible for the game to end after 4 moves (2 each) with a Fool's Mate.
Your goal is to find the Fool's Mate of Halma: the 2-player game of Halma that minimises the number of turns played.
There are over 1056 board states, and I've seen the branching factor surpass 1000, so chances are no one will find the optimal solution.  Instead, you're trying to find the best solution you can.
You should submit a list of moves, and any code you used to generate those moves.
Explanation of the Game
Halma is similar to Chinese Checkers, but played on a 16*16 square board.
Initially, the board looks like this:

The goal of the game is to move all your pieces to the starting positions of your opponent's pieces.
On a player's turn, he/she may:

Pass the turn
Move one of his/her pieces to an adjacent empty space.  Adjacent spaces include diagonals.
Take one of his/her pieces and do the following any number of times: Jump the piece over an adjacent piece, landing it on the space opposite the piece jumped over.

Here's an example to illustrate the 2nd type of move.

Rules
Submit a list of legal moves which result in the game ending.
Submit any code you used to generate the list.
If you obtain a better result from someone else's code, post the result in a comment or edit their post with the new results.
Each move must be either None to pass the turn, or (x1,y1,x2,y2) to move a piece, where (x1,y1) are the coordinates of the piece to move and (x2,y2) are the destination of that piece (for jump moves, ignore intermediate coordinates).  The coordinates start at (0,0) at the top left corner.  x-coordinates increase to the right, y-coordinates increase downward.  Moves should be separated by newlines.
You can use this python script to verify your moves.  Use python halma_verify.py < file to verify moves in file.
Shortest list wins.

some technical discussion of moves, and a solution in 47 moves: http://arxiv.org/pdf/0803.1245.pdf

The shortest game of halma is 49 moves
49 move solution
Proof there is no 48-move solution
Code used for this solution
The code now supports pass
Notice that the 47 move solution in the paper is for the army transfer problem, not for the shortest game of halma
I'll hopefully get to doing a proper writeup this weekend

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


text:
Bridges (Hashi)
Unsolved puzzle:

Solved Puzzle:

Rules

Each circle with number must have as many lines from it as the number
in the circle.
It is not allowed to have more than two lines between two circles.
The lines can not cross each other.
All the lines must either be horizontal or vertical. It is not allowed to draw lines diagonally.
All lines must be connected.

Program Description
Write a program to input a bridges puzzle from a text file and output the solution
Input file guidelines
The input file must display a number for the number of bridges connected and . for whitespace.
Example:
2.2.5.2.
.....1.3
6.3.....
.2..6.1.
3.1..2.6
.2......
1.3.5..3
.2.3..2.

Output guidelines
Replace periods with

- single horizontal line
= double horizontal line
| single vertical line
$ double vertical line

From the data file above, you should get this as output:
2 2-5=2
$ | $1-3
6=3 $  $
$2--6-1$
3|1 $2=6
|2| $  $
1|3=5--3
 2-3==2

You marked this as code golf, but I assume this is instead a programming challenge?

The person with the smallest letter count wins, it is a codegolf challenge

Is a unique solution guaranteed?

Yes, a unique solution is guaranteed

May be H instead of $ is better.

looks like an exact duplicate of http://codegolf.stackexchange.com/q/4790/367

Ruby, 414 characters
h=->l,s,v{l[s.index(v)||s.size]}
c=->r,f{r[f].to_i-h[[1,2,0],'|$',r[f-N]]-h[[1,2,0],'-=',r[f-1]]-h[[1,2,0],'-=',r[f+1]]}
s=->r{(f=r=~/\./)&&(m=h[[2,4,25,25,25,31],w='|$-= ',a=r[f-N]]&h[[7,7,8,16,7,31],w,r[f-1]]
a=~/\d/&&m&=(0>d=c[r,f-N])?0:d<1?25:d<2?2:d<3?4:0
' |$-='.chars{|k|m&1>0&&(r[f]=k;s[r]);m=m>>1};r[f]='.')||r[-N..-1]=~/^ +$/&&$><<r[N..-N].tr("0",$/)}
N=1+((t=STDIN.read)=~/$/)
s[$/*N+t.tr($/,"0")+"."*N]

Example:
2.2.5.2.
.....1.3
6.3.....
.2..6.1.
3.1..2.6
.2......
1.3.5..3
.2.3..2.

2 2-5=2
$ | $1-3
6=3 $  $
$2--6-1$
3|1 $2=6
|2| $  $
1|3=5--3
 2-3==2

The program will output some incorrect answers. Try this case: 1.2. .... ..1.

@Ray You are right. Such strange things didn't happen in my tests. Will have a look into it.

@Ray It's with the trailing newline of the input. If you omit that it works fine. I'll try to fix that.

Python: 1303 Characters
This is some super ugly code, and it isn't particularly efficient, but I believe it works:
import sys
from itertools import product,combinations
e=[]
p=[[[0,(c,r,o,[])][c!='.'] for o,c in enumerate(l.strip())] for r,l in enumerate(open(sys.argv[1]))]
r=range(len(p))
c=range(len(p[0]))
for i,j in combinations(product(r,c),2):
 if p[i[0]][i[1]] and p[j[0]][j[1]]:
  if i[0]==j[0] and abs(i[1]-j[1])>1:
    b=1
    g=range(min(i[1],j[1])+1,max(i[1],j[1]))
    for x in g:
     if p[i[0]][x]:b=0
    if b:e+=[(i,j,[i[0]],g,1)]
  if i[1]==j[1] and abs(i[0]-j[0])>1:
    b=1
    g=range(min(i[0],j[0])+1,max(i[0],j[0]))
    for x in g:
     if p[x][i[1]]:b=0
    if b:e+=[(i,j,g,[i[1]],0)]
def s(v,i,m):
 if i>=len(v):
  return None
 for j in [2,1,0]:
  v[i]=j
  q=dict(m)
  b=1
  for l in [0,1]:
   n=e[i][l]
   if not n in q:q[n]=0
   q[n]+=j
   y=int(p[n[0]][n[1]][0])
   if q[n]>y:b=0
  if not b:continue
  a=[d for b in range(i+1) for d in product(e[b][2],e[b][3]) if v[b]>0]
  if len(a)!=len(set(a)):continue
  if i==len(v)-1:
   g=1
   for l,z in product(r,c):
    n=p[l][z]
    if not n:continue
    if q[(n[1],n[2])]!=int(n[0]):g=0
   if g:return v
  u=s(v,i+1,q)
  if u:return u
for i,v in zip(e,s([None]*len(e),0,{})):
 if v>0:
  for j,k in product(i[2],i[3]):p[j][k]=[[['|','$'][v-1],['-','='][v-1]][i[4]]]
for l in p:
 for c in l:
  if not c:c=[' ']
  sys.stdout.write(c[0])
 print ""

Example:
$ cat problem
4.4.1
.....
4.6.2
.....
..1..
$ python bridges.py problem
4=4-1
$ |
4=6=2
  |
  1

why open(sys.argv[1])? sys.stdin save you some chars.

The result in your example doesn't match the input.

@Ray: I used open(sys.argv[1]) because the instructions specifically said to take input from a file.  It's easy enough to change though.  As for the example, thanks for catching my mistake: I edited the example to make it a bit more interesting, but I accidentally only copy/pasted the updated output.  I'll fix that now.

Python 3/ 1780C
This problem can be converted to the exact cover problem. We can use Knuth's AlgorithmX to solve the exact cover problem.
I'll post the details about converting from input data to a 0-1 matrix later. It's very interesting.
Solving exact cover problem with AlgorithmX is very fast. On my machine, the example was solved within 0.09 second, in 310 iterations. And the program can output all solutions.
import sys
from itertools import product as I
a=sys.stdin.read().split()
V=list
L=len
Z=enumerate
W=range
P=V(I(W(L(a)),W(L(a[0]))))
E={p:[]for p in P}
Q={(i,j):int(a[i][j])for i,j in P if'.'!=a[i][j]}
J=Q.items()
F=[]
for p,c in J:
 for i,j in((0,1),(1,0)):
  q=p[0]+i,p[1]+j;e=[p,0]
  while q in P:
   E[q]+=[e]
   if q in Q:e[1]=q;E[p]+=[e];F+=[e];break
   q=q[0]+i,q[1]+j
E={x:[x for x in y if x[1]!=0]for x,y in E.items()}
C=[E[p] for p in P if p not in Q and L(E[p])>1]
m=[]
T=L(Q)+4*L(F)+L(C)
s=0
l={}
for p,c in J:
 e=E[p];u=L(e)*2
 for t in I(*((0,1,2)for x in e)):
  if sum(t)!=c:continue
  r=[0]*T;r[s+u]=1
  for i,x in Z(t):k=s+i*2;r[k:k+2]=((1,1),(0,1),(0,0))[x]
  m+=[r]
 l[p]=s;s+=u+1
z=L(m)
for e in F:
 p,q=e;r=[0]*T;c,d=l[p]+E[p].index(e)*2,l[q]+E[q].index(e)*2;t=r[:];r[c]=r[d]=1
 for i,u in Z(C):r[T-L(C)+i]=int(e in u)
 t[c+1]=t[d+1]=1;m+=[r,t]

def I(x,d):
 y=d[x]
 while y!=x:yield y;y=d[y]
def A(c):
 L[R[c]],R[L[c]]=L[c],R[c]
 for x in I(c,D):
  for y in I(x,R):U[D[y]],D[U[y]]=U[y],D[y]
def B(c):
 for x in I(c,U):
  for y in I(x,L):U[D[y]],D[U[y]]=y,y
 L[R[c]],R[L[c]]=c,c
def S():
 c=R[h]
 if c==h:yield[]
 A(c)
 for r in I(c,D):
  for x in I(r,R):A(C[x])
  for t in S():yield[r[0]]+t
  for x in I(r,L):B(C[x])
 B(c)
L,R,U,D,C={},{},{},{},{}
h=T
L[h]=R[h]=D[h]=U[h]=h
for c in W(T):
 R[L[h]],R[c],L[h],L[c]=c,h,c,L[h];U[c]=D[c]=c
for i,l in Z(m):
 s=0
 for c in I(h,R):
  if l[c]:
   r=i,c;D[U[c]],D[r],U[c],U[r],C[r]=r,c,r,U[c],c
   if s==0:L[r]=R[r]=s=r
   R[L[s]],R[r],L[s],L[r]=r,s,r,L[s]
for s in S():
 b=V(map(V,a))
 for e in s:
  if e<z:continue
  (i,j),(x,y)=F[(e-z)//2]
  if j==y:
   for r in W(i+1,x):b[r][j]='|H'[b[r][j]=='|']
  else:
   for r in W(j+1,y):b[i][r]='-='[b[i][r]=='-']
 print('\n'.join(''.join(l)for l in b).replace('.',' '))

Nice! I'm curious if you have (could share some reference) a more easily readable non-cold-golf version of this solution? I'm really interested to understand how to solve this problem, esp. the details about converting from input data to a 0-1 matrix?


text:
Polygon prefixes
Polygons are named after the number of sides that they have. A pentagon has 5 sides, an octagon has 8 sides. But how are they named? What's the name for a 248-sided polygon?
All polygons are suffixed with -gon. There are specific prefixes for each polygon depending on the number of sides. Here are the prefixes for the lower numbers:
3 - tri
4 - tetra
5 - penta
6 - hexa
7 - hepta
8 - octa
9 - nona
10 - deca
11 - undeca
12 - dodeca
13 - triskaideca
14 - tetradeca
15 - pentadeca
16 - hexadeca
17 - heptadeca
18 - octadeca
19 - nonadeca
20 - icosa

Polygons with 21 to 99 sides have a different system. Take the prefix for the tens digit (found on the left column), the ones digit (right column below), and then stick a "kai" between them to get (tens)kai(ones)gon.
10 - deca        | 1 - hena
20 - icosi       | 2 - di
30 - triaconta   | 3 - tri
40 - tetraconta  | 4 - tetra
50 - pentaconta  | 5 - penta
60 - hexaconta   | 6 - hexa
70 - heptaconta  | 7 - hepta
80 - octaconta   | 8 - octa
90 - nonaconta   | 9 - nona

The 3-digit sided polygons are named in a similar fashion. A 100-sided polygon is called a hectogon. Take the hundreds digit, find it on the column for ones digits, then stick a "hecta" to its right. Now number off the tens and ones like above: (hundreds)hecta(tens)kai(ones)gon. If the hundreds place digit is a 1, don't put the prefix behind "hecta"; if the ones place is 0, then omit the (ones) section.
So, given an integer (3 <= n <= 999), return the name of an n-sided polygon. n-gon is not a valid answer :P
As with all code golf, shortest code wins.

100-sided is hectogon or hectagon? The tens digit above 100 is also unclear. I guess 110 and 120 are hectahenakaigon and hectadikaigon (or hectaicosikaigon?)

Also, 101-sided is "hectakaihenagon" (as I understand from your rules) or "hectahenagon"?

@beary605 I think nona- is wrong. That would be from latin and the others, hepta-, hexa- are from greek. It should be ennea-. I know the wikipedia says nonagon is OK!

@felipa: I was debating whether to have it be ennea-, but I've heard "nonagon" more often than "enneagon", so I went with that.

@ugoren: 100 - hectagon, and I didn't see that I didn't have deca, thanks for pointing that out. 110 - hectadecagon, 120 - hectaicosigon. 101 - hectakaihenagon.

so the rules for 3..20 do not apply to 103..120 and instead we use the tens+ones rules?

@baby-rabbit: Yes.

C, 401, 391
Lets put something out there so there is at least one answer for reference :-)
char*s[]={"","hena","di","tri","tetra","penta","hexa","hepta","octa","nona","un","do","triskai","deca","icosi","tria","conta","kai","icosa","hecto","hecta","gon\n"};
p(i){printf(s[i]);}
t;n(i){
    if(i<10)
        p(i);   // ones
    else if(i<20){
        i-=10;
        p(i+(i&&i<4)*9); // teens
        p(13); // "deca"
    }else if(i==20)
        p(18); // "icosa"
    else if(i==100)
        p(19); // "hecto"
    else{
        t=i/100;
        p(t>1?t:0); // hundreds
        p(t?20:0);  // "hecta"
        i%=100;
        t=i/10;
        p(t+(t&&t<4)*12); // tens
        p(t>2?16:0);      // "conta"
        i%=10;
        p(i?17:0); // "kai"
        p(i);      // ones
    }
    p(21); // "gon\n"
}

Test with:
main(){
    for(int i=3;i<=999;i++){
        printf("%3d: ",i);n(i);
    }
}

Subset of output:
  3: trigon
  4: tetragon
  5: pentagon
  6: hexagon
  7: heptagon
  8: octagon
  9: nonagon
 10: decagon
 11: undecagon
 12: dodecagon
 13: triskaidecagon
 14: tetradecagon
 15: pentadecagon
 16: hexadecagon
 17: heptadecagon
 18: octadecagon
 19: nonadecagon
 20: icosagon
 21: icosikaihenagon
 22: icosikaidigon
 23: icosikaitrigon
...
 99: nonacontakainonagon
100: hectogon
101: hectakaihenagon
102: hectakaidigon
103: hectakaitrigon
104: hectakaitetragon
105: hectakaipentagon
106: hectakaihexagon
107: hectakaiheptagon
108: hectakaioctagon
109: hectakainonagon
110: hectadecagon
111: hectadecakaihenagon
...
997: nonahectanonacontakaiheptagon
998: nonahectanonacontakaioctagon
999: nonahectanonacontakainonagon

Nice. You can replace if..else with ?: (and ; with ,) to save some characters. Also t>1&&p(t) and similar changes can help. And I'm not sure, but perhaps you could rearrange s so that the constants you use would be single digit.

JavaScript -   405  386
Version 1: (405 chars)
i=prompt(),o='0hena0di0tri0tetra0penta0hexa0hepta0octa0nona'.split(0),d='0W0icosi0triaQ0tetraQ0pentaQ0hexaQ0heptaQ0octaQ0nonaQ'.split(0),t='W0unW0doW0triskaiW0tetraW0pentaW0hexaW0heptaW0octaW0nonaW0icosa'.split(0),x=('000'+i).substr(-3).split('');alert((i<10?o[i]:i<21?t[i-10]:i==100?'hecto':(i<100?'':i<200?'hecta':o[x[0]]+'hecta')+d[x[1]]+'kai'+o[x[2]]).replace(/Q/g,'conta').replace(/W/g,'deca')+'gon')

Version 2: (386 chars)
i=prompt(),p='0tetra0penta0hexa0hepta0octa0nona',o='0hena0di0tri'+p,t=('W0unW0doW0triskai'+p.replace(/0/g,'W0')+'W0icosa').split(0),x=('000'+i).substr(-3).split(''),o=o.split(0);alert((i<10?o[i]:i<21?t[i-10]:i==100?'hecto':(i<100?'':i<200?'hecta':o[x[0]]+'hecta')+('0W0icosi0tria'+p.replace(/0/g,'Q0')+'Q').split(0)[x[1]]+'kai'+o[x[2]]).replace(/Q/g,'conta').replace(/W/g,'deca')+'gon')

Output example:
3: trigon
4: tetragon
5: pentagon
6: hexagon
7: heptagon
8: octagon
9: nonagon
10: decagon
11: undecagon
12: dodecagon
13: triskaidecagon
14: tetradecagon
15: pentadecagon
16: hexadecagon
17: heptadecagon
18: octadecagon
19: nonadecagon
20: icosagon
21: icosikaihenagon
22: icosikaidigon
23: icosikaitrigon
99: nonacontakainonagon
...
100: hectogon
101: hectakaihenagon
102: hectakaidigon
103: hectakaitrigon
104: hectakaitetragon
105: hectakaipentagon
106: hectakaihexagon
107: hectakaiheptagon
108: hectakaioctagon
109: hectakainonagon
110: hectadecakaigon
111: hectadecakaihenagon
...
997: nonahectanonacontakaiheptagon
998: nonahectanonacontakaioctagon
999: nonahectanonacontakainonagon

Cobra - 370 bytes
This is currently a function, but if that isn't allowed then I'll change it.
def f(x) as String
    o='. hena di tri tetra penta hexa hepta octa nona'.split
    o[0],t,h,d='',['','deca','icosci','triconta'],['','hecta','dihecta','trihecta'],['undeca','dodeca','triskaideca']
    for z in 4:10,t,h,d=t+[o[z]+'conta'],h+[o[z]+'hecta'],d+[o[z]+'deca']
    for z in 10,t[z]+='kai'
    return if(x-100,h[x//100]+if(10<x<20,d[x-11],t[x%100//10]+o[x%10]),'hecto')+'gon'

And for some reason the cobra highlighter has // set as a comment, which is wrong.


text:
Pretty Printing Parentheses
The worst part about long lines or code or math equations are the parentheses. Nobody wants to read through 2x(3y+4*abs(x^[2*e^x])-5{3(x+y)-5})!
So, the goal of this challenge is to make it at least slightly easier to read these parentheses-filled beasts! For the above math equation, the output should be:
2x (
  3y+4*abs (
    x^ [
      2*e^x
    ]
  )
  -5 {
    3 (
      x+y
    )
    -5
  }
)

A parenthesis is defined as either of these characters: ()[]{}. Indents should each be two spaces, and there should be one space of seperation between the expression and the parenthesis: 2x (, x^ [ as some examples.
I would like to debut the Atomic Code Golf metric in this question. Take out all separators in your code (()[]{}. ; to name some common ones), and then take the length of your program if every reserved word and operator were 1 character long. That is your program's score.  if x**(3.2)==b[3]:print x is 11 points: if|x|**|3|.|2|==|b|3|print|x, or ix*3.2=b3px. Any quick questions about the metric can be posted here; larger questions should be discussed in meta using the link above.
Lowest score wins. Good luck, have fun!

Is $x one token or two?

@mob: Depends on what $x is: if it's a variable, 1 token. If it's a math operator, then 2.

Love the scoring system, I think it will make Common Lisp much more viable.

Re. the task itself: do we have to check for matching brackets, or is it okay to assume that they are all correctly matched up?  Furthermore, is the input expression guaranteed to contain no whitespace already? (In particular, in the vicinity of the parens..)

@FireFly: They're all correctly matched (there will be as many open brackets as there are closed brackets). Yes, there will be no whitespace.

Related. (The differences being that the other question asks for K&R style bracket placement and that it's plain code golf.)

The unary answer will win.

Are names from standard libraries considered "reserved words"?

I've voted to close this as unclear as the challenge body does not properly specify what counts as a "separator"

Was this sandboxed?  There are plenty of languages that can easily write programs consisting of only characters on your "common separator" list.

@WheatWizard This was asked in 2013, so I think it's unlikely it was sandboxed (given that sandboxes really started in 2014)

@ChartZBelatedly Oh for some reason I thought it was asked today.  It looked very reminiscent of old challenges.

C, 139 137 chars, 67 tokens
i,n;                                                      // 2 tokens
main(c){                                                  // 2 tokens
        while(~(c=getchar()))                             // 5 tokens
                n=strchr("([{}])",c)?                     // 11 tokens
                        n=c%4!=1,                         // 7 tokens
                        i+=n*4-2,                         // 7 tokens
                        printf("\n%*s%c"+n,n?1:i,"",c)    // 15 tokens
                :                                         // 1 token
                        !printf("\n%*s%3$c"+!n*4,i,"",c); // 17 tokens
}

Logic:

Read until EOF (detect it because ~EOF==0).
If parenthesis, check open/close (for c in ")]}", c%4==1), update indentation (i), print with some whitespace.
If not, print the character, possibly prefixed by newline and indentation (n is true after parenthesis).

Whatever it is you're doing with n looks truly evil. :) Woah!: c%4!=1! That's brilliant!

Python, 102(?) Tokens
(Please correct if I didn't count correctly)
def f(t):
#1  2 3
    l,s,p,c,e,n=0,"",1," ",")]}","\n"
#   4 5 6 7 8 9ab cd e fgh ijklm no p
    for i in t:
#   q   r s  t
        if i in"([{": l+=2;s+=c+i+n+l*c
#       u  v w xyzAB  CD E FG HIJKLMNOP
        elif i in e: l-=2;s+=n+l*c+i+p*(n+l*c);p=1
#       Q    R S  T  UV W XY Z123456789 abcde  fgh
        else:
#       i
            if len(s) and s[-1]in e: s+=n+l*c
#           j  k   l  m   n  o p  q  rs tuvwx
            s+=i;p=0
#           yz A BCD
    return s
#   E      F

Perl, 86 char
57 tokens? (21+25+5+3+1+2?) Newlines are significant.
s![[{()}\]]!1-(3&ord$&)?" $&
"."  "x++$x:$/.($y="  "x--$x)."$&
$y"!ge;s/
 *
/
/g;print

JavaScript (V8), 76 74
(a,d)=>(d=0)||a.replaceAll(/[(\[{]/g,b=>` ${b}\n`+'  '.repeat(++d)).replaceAll(/[)\]}]/g,b=>`\n${(f='  '.repeat(--d))+b}\n${f}`)

Try it online!
(a,d)=>               pas argument a and d (a is the string, d is just as decleration)
 (d=0)||               set d to 0
 a.replaceAll(         replace everything in a that matches....
   /[(\[{]/g,            [,(,{   with....
   b=>                   pass matches into function
     ` ${b}\n`             space, bracket(the match) and newline
     +'  '.repeat(++d)     increment d and repeat the 2 spaces d times
   )
 .replaceAll(/[)\]}]/g,  match all ),],} and replace them with....
    b=>                  pass matches into function
      `\n${(f='  '.repeat(--d))+b}\n${f}`   newline, decrement d and repeat the 2 spaces d times, closing bracket(the match), newline and once again the repeated spaces
)

results in
#a#,#d#=>#d#=#0#||#a#replaceAll#/#[#(#\#[#{#]#/#g#b#=>#`# #$#{#b#}#\#n#`#+#'# # #'#repeat#++#d#replaceAll#/#[#)#\#]#}#]#/#g#b#=>#`#\#n#$#{#f#=#'# # #'#r#e#p#e#a#t#--#d#+#b#}#\#n#$#{#f#}#`#

You can probably remove the braces {} inside the backticks

@Wezl , i am not so sure about those, as he specified only sperators, not sure if these are sperators.

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


text:
Pong in the shortest code
The challenge is simple. Give the shortest code possible to reproduce the classic 2-player game of pong http://en.wikipedia.org/wiki/Pong .  The level of graphics and functionality should be as close as possible to this javascript demonstration http://codeincomplete.com/posts/2011/5/14/javascript_pong/demo.html (but without the extra options you can click on on the left or the frame, fps etc. information in the bottom right).
As always the code must be written in a free language (in both senses) and should be runnable on linux. Any libraries used must also be free, easily available and not be written for the purposes of this competition (and also not already contain a working version of Pong!).

Honestly, this question is a little too difficult for code golf. The ball physics for Pong is pretty complicated.

@beary605, I don't think the ball physics are too complicated.  My solution is 'as close as possible' to the javascript demonstration, and the physics are quite simple.

Just for reference there are some other [code-golf]s that run to pretty long. Build an engine for a maze game, Noughts and Crosses (aka Tic-Tac-Toe) (both could use additional entries, who likes to "win" by default?), Write a small HTTP server, Self-Interpreting Interpreter, Self-compiling compiler, Compile Regexes ...

@felipa, Can you formalize 'as close as possible'?  I don't know why my sed solution isn't in the lead.

@boothby My mistake. I didn't have time to actually run the python code and made a wrong assumption.

@felipa When you have the time, I would recommend you try it. In its current form, it is as fully featured as the 953 byte HTML/JS solution, with the exception that there is no pause function. Graphically, I think it is also quite agreeable. Nevertheless, I would like to request that it not be selected as the accepted answer, as its validity seems to be contentious.

AFAIK, "a free language (in both senses)" is certainly not "always" a requirement. We get plenty of answers in C#, Mathematica, etc.

@beary605 too difficult?

Why so ugly colors?

Javascript, 883 (+ 70 HTML)
c=document.getElementById('c').getContext('2d')
c.fillStyle="#FFF"
c.font="60px monospace"
w=s=1
p=q=a=b=0
m=n=190
x=300;y=235
u=-5;v=3
setInterval(function(){if(w&&!s)return;s=0
c.clearRect(0,0,640,480)
for(i=5;i<480;i+=20)c.fillRect(318,i,4,10)
m+=p;n+=q
m=m<0?0:m;m=m>380?380:m
n=n<0?0:n;n=n>380?380:n
x+=u;y+=v
if(y<=0){y=0;v=-v}
if(y>=470){y=470;v=-v}
if(x<=40&&x>=20&&y<m+110&&y>m-10){u=-u+0.2;v+=(y-m-45)/20}
if(x<=610&&x>=590&&y<n+110&&y>n-10){u=-u-0.2;v+=(y-n-45)/20}
if(x<-10){b++;x=360;y=235;u=5;w=1}
if(x>640){a++;x=280;y=235;u=-5;w=1}
c.fillText(a+" "+b,266,60)
c.fillRect(20,m,20,100)
c.fillRect(600,n,20,100)
c.fillRect(x,y,10,10)},30)
document.onkeydown=function(e){k=(e||window.event).keyCode;w=w?0:k=='27'?1:0;p=k=='65'?5:k=='81'?-5:p;q=k=='40'?5:k=='38'?-5:q;}
document.onkeyup=function(e){k=(e||window.event).keyCode;p=k=='65'||k=='81'?0:p;q=k=='38'||k=='40'?0:q}

/* Variable index:
a -> left player score
b -> right player score
c -> context
e -> event
i -> counter for dashed line
k -> keycode
m -> left paddle y
n -> right paddle y
p -> left paddle y velocity
q -> right paddle y velocity
s -> is start of game
u -> ball x velocity
v -> ball y velocity
w -> game is waiting (paused)
x -> ball x
y -> ball y
*/

The script can be placed at the end of <body> or called onLoad. It needs the following canvas element:
<canvas id="c"width="640"height="480"style="background:#000"></canvas>

Player 1 uses the q and a keys, and player 2 uses the p and l keys. Press the esc key to pause and any key to start/continue.
You can play it in your browser here.
I wasn't sure of the physics to use, so I started off with a simple reflection method and then added some variety and experimented with it a bit. The ball's velocity in the y direction is affected by where on the paddle you hit the ball, so you have some control over where the ball goes. The ball's velocity in the x direction slowly increases with each hit in the rally.
I suspect that it will be beaten quite easily by solutions using libraries, but I had fun making it in plain javascript.

That's a really nice implementation.

Could be golfed a bit more, I know I'm about two years late here. but you could assign 20 to a variable named g and save one measly byte.

Damn, it's hard to play on an azerty keyboard...

sed, 35
Raising the bar a bit with a postage-stamp sed meditation.
s/> / >/
s/ </< /
s/0</0>/
s/>1/<1/

The meditation is enjoyed on stdin/stdout on two computers, not necessarily connected by a network.  The meditation begins in the state
0         <       1

with guru zero on the left and one on the right.  The angle bracket moves left and right, and if a guru maneuvers their number to contact the cursor as it comes to their side, their score is increased by one, and they become elated with joy.
The meditation is initiated by typing the above state into sed -f medi.sed, and the computer responds with the next state.  The dutiful guru types that state into the meditation, reading aloud the next key they will press, with both gurus pressing the holy key to enter the future at the same time.  The dutiful computer replies with the next state.  This, in turn, is read aloud while typed in unison as with the last.  Continue advancing into the future until infinite bliss is achieved.
Gurus desiring a challenge may play 'turbo' mode, wherein the gurus attempt to collaboratively predict the computer's next state, and typing it into the prompt instead of the current state.  Gurus will have the wisdom to verify agreement between their predictions before entering the future.

Dude... what did I just read?

@MrZander Only through extensive contemplation may the wisdom of the meditation be revealed.  This contemplation is best aided through execution of the program.

Python 2 (with pygame) 650 bytes
Features

1 and 2 player modes - When the game begins, press 1 for 1 player, or 2 for 2 players. The game will not begin until one of these keys is pressed.
Increasing ball speed - Each volley, the ball speed is increased so that after 10 volleys it has increased by approximately 50%, after 20 it will be 50% faster than that, etc.
Variable ball deflection - Ball deflection is based on two factors: what portion of the paddle it strikes, and whether or not the paddle is moving upon impact. If the ball strikes the paddle near one of the ends, it will be deflected more strongly than if it strikes near the middle (almost as if it were a curved surface). Additionally, if the paddle is in motion, the motion of the paddle is added to the deflection. In order to obtain the strongest deflection, the ball must strike near the end of the paddle, and the paddle must be in motion towards that same end. This is very similar to the original Pong for Atari 2600.
Pause - The game may be paused at any time by pressing the Space bar. Play will resume upon pressing the space bar a second time.
Controls - As with the example, player 1 moves with the Q and A keys, and player 2 moves with P and L.

from pygame import*
init();d=display;s=d.set_mode((640,480))
g=p=16;j=q=80;x=y=200;o=t=h=v=1;z=m=n=0;w=[255]*3
while s.fill(time.wait(3)):
 event.get();k=key.get_pressed();t^=o*k[32];o=1-k[32];z=z or-k[49]-k[50]*2;e=k[113]-k[97];f=[k[112]-k[108],(h>0)*cmp(y,q-32)][z];a=p<g;b=q-[y,x][a]
 if p%608<g:m,n,p,h,v=[m+1-a,m,n+a,n,g+a*592,p,1-a*2,h/-.96,1,b/32.+~[f,e][a]][-g<b<j::2]
 for r in[(0,x,g,j),(624,y,g,j),(p,q,g,g)]+[(316,i*31,8,15)for i in range(g)]:draw.rect(s,w,r)
 if z*t:v*=(0<q<464)*2-1;x-=(0<x-e<400)*e/.6;y-=(0<y-f<400)*f/.6;p+=h;q+=v
 c=font.SysFont('monospace',j,1).render('%3d %%-3d'%m%n,1,w);s.blit(c,(320-c.get_width()/2,0));d.flip()

cmp is no longer defined in Python 3. The code above can be made Python 3 compatitble by prepending the following:
def cmp(a, b):
  return (a>b)-(a<b)

Sample screen capture:

Note: the font used for the score may vary from system to system.

The score shows in the left half for me, and I think the deflection is too strong, but it's pretty cool anyway :)

@aditsu are you operating under linux? I'll see if I can find an alternative that works regardless of the selected font face. The idea behind the deflection is that it would be possible to deflect the ball at a faster speed (maximum 2.5 on my scale) than the paddle can move (1.67). This is only possible if you give it some 'spin'. If the paddle isn't moving when the ball strikes, the maximum is velocity will be 1.5.

Yes I'm using Linux. I find it strange that the ball can actually go "back" (up or down) after hitting the paddle, instead of continuing in the same direction (perhaps at a different angle). But maybe the Atari version did that, I don't know.

@aditsu It cost a few bytes, but I believe the score should be centered regardless of the font chosen (so long as it is monospace). Let me know if it works for you. And yes, the deflection is very similar (although a smoother distribution) to the Atari version I was familiar with. If you imagine the paddle as a (convexly) curved surface (like an air hockey paddle), I think it should be more intuitive.

Yes it's centered now

HTML & JavaScript (take 2) - 525
Since the OP didn't seem to care much about the "as close as possible" part, here's an alternative solution that I mercilessly simplified, stripped and golfed. Q/A and P/L to play, but every other key also has an effect. Again, the code is fully self-contained and I tested it in Chromium 25 on Linux. I can golf it even further if you can accept small bugs or greater degradation of graphics quality/gameplay.
<canvas id=c><script>C=c.getContext('2d');f=C.fillRect.bind(C)
S=[-1,I=J=0];A=B=210;X=Y=1
function g(n){++S[n];N=Math.random(M=n*613+9)*471}D=document
D.onkeydown=D.onkeyup=function(e){d=!!e.type[5];k=e.keyCode
k&1?I=k&16?d:-d:J=k&4?-d:d}
g(0);setInterval(function(){A-=A<I|A>420+I?0:I
B-=B<J|B>420+J?0:J
M+=X;N+=Y
N<0|N>471?Y=-Y:0
M==622&N>B&N<B+51|M==9&N>A&N<A+51?X=-X:M>630?g(0):M||g(1)
f(0,0,c.width=640,c.height=480)
C.fillStyle='tan';C.font='4em x';C.fillText(S,280,60)
f(0,A,9,60);f(631,B,9,60);f(M,N,9,9)},6)</script>

Thanks Shmiddty

I don't understand the objection. As far as I can recall, the 715 byte version (edited 3 hours before this post) is nearly identical to the original version of Pong I had for my Atari 2600.

@primo I'm assuming you're talking about my implied claim that your solution does not meet the "as close as possible" criterion. Well, the OP did not mention the Atari 2600 version, but a specific javascript implementation that he linked to. And at first sight there are 2 glaring differences in your code: no computer player and no "7-segment" score display. There are probably a lot more differences in the "mechanics". If these things are not important, then I think this solution should be valid too.

This is my mistake. I did really mean "as close as possible" so your first solution is the best so far.

you can remove the c=window.c. You're assigning a global variable to itself.

You can save 1 more character by moving ++S[n] inside of .random(++S[n])

Processing, 487 characters
int a=320,b=240,c=2,d=2,e=0,f=0,g=0,h=0,i=15,j=80,k=640,
l=160,m;void setup(){size(k,b*2);}void draw(){background
(0);if(keyPressed){if(key=='q'&&g>0)g-=i;if(key=='a'&&g<
j*5)g+=i;if(key=='o'&&h>0)h-=i;if(key=='l'&&h<j*5)h+=i;}
rect(0,g,i,j);for(m=0;m<k;m+=30)rect(312,m,i,i);rect(a,b
,i,i);rect(625,h,i,j);a+=c;b+=d;c*=a<i&&(b>g&&b+i<g+j)||
a>610&&(b>h&&b+i<h+j)?-1:1;d*=b<0||b>=465?-1:1;if(a<0){f
++;a=0;b=240;c=2;}if(a>k){e++;a=625;b=240;c=-2;}textSize
(j);text(e,l,j);text(f,3*l,j);}

Sample screenshot:

This code was made with shortness in mind, so it is pretty buggy (the ball sometimes goes through the paddle, or wraps around it). Controls are Q/A for Player 1 and O/L for Player 2.

As a game your Pong version also seems quite unfair, as only one player's keys are registered per frame :P

TI-Basic, 328 326 bytes
AxesOff:ZInteger:GridOn
99→Xscl:2→Yscl:1→U:1→V
Pt-Change(0,0
Line(Xmin,0,Xmin,9
Line(Xmax,0,Xmax,9
While 1
If 30≤abs(Y
-V→V
Pt-Change(X,Y
If X≥46:Then
If Y≥E and Y≤E+9:Then
-U→U
Else
IS>(A,9
X-90→X
End
End
If X≤-46:Then
If Y≥D and Y≤D+5:Then
-U→U
Else
IS>(B,9
X+90→X
End
End
If 9<max(A,B
Stop
X+U→X:Y+V→Y
Pt-Change(X,Y
Text(1,43,A,":",B
getkey→G
If G=21
1→I
If G=41
-1→I
If G=25
1→J
If G=34
-1→J
I(G≠31→I
J(G≠26→J
D+I→D:E+J→E
For(θ,-1,9,10
Pt-Change(Xmin-not(I),D+θ-I/2
Pt-Change(Xmax+not(J),E+θ-J/2
End
End

This program is very basic (constant speed and angles) but since there's is no precise specifications, the strict minimum will do
Since a long press is not detectable (or 2 keys pressed at the same time), an extra key is used to stop the movement of the racket
Here is the result at ~5x speed:

A thing of beauty!

HTML & JavaScript - 1663
Against my better judgment, I took the crazy approach of golfing the actual code from the demo. I removed some features and interface elements, but generally it works exactly the same - 0, 1 or 2 to choose the number of human players, Q/A and P/L to move.
Unless I made some mistakes, gameplay should be identical, pixel for pixel and millisecond for millisecond, to the original at 640*480 (hint: resizing the browser window changes the game size in the demo). It just doesn't give instructions, doesn't announce the winner and doesn't handle esc.
The code is fully self-contained and I tested it in Chromium 25 on Linux. Firefox doesn't like it very much.
<body bgcolor=0><canvas id=c height=480><script>R=Math.random
C=c.getContext('2d');f=C.fillRect.bind(C)
S=[l=G=I=J=K=L=0,0];r=17;u=463;o=24;q=12;z=10;s=640;v=36
function T(z,t,u,v){P=0;if(e=v*E-u*F){a=(u*t-v*z)/e;b=(E*t-F*z)/e
a<0|a>1|b<0|b>1?0:P={x:M+a*E,y:N+a*F,d:u,s:0,X:X,Y:Y}}}function
i(p,q,h){T(p-22*(E<0),q,0,h)
P?0:T(p,q-h*(F<0),22,0)}function
U(p){if(p.a)if(M<p.x&X<0|M>p.x+q&X>0)p.u=0
else{P=p.P;if(P&&P.X*X>0&P.Y*Y>0&P.s<p.l/z)P.s+=t
else{E=X*z;F=Y*z;i(M-p.x+5,s*q,s*o)
if(p.P=P){y=P.y;while(y<r|y>u)y=y<r?34-y:y>u?u+u-y:y
P.y=y+R(e=(p.l+2)*(X<0?M-p.x-q:p.x-M)/64)*2*e-e}}P?p.u=P.y<p.y+25?1:P.y>p.y+35?-1:0:0}y=p.y-p.u*t*198
p.y=y<q?q:y>408?408:y}function
W(n,x){a=9.6;b=[~8,3,62,31,75,93,~2,7,-1,u][n]
b&4&&f(x,o,v,a);b&64&&f(x,o,a,o)
b&2&&f(x+v,o,-a,o);b&8&&f(x,43.2,v,a)
b&32&&f(x,48,a,o);b&1&&f(x+v,48,-a,o)
b&16&&f(x,72,v,-a)}A={u:0,x:0,y:210};B={u:0,x:628,y:210}
function g(n){if(++S[n]>8)G=A.a=B.a=0
else{N=R(M=n?635:5)*446+r;Y=157.5;X=n?-Y:Y
A.l=z+S[0]-S[1];B.l=20-A.l}}D=document
D.onkeydown=D.onkeyup=function(e){d=!!e.type[5]
k=e.keyCode-45;if(k>2&k<6&d&!G){G=S=[-1,0];A.a=k<4;B.a=k<5
g(0)}k^31?k^35?k^20?k^v?0:I=d:J=d:K=d:L=d
A.a?0:A.u=I-J;B.a?0:B.u=K-L}
setInterval(function(){t=new Date()/1000-l;l+=t;U(A);U(B)
if(G){E=t*X+4*t*t;F=t*Y+4*t*t
x=M+E;y=N+F;m=X+t*(X>0?8:-8);n=Y+t*(Y>0?8:-8)
if(n>0&y>u){y=u;n=-n}if(n<0&y<r){y=r;n=-n}p=m<0?A:B
i(M-p.x+5,N-p.y+5,70)
if(P){if(P.d){y=P.y;n=-n}else{x=P.x;m=-m}n*=n*p.u<0?.5:p.u?1.5:1}M=x;N=y
X=m;Y=n;M>645?g(0):M<-5&&g(1)}c.width=s;C.fillStyle='#fff'
f(0,0,s,q);f(0,468,s,q);for(j=o;j--;)f(314,6+o*j,q,q)
W(S[0],266.5);W(S[1],338.5)
f(0,A.y,q,60);f(s,B.y,-q,60);G&&f(M-5,N-5,z,z)},50/3)</script>

Some credits to Shmiddty for improvements

C# - 1283 characters
This can be golfed quite a bit more but here it is.
using System;using System.Drawing;using System.Runtime.InteropServices;using System.Windows.Forms;using r=System.Drawing.RectangleF;namespace f{public partial class f:Form{public f(){InitializeComponent();}private void f_Load(object sender,EventArgs e){var t=this;var s=new r(0,0,300,300);var q=new r(0,0,15,50);var o=new r(0,0,15,50);var x=new PointF(150,150);var v=.06F;var h=v;var b=new r(x.X,x.Y,15,15);var p1=0;var p2=0;var p=new PictureBox{Size=t.Size,Location=new Point(0,0)};t.Controls.Add(p);p.Paint+=(wh,n)=>{var g=n.Graphics;Action<Brush,r>f=g.FillRectangle;var k=new SolidBrush(Color.Black);var w=new SolidBrush(Color.White);var d=new byte[256];GetKeyboardState(d);var l=q.Location;var _1=.1F;q.Location=new PointF(0,d[90]>1?l.Y+_1:d[81]>1?l.Y-_1:l.Y);l=o.Location;o.Location=new PointF(269,d[77]>1?l.Y+_1:d[79]>1?l.Y-_1:l.Y);f(k,s);f(w,q);f(w,o);Func<r,bool>i=b.IntersectsWith;h=i(q)||i(o)?-h:h;v=b.Top<1||b.Bottom>t.Height-30?-v:v;b.Offset(h,v);if(b.Left<0){p2++;b.Location=x;}if(b.Right>290){p1++;b.Location=x;}f(w,b);for(int j=0;j<19;)f(w,new r(140,(j+(j++%2))*15,10,10));var a=new Font("Arial",20);g.DrawString(p1.ToString(),a,w,100,12);g.DrawString(p2.ToString(),a,w,170,12);p.Invalidate();};}[DllImport("user32.dll")]static extern bool GetKeyboardState(byte[]s);}}

Edit: Didn't see the requirement for a free, linux-runnable language...

K (oK) + iKe, 393 335 bytes
q:p:-15+h%2
d:w,h
b:-2+d%2
v:5 -1
s:t:0
tick:{b::v+0|d&b
$[$[0>*b;t+::1;w<*b;s+::1;0];b::-2+d%2;0]
v*::$[(&/(b>(0;p-5))&b<(10;p+30))|&/(b>(w-15;q-5))&b<(w;q+30);-1;1],1}
draw:{((;gray);(((0;p);(w-5;q));;30 5#1);(b;;5 5#1);((w%4;0);;~,/'+text(),$t);((-10+3*w%4;0);;~,/'+text(),$s))}
kd:{$[x=81;p-::5;x=65;p+::5;x=80;q-::5;x=76;q+::5;0]}

Try it online!
My first K answer!
Was really fun to do in K. Kinda sad that the question spec isn't too specific about the implementation.
This answer has points based scoring, involves two players and no AI.

How do you move the paddles?

same as the reference given. Q&A for p1, P&L for p2.

Tcl/Tk, 932 bytes
Must be run in the interactive shell
gri [can .c -w 1024 -he 768 -bg #000]
proc A {} {set ::v [expr (int(rand()*36)+1)*20]}
proc R {C t\ X} {.c cr r $C -f #aaa -t $t}
proc I {} {incr ::v 20}
time {R "504 [I] 520 [I]"} 18
R "0 0 1024 20"
R "0 748 1024 768"
R "0 340 20 440" b
R "1004 340 1024 440" B
R "40 [A] 60 [I]" P
lmap n 4\ 5 T F\ S {.c cr t ${n}62 60 -ta $T -te 0 -fi #aaa -font {"" 56}}
proc C t\ n {lindex [.c coo $t] $n}
lmap {a b c d e} {q b 1 >20 -20 a b 3 <740 20 p B 1 >20 -20 l B 3 <740 20} {bind . $a "if \[C $b $c]$d {.c move $b 0 $e}"}
lassign {0 0 20 20} F S y x
proc M {} {lmap {_ a b c d e f} {0 <40 b 20 S 960 980 2 >984 B -20 F 80 100} {if [C P $_]$a {if [C P 1]>=[C $b 1]&&[C P 3]<=[C $b 3] {bell
set ::x $c} {.c itemco $d -te [incr ::$d]
if \$::$d>8 {tk_messageBox -message WINNER!
lmap T F\ S {.c itemco $T -te [set ::$T 0]}}
.c coo P $e [A] $f [I]}}}
.c move P $::x [set ::y [expr [C P 1]<40?20:[C P 3]>727?-20:$::y]]
after 99 M}
M
focus -f .

Note:
 #There is an Enter at the end

Just a very minimal version of Pong, where the ball only runs in diagonal angles and always has same velocity.

Failed outgolf: https://bit.ly/2VSIGz8


text:
Solve the CodeSprint4 Leibniz code golf challenge in Python in 66 characters
Check out this challenge:
https://www.hackerrank.com/codesprint4/challenges/leibniz
(The competition has already ended, so I'm just curious about the Python solution, which the organizers refused to reveal, so this is not cheating in any way.)
Modified from that page:

In Calculus, the Leibniz formula for \$\pi\$ is given by:
$$\sum_{n=0}^\infty \dfrac{\left(-1\right)^n}{2n+1}$$
You will be given an integer \$n\$. Your task is to print the summation of the Leibniz formula up to the \$n\$th term of the series correct to 15 decimal places.
That is given \$n\$ calculate:
$$\sum_{k=0}^n \dfrac{\left(-1\right)^k}{2k+1}$$
with the first 15 decimal places correct.
Input Format
The first line contains the number of test cases (\$T\$) which is less than 100. Each additional line is a test case for a positive integer value less than 10^7.
Output Format
Output \$T\$ lines each containing the calculated result for the corresponding line of the input.
Scoring
This is code-golf.

I only managed to solve the challenge in 77 characters. (Talking only about Python here.) However, one adr2370 managed to solve the challenge in 66 characters!
Please help me find the 66-character solution! I'm very very curious because I had to work really hard to bring mine down to 77, and I'm amazed as to how someone came up with a 66-character solution.
For reference, my solution:
for j in'x'*input():print'%.15f'%sum((-1)**i/(2.*i+1)for i in range(input()))

Very close to being a duplicate of Calculate pi to 5 decimals (which has a Python solution, FWIW).

Sorry, I'm curious about a solution for this exact puzzle, not a related puzzle.

Suggest you read through tips-for-golfing-in-python. You can easily drop a few more chars

You should open it up to other languages and see how short people can program it :)

adr2370's solution is longer: https://github.com/adr2370/HackerRankBackToSchool/blob/master/Leibniz.py

Actually, it seems the top python solution wasn't really python, it was just a hack. So no one got a 66-character solution.

@Ari I'm very curious to know why you think the 66 characters solution was a hack.

For what it's worth, neither your solution nor any of the ones currently present in answers meet the stated specification. E.g. none of them give the correctly rounded answer of 0.785395663397448 for 100000 terms.

Can you include a description of what the code should do?  As it is, it's not clear what you're asking, as the requirements are hidden beyond a link, rather than in the body of the question.  (I tried following the link, but it's just a blank page, so not much help).

Python 71 bytes
exec"print'%.15g'%sum((-1.)**i/(i-~i)for i in range(input()));"*input()

Not quite 66 bytes, but with a score of 22.90, it would have ranked second overall.
Edit: regarding Ari's comment about the 66 byte Python solution being a 'hack', I don't think that's exactly what happened. I've noticed several times that the submitted language is displayed incorrectly. For example here: Baconian Cipher. This challenge may only be submitted in Brainf_ck, yet the second ranked solution was submitted in Python 2 (interestingly enough, spot 23 is also Python 2. If I were to speculate, I would say that if the language information is missing from a submission for whatever reason, it seems to default to Python).
I suspect that a similar error may have occurred here, and that the shortest Python solution submitted during the challenge was actually 72 bytes.
Update: After speaking with a moderator, it seems that Ari was right:

Delightful hacks here!

Python, 65 characters
exec'print`sum((-1.)**x/(x-~x)for x in range(input()))`;'*input()

Interesting. The result of input 10, for example, is not correctly rounded, but is still accepted as correct. Nice find.

Python 2 (50 chars, with input loop grows)
a=n=1.;s=0;exec's+=a/n;a=-a;n+=2;'*input();print s

also prints only 12 digits of result, with loop and formatting
exec input()*"a=n=1.;s=0;exec's+=a/n;a=-a;n+=2;'*input();print '%.15f'%s;"

74 chars
Python 3 (57 chars, with input loop grows to 79 chars)
without loop
a=n=1;s=0;exec('s+=a/n;a=-a;n+=2;'*int(input()));print(s)

with loop
exec(int(input())*"a=n=1;s=0;exec('s+=a/n;a=-a;n+=2;'*int(input()));print(s);")

Python 3 prints 16 digits by default
exec(int(input())*"print(sum((-1)**i/(i-~i)for i in range(int(input()))));")

76 chars

A few problems: these don't iterate through a list of inputs (but rather only process a single input), and don't output the answer rounded to 15 decimal places (by default, Python only prints 12 digits of a float). Under these conditions, 49 bytes is possible, simply by removing the formatting and iteration from the accepted answer print sum((-1.)**i/(i-~i)for i in range(input()))


text:
Print ASCII histogram
The challenge is to give as short code as possible to print an ASCII histogram of a set of data.
Input.  The number of bins followed by a number of integers representing the data. The data are space separated.
Output. An ASCII histogram of the data using the specified number of bins.
Score. Number of characters in the code excluding trailing whitespace at the beginning or end of each line.
Example input.
2    2    3    4    2    2    5

Example output.
*
*
**
**

Update. The answers are all great although I can only ever imagine using the one in R.  No python contribution?

What is the relation between your input and output?

I think the first value of the input is the number of bins and all the others the vector to proceed: if you split it into two bins of equal size, the first one contains 4 values (three 2s and one 3) and the second 2 values (a 4 and a 5).

@plannapus. That's right. Thanks.

Related to an oldie on Stack Overflow: Code golf: Word frequency chart.

Are the bin sizes integers also. If so what answer do you get for: 4 1 1 2 2 5 8 9 6 3

@Graham I had only thought about the integer sizes! For case you give it would ideally do something sensible although I didn't define it.

@Majid I note your update but from the site FAQ "Code golf is a special type of programming puzzle where the shortest correct code submission wins." You have selected the longest!

@Graham You are 100% right. I should have specified in the question that I would award to a "sensible" language.

See also this similar question on reddit: [2017-02-08] Challenge #302 [Intermediate] ASCII Histogram Maker: Part 1 - The Simple Bar Chart

APL 66 51
' *'[1+(⌽⍳b)∘.≤v←+/(⍳b)∘.=⌈x[⍋x]÷(⌈/x←1↓v)÷b←↑v←⍎⍞]

Using the example I quoted in my comment on the question where the bin size is 2.25:
4 1 1 2 2 5 8 9 6 3

*
*
* **
****

How can you run it at tryapl.org? It gives me invalid token error in the ways I tried.

I can very rarely get that to work. If you want to play around with APL then I suggest you download the free interpreter from here: http://www.nars2000.org/

@Graham How do you even type that line on a normal keyboard?

You don't without an APL interpreter. If you download the interpreter I suggested above you can then either use a keyboard map to type the APL, use the on screen point and click APL keyboard or simply copy and paste from this page.

GolfScript, 57 55 52 characters
~](\$:?;:b,{{\?0=-b*?)\0=-)/=" *"=}+?%$}%zip{32-},n*

Taking input as single line from STDIN. Script can be tested online.
Example:
> 4 1 1 2 2 5 8 6 3
*
*
* *
****

Following on from my comment on the question what bin size does your code give for an input of: 4 1 1 2 2 5 8 9 6 3 and are you happy with the ASCII result?

J, 96 86
(' *'{~|.@|:@(>/i.@(>./))@(}:@}:,{:@}:+{:)@(+/@(=/i.@>:@{.)~<.@({.*(%>./)@(-<./)@}.)))

In a little more readable format: http://pastebin.com/2CiaJXjC.
   (...) 2 2 3 4 2 2 5
*
*
**
**
   (...) 4 1 1 2 2 5 8 6 3
*
*
* *
****

Step by step on example values: http://pastebin.com/nXjGcq8L.

R - 133 122 characters
a=scan()
b=table(cut(a[-1],a[1]))
invisible(apply(cbind(sapply(b,function(x)c(rep(" ",max(b)-x),rep("*",x))),"\n"),1,cat))

When sourced, it prompts the user for input (because of scan), and output the ascii histogram.
> source('asciihist.R')
1: 2 2 3 4 5 2 2 5
9:
Read 8 items
*
* *
* *
* *

> source('asciihist.R')
1: 4 1 1 2 2 5 8 6 3
10:
Read 9 items
*
*
*   *
* * * *

Due to vector recycling, you could replace rep("\n",d) with "\n". This would save 7 characters.

@SvenHohenstein Better than that actually: I don't need to declare d anymore! Thanks!

I accepted this one as it is in a language I might possibly use. Apologies to the other great entries.

I unaccepted as I see I wasn't following the house rules. Sorry.


text:
Find largest prime which is still a prime after digit deletion
Over at https://math.stackexchange.com/questions/33094/deleting-any-digit-yields-a-prime-is-there-a-name-for-this the following question is asked. How many primes are there that remain prime after you delete any one of its digits? For example 719 is such a prime as you get 71, 19 and 79. While this question is unresolved I thought it make a nice coding challenge.
Task.  Give the largest prime you can find that remains a prime after you delete any one of its digits.  You should also provide the code that finds it.
Score. The value of the prime you give.
You can  use any programming language and libraries you like as long as they are free.
To start things off, 99444901133 is the largest given on the linked page.
Time limit. I will accept the largest correct answer given exactly one week after the first correct answer larger than 99444901133 is given in an answer.
Scores so far.
Python (primo)
4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111
J (randomra) (This answer started the one week timer on 21st Feb 2013.)
222223333333

9901444133 (a deletion of one 9) isn't prime (7 x 1414492019). Your previous example was correct, though.

@primo Thanks, fixed. That was an odd typo of mine.

If there is a largest one - as the analysis seems to indicate, I wonder how you could go about a proof when you think you've found it.

What about other bases? In base 2, I could not find anything higher than 11 (2r1011), 11 also in base 3 (3r102), 262151 in base 4 (4r1000000013), 17 in base 5 (5r32), 37 in base 7 (7r52), 47 in base 9 (9r52).

274 digits
4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111

This took about 20 hours of CPU time to find, and about 2 minutes per prime to prove. In contrast, the 84 digit solution can be found in around 3 minutes.
84 digits
444444444444444444444444444444444444444444444444441111111113333333333333333333333333

77777777999999999999999777777777 (32 digits)
66666666666666622222222222222333 (32 digits)
647777777777777777777777777 (27 digits)
44444441333333333333 (20 digits)
999996677777777777 (18 digits)
167777777777777 (15 digits)
I recommend this tool if you want to confirm primality: D. Alpern's ECM Applet
Also using a repdigit approach, which seems to be the approach most likely to find large values. The following script algorithmically skips over most numbers or truncations which will result in multiples of 2, 3, 5 and now 11 c/o PeterTaylor (his contribution increased the efficiency by approximately 50%).
from my_math import is_prime

sets = [
 (set('147'), set('0147369'), set('1379')),
 (set('369'), set('147'), set('1379')),
 (set('369'), set('0369'), set('17')),
 (set('258'), set('0258369'), set('39')),
 (set('369'), set('258'), set('39'))]

div2or5 = set('024568')

for n in range(3, 100):
 for sa, sb, sc in sets:
  for a in sa:
   for b in sb-set([a]):
    bm1 = int(b in div2or5)
    for c in sc-set([b]):
     if int(a+b+c)%11 == 0: continue
     for na in xrange(1, n-1, 1+(n&1)):
      eb = n - na
      for nb in xrange(1, eb-bm1, 1+(~eb&1)):
       nc = eb - nb
       if not is_prime(long(a*(na-1) + b*nb + c*nc)):
        continue
       if not is_prime(long(a*na + b*(nb-1) + c*nc)):
        continue
       if not is_prime(long(a*na + b*nb + c*(nc-1))):
        continue
       if not is_prime(long(a*na + b*nb + c*nc)):
        continue
       print a*na + b*nb + c*nc

my_math.py can be found here: http://codepad.org/KtXsydxK
Alternatively, you could also use the gmpy.is_prime function: GMPY Project
Some small speed improvements as a result of profiling. The primality check for the longest of the four candidates has been moved to the end, xrange replaces range, and long replaces int type casts. int seems to have unnecessary overhead if the evaluated expression results in a long.

Divisibility Rules
Let N be a postitive integer of the form a...ab...bc...c, where a, b and c are repeated digits.
By 2 and 5
 - To avoid divisibility by 2 and 5, c may not be in the set [0, 2, 4, 5, 6, 8]. Additionally, if b is a member of this set, the length of c may be no less than 2.
By 3
 - If N = 1 (mod 3), then N may not contain any of [1, 4, 7], as removing any of these would trivially result in a multiple of 3. Likewise for N = 2 (mod 3) and [2, 5, 8]. This implementation uses a slightly weakened form of this: if N contains one of [1, 4, 7], it may not contain any of [2, 5, 8], and vice versa. Additionally, N may not consist solely of [0, 3, 6, 9]. This is largely an equivalent statement, but it does allow for some trivial cases, for example a, b, and c each being repeated a multiple of 3 times.
By 11
 - As PeterTaylor notes, if N is of the form aabbcc...xxyyzz, that is it consists only of digits repeated an even number of times, it is trivially divisible by 11: a0b0c...x0y0z. This observation eliminates half of the search space. If N is of odd length, then the length of a, b and c must all be odd as well (75% search space reduction), and if N is of even length, then only one of a, b or c may be even in length (25% search space reduction).
 - Conjecture: if abc is a multiple of 11, for example 407, then all odd repetitions of a, b and c will also be multiples of 11. This falls out of the scope of the above divisibility by 11 rule; in fact, only odd repetitions are among those which are explicitly allowed. I don't have a proof for this, but systematic testing was unable to find a counter-example. Compare: 444077777, 44444000777, 44444440000077777777777, etc. Anyone may feel free to prove or disprove this conjecture. aditsu has since demonstrated this to be correct.

Other Forms
2 sets of repeated digits
Numbers of the form that randomra was pursuing, a...ab...b, seem to be much more rare. There are only 7 solutions less than 101700, the largest of which is 12 digits in length.
4 sets of repeated digits
Numbers of this form, a...ab...bc...cd...d, appear to be more densely distributed than those I was searching for. There are 69 solutions less than 10100, compared to the 32 using 3 sets of repeated digits. Those between 1011 and 10100 are as follows:
190000007777
700000011119
955666663333
47444444441111
66666622222399
280000000033333
1111333333334999
1111333333377779
1199999999900111
3355555666999999
2222233333000099
55555922222222233333
444444440004449999999
3366666633333333377777
3333333333999888883333
4441111113333333333311111
2222222293333333333333999999
999999999339999999977777777777
22222226666666222222222299999999
333333333333333333339944444444444999999999
559999999999933333333333339999999999999999
3333333333333333333111111111111666666666611111
11111111333330000000000000111111111111111111111
777777777770000000000000000000033333339999999999999999999999999
3333333333333333333333333333333333333333333333336666666977777777777777
666666666666666666611111113333337777777777777777777777777777777777777777
3333333333333333333888889999999999999999999999999999999999999999999999999933333333

There's a simple heuristic argument as to why this should be the case. For each digital length, there is a number of repeated sets (i.e. 3 repeated sets, or 4 repeated sets, etc.) for which the expected number of solutions will be the highest. The transition occurs when the number of additional possible solutions, taken as a ratio, outweighs the probability that the additional number to be checked is prime. Given the exponential nature of the possibilities to check, and the logarithmic nature of prime number distribution, this happens relatively quickly.
If, for example, we wanted to find a 300 digit solution, checking 4 sets of repeated digits would be far more likely to produce a solution than 3 sets, and 5 sets would be more likely still. However, with the computing power that I have at my disposal, finding a solution much larger than 100 digits with 4 sets would be outside of my capacity, let alone 5 or 6.

Any solution of the form d^x e^y f^z requires at least two of the sequence lengths to be odd to avoid divisibility by 11. I don't know whether is_prime will reject multiples of 11 quickly enough to make this not worth explicitly taking into account.

I don't have the gmp source in front of me, but it very likely begins with trial division over small primes. Still, (na&1)+(nb&1)+(nc&1) > 1 is simple enough that it should be faster. Wait a minute, this can short-curcuit full branches! If na is even, and nb + nc is odd, then one of [nb, nc] must necessarily be even, and you can just skip to the next na.

Be careful if you are using gmpy.is_prime(). Beyond a certain point it is probabilistic, so you need to check it returns a 2. 1 means it's only probably a prime

Looks like my_math also becomes probablistic, but doesn't make a distinction between certain primes and  probably primes.

+1 Very impressive. Would you explain how it works? Does set('369') mean the set of {3,6,9}? What are sa, sb, sc? (I assume they are the three subsets of sets but I'm puzzled how the compiler knows this.

@DavidCarraher set('369') is equivalent to set(['3', '6', '9']), as strings are sequence types. sets is an array of tuples, with sa the first set of the tuple, sb the second set, and sc the third. The set distribution is based on the observation that if n = 1 (mod 3), then n may contain none of 1, 4, 7, and likewise for n = 2 (mod 3) and 2, 5, 8 (as removing one of these would trivially produce a multiple of 3). This is weakened to be: if n contains a 1, 4 or 7, it may not contain a 2, 5 or 8, and vice versa, which is largely an equivalent statement.

I would +1 again if I could.

I'm puzzled that the proof that 444444444444444444444444444444444444444444444444441111111113333333333 33333333333333 is a "robust prime" takes 2 minutes. It takes less than .002 s with Mathematica. Surely you realize that you only have to verify that 4 numbers are all primes?

The 84 digit prime take a negligible amount of time to prove (using APRT-CLE). It's the 274 digit prime that takes about 2 minutes for each of the four.

A direct and exact test for divisibility by 11 is to add all the digits in even positions and subtract all the digits in odd positions (or vice versa) and check if the result is a multiple of 11. As a corollary (but can also be deduced directly), you can reduce all sequences of 2+ identical digits to 0 or 1 digits (taking the sequence length % 2). 44444440000077777777777 thus reduces to 407; 4+7-0=11. 444444444444444444444444444444444444444444444444441111111113333333333333333333333333 reduces to 13.

Also, for divisibility by 7 you can similarly reduce sequences of digits by taking the sequence length % 6 (and that works for 11, 13 and 37 too at the same time). 444444444444444444444444444444444444444444444444441111111113333333333333333333333333 -> 441113

The 274 digit prime took .04 s to verify as robust; i.e. it verified that the original and the 3 clipped numbers are all primes.  That's quite a difference from 8 min.  Looks like the PrimeQ you are using is slow. (Which is no criticism of your brilliant work.)

@DavidCarraher well, the App is written in Java ;)

"robust" != proven.  The difference is unimportant to some, crucial to others.  PrimeQ in Mathematica is a BPSW variant plus an extra M-R with base 3, so of course that will only take a couple milliseconds.  Pari/GP proves the 274 digit number using APR-CL in about 3 seconds on a 5 year old computer, and single-core open source ECPP takes about 2 seconds.  No surprise it takes longer for Java, but it isn't a big deal.  I had my Perl translation of this do BPSW on all 4, then a proof on all 4 only if they all passed the cheap tests.

222223333333 (12 digits)
Here I only searched aa..aabb..bb format up to 100 digits. Only other hits are 23 37 53 73 113 311.
J code (cleaned up) (sorry, no explanation):
a=.>,{,~<>:i.100
b=.>,{,~<i.10
num=.".@(1&":)@#~
p=.(*/"1@:((1&p:)@num) (]-"1(0,=@i.@#)))"1 1
]res=./:~~.,b (p#num)"1 1/ a

An exhaustive search of this form up to 1560 digits (and counting) reveals nothing larger than this 12 digit solution.

Javascript (Brute Force)
Has not yet found a higher number
http://jsfiddle.net/79FDr/4/
Without a bigint library, javascript is limited to integers <= 2^53.
Since it's Javascript, the browser will complain if we don't release the execution thread for the UI to update, as a result, I decided to track where the algorithm is in its progression in the UI.
function isPrime(n){
    return n==2||(n>1&&n%2!=0&&(function(){
        for(var i=3,max=Math.sqrt(n);i<=max;i+=2)if(n%i==0)return false;
        return true;
    })());
};

var o=$("#o"), m=Math.pow(2,53),S=$("#s");

(function loop(n){
    var s = n.toString(),t,p=true,i=l=s.length,h={};
    if(isPrime(n)){
        while(--i){
            t=s.substring(0,i-1) + s.substring(i,l); // cut out a digit
            if(!h[t]){   // keep a hash of numbers tested so we don't end up testing
                h[t]=1;  // the same number multiple times
                if(!isPrime(+t)){p=false;break;}
            }
        }
        if(p)
            o.append($("<span>"+n+"</span>"));
    }
    S.text(n);
    if(n+2 < m)setTimeout(function(){
        loop(n+2);
    },1);
})(99444901133);

@Schmiddty There are big int libraries for js but this brute force method seems doomed.

@motl7 Agreed, left it running all night, and no answers have been found.

A link to an analysis of the problem was posted, but I thought it was missing a few things. Let's look at numbers of m digits, consisting of k sequences of 1 or more identical digits. It was shown that if we split digits into the groups { 0, 3, 6, 9 }, { 1, 4, 7 }, and { 2, 5, 8 }, a solution cannot contain digits from both the second and third group, and it must contain 3n + 2 digits from one of these groups. At least two of the k sequences must have an odd number of digits. Out of the digits { 1, 4, 7 } only 1 and 7 can be the lowest digit. None of { 2, 5, 8 } can be the lowest digit. So there are either four (1, 3, 7, 9) or two (3, 9) choices for the lowest digit, six choices of digits for the other sequences of equal digits (7 digits but not the same as the previous sequence) except on average about 5 1/7 choices for the highest digit (0 is excluded giving only 5 choices, except when the second largest sequence contained zeroes).
How many candidates are there? We have m digits split in k sequences of at least 1 digit. There are (m - k + 1) over (k - 1) ways to choose the lengths of these sequences, which is about (m - 1.5k + 2)^(k - 1) / (k - 1)!. There are either 2 or 4 choices for the lowest digit, six in total. There are six choices for the other digits, except 36/7 choices for the highest digit; the total is (6/7) * 6^k. There are 2^k ways to pick whether the length of a sequence is even or odd; k + 1 of these are excluded because none or only one are odd; we multiply the number of choices by (1 - (k + 1) / 2^k), which is 1/4 when k = 2, 1/2 when k = 3, 11/16 when k = 4 etc. The number of digits from the set { 1, 4, 7 } or { 2, 5, 8 } must be 3n + 2, so the number of choices are divided by 3.
Multiplying all these numbers, the number of candidates is
(m - 1.5k + 2)^(k - 1) / (k - 1)! * (6/7) * 6^k * (1 - (k + 1) / 2^k) / 3

or
(m - 1.5k + 2)^(k - 1) / (k - 1)! * (2/7) * 6^k * (1 - (k + 1) / 2^k)

The candidate itself and k numbers which are created by removing a digit must all be primes. The probability that a random integer around N is prime is about 1 / ln N. The probability for a random m digit number is about 1 / (m ln 10). However, the numbers here are not random. They have all been picked to be not divisible by 2, 3, or 5. 8 out of any 30 consecutive integers are not divisible by 2, 3, or 5. Therefore, the probability of being a prime is (30 / 8) / (m ln 10) or about 1.6286 / m.
The expected number of solutions is about
(m - 1.5k + 2)^(k - 1) / (k - 1)! * (2/7) * 6^k * (1 - (k + 1) / 2^k) * (1.6286 / m)^(k + 1)

or for large m about
(1 - (1.5k - 2) / m)^(k - 1) / (k - 1)! * 0.465 * 9.772^k * (1 - (k + 1) / 2^k) / m^2

For k = 2, 3, 4, ... we get the following:
k = 2: 11.1 * (1 - 1/m) / m^2
k = 3: 108 * (1 - 2.5/m)^2 / m^2
k = 4: 486 * (1 - 4/m)^3 / m^2

k = 10: 10,065 * (1 - 13/m)^9 / m^2

From k = 10 onward, the number gets smaller again.

Welcome to PPCG! This is an excellent analysis; however, we look for answers to be legitimate responses to the question. In other words, code. Unfortunately, that leaves scant space in our structure for commentary-only posts, which are relegated to the post comments. However, I would hate to see such a thorough effort be relegated to our slush pile, so I'd like to hint that if you added a computer program designed to answer the challenge requirements to your post, it would be more likely to be kept around.

Also, I strongly recommend you check out our sister sites: https://math.stackexchange.com and http://mathoverflow.net/