text:
Enumerate the primes using only unary arithmetic
Write a program which prints the sequence of prime numbers. The shortest solution wins!
All numbers must have a unary representation (not just in the output, but throughout the entire program). This could be a string of 1s, a list of 1s, Peano-style objects, etc.
No particular output format is required, as long as numbers are recognizable. 111, [1, 1, 1], and S(S(S(0))) are all acceptable representations of 3, for example.
Examples of permissible operations:

Appending or prepending a constant value to a string/list
Deleting a constant number of elements from a string/list
Comparing something with a constant, such as "11"
Calling is_empty on a string/list

Examples of what's not allowed:

Any operations on non-unary integers or floats, such as +, %, == or <
Built-in functions which operate on multiple strings/lists, like + or ==
Importing or downloading a library which does unary arithmetic ;-)

Sample programs

Java, with Peano numbers
Python, with strings of 1s

Haskell, 212 135 130 111 104 characters
x⊡[1]=print x>>p x
x⊡s@(_:r)=s∇x where[]∇[]=p x;_∇[]=x⊡r;[]∇y=s∇y;(_:t)∇(_:y)=t∇y
p x=(1:x)⊡x
main=p[1]

The sieve was fun to implement, but simple exhaustive remainder checking is smaller. Strictly adheres to the terms. Unary numbers are represented as lists of 1.
First ten primes:
& runhaskell 13159-UnaryPrimes.hs | head
[1,1]
[1,1,1]
[1,1,1,1,1]
[1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]

No library functions are used at all in the computation. In fact, the only library function used is print, which you can't get away from since you need some library function to output.

C, 220 chars
o(void**n){putchar(n?33:10);n&&o(*n);}
d(void**a,void**b,void**c){return a?d(*a,b,c?*c:*b):c;}
q(void**a,void**b){return a?q(*a,*b):b;}
p(a,s){return!q(&s,a)||d(a,&s,0)&&p(a,&s);}
z;
e(n){p(&n,&z)&&o(&n);e(&n);}
main(){e(&z);}

Explanations:

Numbers are represented as linked lists. NULL is 0, a pointer to N is N+1.
e enumerates numbers by calling itself with &n, i.e. with n+1. It uses p to test for primality and o to print.
p(a,s) tests if a is prime, checking divisors starting from s.
q(a,b) returns false if the numbers are equal. It only works for a<=b.
d(a,b,0) returns false if b divides a. The 3rd parameter is for recursion.
o(n) prints n exclamation marks, followed by a newline.

I get a segfault in the first q call when dereferencing b, though I haven't figured out why - it looks fine to me. I'm running i686-apple-darwin11-gcc-4.2.1.

@Daniel, I can see why it would fail on 64bit, but i686 means 32bit, right? Anyway, you can try adding void * to z and parameters in p and e (I saved precious characters by making them implicitly int, but they're actually pointers).

Perl 39 bytes
$_.=1while/^(11+)\1+$/||print$_||=11,$/

Interestingly enough, a well-known Perl primality test actually relies on unary logic.

Heh, I thought of this but couldn't think of a good rule to prohibit it. My intention was to exclude all built-in functions besides a few, like (if we're using Lisp) cons and cdr, which would exclude regex matching. But +1 since I didn't make that clear.

One might argue that the regex above uses 'variable length comparison', which seems to be at odds with specifically allowing constant comparison. By that logic, something like /11/ would be allowed, but /11+/ would not.

Mathematica, 81 chars
a=s@s@0;b={};While[1<2,Print@a;b~AppendTo~a;While[Or@@((a//.#:>0)==0&/@b),a=s@a]]

Output:

s[s[0]]
s[s[s[0]]]
s[s[s[s[s[0]]]]]
s[s[s[s[s[s[s[0]]]]]]]
s[s[s[s[s[s[s[s[s[s[s[0]]]]]]]]]]]
......

Explanation:
Numbers are represented as Peano numbers. For example, s[s[0]] means 2. I use suffix notation in my code. s@s@0 is just short for s[s[0]].
a//.#:>0 repeatedly replace the pattern # in a with 0. Both a and # in this expression are Peano numbers. In fact, it is equivalent to a mod #. For example, s[s[s[0]]]]]//.s[s[0]]:>0 returns s[0]. So (a//.#:>0)==0 if and only if a is divisible by #.

I didn't want string functions like find-and-replace to be used, but my fault for not making that clear. A nice solution in any case.

Action Script 3 | Many bytes
var endOfTheWorld:Object = new Object();
var timeToEndOfTheWorld:Number = 1;

while(!endOfTheWorld){
    var busted:boolean = false;
    timeToEndOfTheWorld++;

    for (var k:Object in endOfTheWorld) {
        if(timeToEndOfTheWorld % Number(k) == 0){
            busted = true;
            break;
        }
    }
    if(busted){
        continue;
    }

    timeToEndOfTheWorld[timeToEndOfTheWorld] = timeToEndOfTheWorld;
    trace(timeToEndOfTheWorld);
}

P.S
If you think I got wrong with the time to end of the world, then prove it ;)

This is just a stack of ordinary numbers, with explicit arithmetic operations: ++, %, and ==. The aim was to use Paeno or unary numbers, and to avoid all arithmetic operations built into the language.

source: Stack Exchange

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

sort: votes


text:
Shortest code - Finding the kth good cipher
Challenge: A cipher (which is a positive integer) which has any substring not divisible by 2, or has a substring divisible by 11 (other than 0), is defined as 'bad'. All other ciphers are defined as 'good'. Find the kth cipher, in ascending order, which is 'good'.
Input format
The first line of input has a single integer T, the total number of test cases. The next T lines each have an integer k on them.
Output Format
The output should contain T integers on T different lines, the kth good cipher.
Sample Input
2
1
136
Sample Output
2
4008

The question should be reworded as a challenge statement, with an objective winning criterion (for example, shortest code). Although I find the question interesting, general help questions are off-topic here. See: http://codegolf.stackexchange.com/help/on-topic

Thank you. I've done so accordingly. Please do have a look at the question now.

It's much closer to the acceptable format now. The winning criteria is still missing, though. If you intend for it to be code golf (i.e. shortest code), you can add the appropriate tag. I might also recommend changing the input format, to a single value k, and then list more than one test case. As it is, languages with verbose input handling are significantly disadvantaged.

Something isn't consistent: Given that 4008 is 'good', I must infer that both the substrings 0 and 00 are considered "divisible by 2". This is the normal definition. But, by that normal definition, those substrings are also "divisible by 11" and hence 4008 must be 'bad'

I just noticed that now. I've edited the question, so as to not consider 0 to be divisible by 11.

err... 136 contains the substrings 1 and 3, of which neither is divisible by 2.  Thus, 136 should be bad. Please clarify

@JanDvorak 136 is the input, so it's asking for the 136th good cipher, which presumably is 4008.

Perl, 75 74 characters
map{map{1while++$n=~/[13579]|(.+)(?(?{$^N<1|$^N%11})!)/}1..<>;$n=say$n}1..<>

I should point out that the character count is taking advantage of Perl's bizarre feature of allowing a special variable of the form $^X to be spelled with a literal ctrl-X character.
The regex extensions being utilized are also terrifying, but boy do they come in handy.

Or if you'd like to avoid using $^N, the variable $+ should act identically in this case. Also, (?(?{...})!) should be replaceable by (??{...}).

If you're not convinced, consider the following: n×10 + n ≡ 0 (mod 11) for all n ∈ ℤ (this follows directly from the fact that 10 ≡ -1 (mod 11). Therefore, for any match /(.+)(.)/, $1%11 == $2 if and only if $&%11 == 0, which is exactly what's needed. This will break whenever $1%11 == 10, but fortunately this situation can never occur, as all 1s have already been weeded out.

Haskell, 187
import Data.List
d=drop 1
e=[]:d e>>=(\z->map(\y->z++[y])"02468")
f=filter
g=f(all((>0).(`rem`11)).f(>0).map(read.('0':)).(>>=inits).tails)e
main=interact$unlines.map((g!!).read).d.lines

Could save 4 characters by inlining g, but then the code wouldn't be quite as nice.
If the input wasn't preceded by a test case count (like in the Ruby submission), then could save 6 more characters.
& runhaskell 13166-Cipher.hs
2
1
2
136
4008

APL (70)
⍪{⎕{⍺⍺<Z←⍺+∧/{~2|⍵,0=11|⍵~0}⍎¨⊃,/{↑∘⍵¨⍳⍴⍵}¨↓∘Z¨0,⍳⍴Z←⍕⍵:⍵⋄Z∇⍵+1}⍨0}¨⍳⎕

Ruby, 231 227 219
gets
s=[]
l=[]
while(g=gets.to_i)>0
s.push g
end
z=2
until l.size>=s.max
a=z.to_s.split''
l.push z if(1..a.size).flat_map{|n|a.each_cons(n).map{|x|x.join.to_i}}.all?{|x|x<1||x%11>0&&x%2<1}
z+=1
end
puts s.map{|x|l[x-1]}

Input is terminated with an empty line.
If the input was just a list of indeces without the length, I could save 5 characters.
Sample run:
c:\a\ruby>goodc
2
1
136

2
4008

c:\a\ruby>

Sage Notebook, 167 166
for k in list(file(DATA+'i'))[1:]:
 j=n=0
 while j<int(k):n+=1;j+=not[t for t in[int(`n`[i:j])for i in[0..len(`n`)]for j in[i+1..len(`n`)]]if(t%11==0)*t+t%2]
 print n

Sample run ...
Input (in data file named 'i'):
2
1
136

Output:
2
4008

Python 2, 180 179
for k in[input()for i in[0]*input()]:
 j=n=0
 while j<int(k):n+=1;j+=not[t for t in[int(`n`[i:j])for i in range(len(`n`))for j in range(i+1,len(`n`)+1)]if(t%11==0)*t+t%2]
 print n

Sample run ...
>>> 2
>>> 1
>>> 136
2
4008

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


text:
Make a 24 Game Solver
The 24 Game is a card game. On each cards are four interger numbers. For a player, the goal is to use Addition, Subtraction, Multiplication and Division to end up with 24.
The goal of this code golf/puzzle is to write a program that, for four intergers, will state the one or multiple solutions possible with those numbers.
Further notes:

Should work for an input of any four interger numbers (below 24, above 0). If there is no solution, display 0 solutions as output.
Should output the total number of solutions for this set of four numbers as well as the formulas used.

Brackets ()  can be used (and are often important) to get one or multiple solutions.

Should only display distinct solutions. For instance, when given {1, 1, 4, 4}, it should not display the cases where the ones and the fours are swapped. Also, if have a solution (a*b)*(c*d), you should not output (c*d)*(a*b) as well, for instance.

An example:
For {9, 6, 3, 2}, the program should output:
   (9-3-2)×6
   (6+2)×9/3
   6×2+9+3
   (9-3)×(6-2)
   (3-2/6)×9
   9×6/2-3
   9×3-6/2
   (9+6-3)×2
   8 solutions

Kudos if you can make a working program that follows the rules outlined above.
Even more kudos if you do this in as little code as possible.
Happy Code Puzzling/Golfing!

This seems more appropriate as a programming challenge rather than a code-golf.

"display a graceful error message" goes against the spirit of code golf. You should specify one or make it not count against the code length

@JanDvorak Hmm... you are right. I've changed it to outputting '0 solutions' if there are none

@DavidCarraher: All right. I changed the 'victory condition' slightly. You are right, this is quite a difficult challenge so every working program should be treated as a winner.

I am the owner of 24theory and I really appreciate your interest in the game and particularly the solver. When I wrote up the rules in this page, I had one thing in mind. That is to give "real" unique solutions in the most "concise" way. Now how to define "real" and "concise" is up to debate. But in my opinion, switching around orders a + b vs b + a, add "-" signs, like a * b vs (-a) * (-b) are obviously redundant. Applying that principal to {9, 6, 3, 2}: (3-9)(2-6) and (9-3)(6-2) are NOT distinctive as it's the same thing as ab vs (-a)(-b). But other than

Ruby, 253 243 (incomplete, many duplicates, no error message)
g=gets.split.map(&:to_i).permutation(4)
s=[0,2,4,6]
%w[+ - * /].repeated_permutation(3).map{|x|g.map{|y|s.map{|b|s.select{|e|e>b}.map{|a|y.zip(x).flatten[0..6].join.insert(a+1,?)).insert(b,?()}}}}.flatten.each{|x|puts x if 24==eval(x)rescue''}

I got this so far, but there are a lot of duplicates. Example run:
c:\a\ruby>24
9 6 3 2
(9+3)+6*2
(9+3+6*2)
9+(3+6*2)
9+3+(6*2)
(9+3)+2*6
(9+3+2*6)
9+(3+2*6)
9+3+(2*6)
(3+9)+6*2
(3+9+6*2)
3+(9+6*2)
3+9+(6*2)
(3+9)+2*6
(3+9+2*6)
3+(9+2*6)
3+9+(2*6)
(9+6-3)*2
(6+9-3)*2
(9+6*2)+3
(9+6*2+3)
9+(6*2)+3
9+(6*2+3)
(9+2*6)+3
(9+2*6+3)
9+(2*6)+3
9+(2*6+3)
(3+6*2)+9
(3+6*2+9)
3+(6*2)+9
3+(6*2+9)
(3+2*6)+9
(3+2*6+9)
3+(2*6)+9
3+(2*6+9)
(6+2)*9/3
(2+6)*9/3
(9-3+6)*2
(6-3+9)*2
(9-3-2)*6
(9-2-3)*6
(6*2)+9+3
(6*2+9)+3
(6*2+9+3)
6*2+(9+3)
(6*2)+3+9
(6*2+3)+9
(6*2+3+9)
6*2+(3+9)
(2*6)+9+3
(2*6+9)+3
(2*6+9+3)
2*6+(9+3)
(2*6)+3+9
(2*6+3)+9
(2*6+3+9)
2*6+(3+9)
2*(9+6-3)
2*(6+9-3)
9*(6+2)/3
9*(2+6)/3
2*(9-3+6)
2*(6-3+9)
6*(9-3-2)
6*(9-2-3)
(9*3)-6/2
(9*3-6/2)
9*3-(6/2)
(3*9)-6/2
(3*9-6/2)
3*9-(6/2)
(9*6)/2-3
(9*6/2)-3
(9*6/2-3)
9*(6/2)-3
(6*9)/2-3
(6*9/2)-3
(6*9/2-3)
9/3*(6+2)
9/3*(2+6)
(6/2)*9-3
(6/2*9)-3
(6/2*9-3)

It will probably prove very difficult to eliminate duplicates. I am working on it, but I am afraid it will triple my code size, so I'm posting here first. aaaaaaahhhhh my brain hurts now, so I will continue working on this later :P

I am amazed at how much you achieved with so little code.

Why the begin..end block? puts x if 24==eval(x)rescue'' is 10 characters shorter.

@manatwork Didn't know you could do that, thanks!

@DavidCarraher permutations is extremely strong

Mathematica 449 479 470
This was based on Zhe Hu's approach but I kept native Mathematica expressions, with numbers stored as strings, throughout. This had two advantages: (1) easy detection of duplicates and (2) high-quality formatting in output.
Because the "deep structure" of the output is kept in a canonical, sorted form, duplicates are easily detected even if the components were initially generated in slightly different ways.  Thus commutativity is recognized for addition and multiplication but not imputed to subtraction, division. Further, associativity is implicitly acknowledged.
p[{a_, b_, c_, d_}] := Module[{h, v, q},
q[x_, y_] := If[y == 0, Null, x/y];
h[m_, m_, num_] := {Part[num, m]};
h[s_, f_, num_] := h[s, f, num] = Flatten[Table[Outer[F, {Plus, Subtract, Times, q}, h[s, i, num],
   h[i + 1, f, num]], {i, s, f - 1}]];
v[o_, n1_, n2_] := o[n1, n2];
t = (Map[# &, Select[Map[h[1, 4, #] &, Permutations[{a, b, c, d}]] // Flatten, (# /. F -> v) == 24 &]]) //. {q -> Divide, n_Integer :>  ToString[n]};
Append[u = Union[t //. {F[o_, j_, k_] :> o[j, k]}] //. {Times[a1_String, b1_String] :> Row[{"(", a1, "\[Times]", b1, ")"}]}, ToString[Length[u]] <> " solutions"] // Column]

The FullForm of the following solution,

is
Plus[Times[-1,"3"],Times[Power["2",-1],Row[List["(","6","\[Times]","9",")"]]]]

the structure of which is most clearly rendered in its TreeForm.
TreeForm[%]

The only reason for using a Row for multiplication was to explicitly show the multiplication operator for the product of two known numbers:  e.g. (6 x 9) instead of (6 9).

Examples
The code produced 9 solutions, not 8, for the suggested test case.
p[{2, 3, 6, 9}]

p[{1, 13, 5, 9}]

p[{24, 13, 5, 9}]

Mathematica doesn't have a builtin for this?

An all nighter, a ton of code (C# isn't the most terse of languages) and 8, that's right 8 computed solutions.  There's a bunch of things I'd probably change about this... and it's probably wrong but I figured I'd get it in now.
+-* 9,6,3,2 | 15,12,24 //(9+6-3)×2
*/- 9,6,2,3 | 54,27,24  //9×6/2-3
-+* 9,3,6,2 | 6,12,24
--* 9,3,2,6 | 6,4,24  //(9-3-2)×6
--* 9,2,3,6 | 7,4,24
-+* 6,3,9,2 | 3,12,24
*++ 6,2,9,3 | 12,21,24 //6×2+9+3
+*/ 6,2,9,3 | 8,72,24 //(6+2)×9/3
8 Solutions

(9-3)×(6-2)???
(3-2/6)×9???
9×3-6/2???

using System;
using System.Linq;
using System.Collections.Generic;

namespace ConsoleApplication10
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = new List<double> { 9, 6, 3, 2 };
            var r = new List<double[]>();
            P(n, new List<double>(), r);
            var F = new Dictionary<String, Func<double, double, double>> { { "*", (x, y) => x * y }, { "/", (x, y) => x / y }, { "+", (x, y) => x + y }, { "-", (x, y) => x - y } };
            var fa = (from a in F
                      from b in F
                      from c in F
                      select new[] { a, b, c }).ToList();
            var ir = new List<Tuple<string, double[], double[]>>();
            foreach (var p in r)
                foreach (var f in fa)
                {
                    var t = new double[4];
                    t[0] = p[0];
                    for (int i = 1; i < 4; i++)
                        t[i] = f[i - 1].Value(t[i - 1], p[i]);
                    if (Math.Abs(t.Last() - 24) < 0.01)
                        ir.Add(Tuple.Create(string.Join("", f.Select(_ => _.Key)), t.Skip(1).ToArray(), p));
                }

            var fr = new List<Tuple<string, double[], double[]>>();
            ir.ForEach(i =>
            {
                if (fr.Any(_ => _.Item1.OrderBy(c=>c).SequenceEqual( i.Item1.OrderBy(c=>c))) &&
                    fr.Any(_ => _.Item2.OrderBy(c=>c).SequenceEqual( i.Item2.OrderBy(c=>c)))) return;
                if (fr.Any(_ => _.Item1.Take(2).Concat(i.Item1.Take(2)).All(k=> "/*".Contains(k)) && _.Item3.Last() == i.Item3.Last() ) ||
                    fr.Any(_ => _.Item1.Skip(1).Concat(i.Item1.Skip(1)).All(k=> "/*".Contains(k)) && _.Item2.First() == i.Item2.First() ))
                    return;
                fr.Add(i);
            });

            fr.ForEach(x => Console.WriteLine(x.Item1 + " " + string.Join(",", x.Item3) + " | " + string.Join(",", x.Item2)));
            Console.WriteLine(fr.Count + " Solutions");
            Console.ReadLine();
        }

        static void P<T>(List<T> s, List<T> c, List<T[]> r)
        {
            if (s.Count < 2) r.Add(c.Concat(s).ToArray());
            else
                for (int i = 0; i < s.Count; i++)
                {
                    var cc = c.ToList();
                    cc.Add(s[i]);
                    var ss = s.ToList();
                    ss.RemoveAt(i);
                    P(ss, cc, r);
                }
        }

    }
}

Very interesting approach.  I did some quick skimming of your answers and found a few duplicates though (-+* 6,3,9,2) and (-+* 9,3,6,2) are effectively the same.  It looks like your solution could use some bracket handling logic as well.  It currently won't find solutions like (3-2/6)*9.  It appears to only find solutions that fit the following pattern: (((a.b).c).d) (where . is any operator).

Thanks for those notes, I see what you mean :)  Apparently my (((a.b).c).d) guess wasn't as good as I had hoped :P  If I get some time I might tweak this...

Java
It's quite long - I ought to rewrite it in Python or Haskell - but I think it's correct.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class TwentyFour {
  public static void main(String[] _) {
    for (Expression exp : getExpressions(Arrays.asList(9, 6, 3, 2)))
      if (exp.evaluate() == 24)
        System.out.println(exp);
  }

  static Set<Expression> getExpressions(Collection<Integer> numbers) {
    Set<Expression> expressions = new HashSet<Expression>();
    if (numbers.size() == 1) {
      expressions.add(new ConstantExpression(numbers.iterator().next()));
      return expressions;
    }

    for (Collection<Collection<Integer>> grouping : getGroupings(numbers))
      if (grouping.size() > 1)
        expressions.addAll(getExpressionsForGrouping(grouping));
    return expressions;
  }

  static Set<Expression> getExpressionsForGrouping(Collection<Collection<Integer>> groupedNumbers) {
    Collection<Set<Expression>> groupExpressionOptions = new ArrayList<Set<Expression>>();
    for (Collection<Integer> group : groupedNumbers)
      groupExpressionOptions.add(getExpressions(group));

    Set<Expression> result = new HashSet<Expression>();
    for (Collection<Expression> expressions : getCombinations(groupExpressionOptions)) {
      boolean containsAdditive = false, containsMultiplicative = false;
      for (Expression exp : expressions) {
        containsAdditive |= exp instanceof AdditiveExpression;
        containsMultiplicative |= exp instanceof MultiplicativeExpression;
      }

      Expression firstExpression = expressions.iterator().next();
      Collection<Expression> restExpressions = new ArrayList<Expression>(expressions);
      restExpressions.remove(firstExpression);

      for (int i = 0; i < 1 << restExpressions.size(); ++i) {
        Iterator<Expression> restExpressionsIter = restExpressions.iterator();
        Collection<Expression> a = new ArrayList<Expression>(), b = new ArrayList<Expression>();
        for (int j = 0; j < restExpressions.size(); ++j)
          Arrays.asList(a, b).get(i >> j & 1).add(restExpressionsIter.next());
        if (!containsAdditive)
          result.add(new AdditiveExpression(firstExpression, a, b));
        if (!containsMultiplicative)
          try {
            result.add(new MultiplicativeExpression(firstExpression, a, b));
          } catch (ArithmeticException e) {}
      }
    }
    return result;
  }

  // Sample input/output:
  // [ {a,b} ]               -> { [a], [b] }
  // [ {a,b}, {a} ]          -> { [a,b], [a,a] }
  // [ {a,b,c}, {d}, {e,f} ] -> { [a,d,e], [a,d,f], [b,d,e], [b,d,f], [c,d, e], [c,d,f] }
  static <T> Set<Collection<T>> getCombinations(Collection<Set<T>> collectionOfOptions) {
    if (collectionOfOptions.isEmpty())
      return new HashSet<Collection<T>>() {{ add(new ArrayList<T>()); }};

    Set<T> firstOptions = collectionOfOptions.iterator().next();
    Collection<Set<T>> restCollectionOfOptions = new ArrayList<Set<T>>(collectionOfOptions);
    restCollectionOfOptions.remove(firstOptions);

    Set<Collection<T>> result = new HashSet<Collection<T>>();
    for (T first : firstOptions)
      for (Collection<T> restCombination : getCombinations(restCollectionOfOptions))
        result.add(Util.concat(restCombination, first));
    return result;
  }

  static <T> Set<Collection<Collection<T>>> getGroupings(final Collection<T> values) {
    Set<Collection<Collection<T>>> result = new HashSet<Collection<Collection<T>>>();
    if (values.isEmpty()) {
      result.add(new ArrayList<Collection<T>>());
      return result;
    }

    for (Collection<T> firstGroup : getSubcollections(values)) {
      if (firstGroup.size() == 0)
        continue;

      Collection<T> rest = new ArrayList<T>(values);
      for (T value : firstGroup)
        rest.remove(value);

      for (Collection<Collection<T>> restGrouping : getGroupings(rest)) {
        result.add(Util.concat(restGrouping, firstGroup));
      }
    }
    return result;
  }

  static <T> Set<Collection<T>> getSubcollections(final Collection<T> values) {
    if (values.isEmpty())
      return new HashSet<Collection<T>>() {{ add(values); }};

    T first = values.iterator().next();
    Collection<T> rest = new ArrayList<T>(values);
    rest.remove(first);

    Set<Collection<T>> result = new HashSet<Collection<T>>();
    for (Collection<T> subcollection : getSubcollections(rest)) {
      result.add(subcollection);
      result.add(Util.concat(subcollection, first));
    }
    return result;
  }
}

abstract class Expression {
  abstract double evaluate();

  @Override
  public abstract boolean equals(Object o);

  @Override
  public int hashCode() {
    return new Double(evaluate()).hashCode();
  }

  @Override
  public abstract String toString();
}

abstract class AggregateExpression extends Expression {}

class AdditiveExpression extends AggregateExpression {
  final Expression firstOperand;
  final Collection<Expression> addOperands;
  final Collection<Expression> subOperands;

  AdditiveExpression(Expression firstOperand, Collection<Expression> addOperands,
                     Collection<Expression> subOperands) {
    this.firstOperand = firstOperand;
    this.addOperands = addOperands;
    this.subOperands = subOperands;
  }

  @Override
  double evaluate() {
    double result = firstOperand.evaluate();
    for (Expression exp : addOperands)
      result += exp.evaluate();
    for (Expression exp : subOperands)
      result -= exp.evaluate();
    return result;
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof AdditiveExpression) {
      AdditiveExpression that = (AdditiveExpression) o;
      return Util.equalsIgnoreOrder(Util.concat(this.addOperands, this.firstOperand),
                                    Util.concat(that.addOperands, that.firstOperand))
          && Util.equalsIgnoreOrder(this.subOperands, that.subOperands);
    }
    return false;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder(firstOperand.toString());
    for (Expression exp : addOperands)
      sb.append('+').append(exp);
    for (Expression exp : subOperands)
      sb.append('-').append(exp);
    return sb.toString();
  }
}

class MultiplicativeExpression extends AggregateExpression {
  final Expression firstOperand;
  final Collection<Expression> mulOperands;
  final Collection<Expression> divOperands;

  MultiplicativeExpression(Expression firstOperand, Collection<Expression> mulOperands,
                           Collection<Expression> divOperands) {
    this.firstOperand = firstOperand;
    this.mulOperands = mulOperands;
    this.divOperands = divOperands;
    for (Expression exp : divOperands)
      if (exp.evaluate() == 0.0)
        throw new ArithmeticException();
  }

  @Override
  double evaluate() {
    double result = firstOperand.evaluate();
    for (Expression exp : mulOperands)
      result *= exp.evaluate();
    for (Expression exp : divOperands)
      result /= exp.evaluate();
    return result;
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof MultiplicativeExpression) {
      MultiplicativeExpression that = (MultiplicativeExpression) o;
      return Util.equalsIgnoreOrder(Util.concat(this.mulOperands, this.firstOperand),
                                    Util.concat(that.mulOperands, that.firstOperand))
          && Util.equalsIgnoreOrder(this.divOperands, that.divOperands);
    }
    return false;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder(maybeAddParens(firstOperand));
    for (Expression exp : mulOperands)
      sb.append('*').append(maybeAddParens(exp));
    for (Expression exp : divOperands)
      sb.append('/').append(maybeAddParens(exp));
    return sb.toString();
  }

  static String maybeAddParens(Expression exp) {
    return String.format(exp instanceof AdditiveExpression ? "(%s)" : "%s", exp);
  }
}

class ConstantExpression extends Expression {
  final int value;

  ConstantExpression(int value) {
    this.value = value;
  }

  @Override
  double evaluate() {
    return value;
  }

  @Override
  public boolean equals(Object o) {
    return o instanceof ConstantExpression && value == ((ConstantExpression) o).value;
  }

  @Override
  public String toString() {
    return Integer.toString(value);
  }
}

class Util {
  static <T> boolean equalsIgnoreOrder(Collection<T> a, Collection<T> b) {
    Map<T, Integer> aCounts = new HashMap<T, Integer>(), bCounts = new HashMap<T, Integer>();
    for (T value : a) aCounts.put(value, (aCounts.containsKey(value) ? aCounts.get(value) : 0) + 1);
    for (T value : b) bCounts.put(value, (bCounts.containsKey(value) ? bCounts.get(value) : 0) + 1);
    return aCounts.equals(bCounts);
  }

  static <T> Collection<T> concat(Collection<T> xs, final T x) {
    List<T> result = new ArrayList<T>(xs);
    result.add(x);
    return result;
  }
}

Like David's, my code gives 9 solutions for {9, 6, 3, 2}:
3*9-6/2
(3-9)*(2-6)
(9-3)*(6-2)
9*6/2-3
(3-2/6)*9
3+6*2+9
6*(9-3-2)
(6+2)*9/3
(9+6-3)*2

I haven't read the 24theory.com page thoroughly, but it seems reasonable to call (3-9)*(2-6) and (9-3)*(6-2) distinct, doesn't it?

R
I'm sure there's a shorter way to write this, plus I hard-coded the possible parenthesis, but it works!
# set up
library(combinat)
library(iterpc)
library(data.table)
numbers = c(9,6,3,2)
operators = c('+','-','*','/')

# set up formulas without parens
numbers_permu = do.call('rbind', permn(numbers))
operators_permu = getall(iterpc(table(operators), 3, replace=TRUE, order=TRUE))

for(i in seq(nrow(numbers_permu))) {
    for(j in seq(nrow(operators_permu))) {
        tmp = c(rbind(numbers_permu[i,], operators_permu[j,]))
        if (i==1 & j==1) formulas = data.table(t(tmp))
        if (i>1 | j>1) formulas = rbind(formulas, data.table(t(tmp)))
    }
}
formulas$V8 = NULL # undo recycling

# add parens, repeating once for each possible parenthesis combo
setnames(formulas, names(formulas), c('V3', 'V4', 'V7', 'V8', 'V11', 'V12', 'V15'))
p1 =c(" ", " ", " ", " ", "(",  "(",  " ", " ", " ", " ", ")",  " ", " ", " ", " ", ")")
p2 =c(" ", " ", " ", " ", "(",  " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ")")
p3 =c("(",  " ", " ", " ", "(",  " ", " ", " ", " ", " ", ")",  ")",  " ", " ", " ", " ")
p4 =c("(",  "(",  " ", " ", " ", " ", ")",  " ", " ", " ", ")",  " ", " ", " ", " ", " ")
p5 =c(" ", " ", " ", " ", " ", " ", " ", " ", " ", "(",  " ", " ", " ", " ", " ", ")")
p6 =c("(",  " ", " ", " ", " ", " ", ")",  " ", " ", " ", " ", " ", " ", " ", " ", " ")
p7 =c("(",  " ", " ", " ", " ", " ", " ", " ", " ", " ", ")",  " ", " ", " ", " ", " ")
p8 =c("(",  " ", " ", " ", " ", " ", ")",  " ", "(",  " ", " ", " ", " ", " ", ")",  " ")
p9 =c(" ", " ", " ", " ", "(",  " ", " ", " ", "(",  " ", " ", " ", " ", " ", ")",  ")")
p10=c(" ", " ", " ", " ", " ", "(",  " ", " ", " ", " ", ")",  " ", " ", " ", " ", " ")
p11=c(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ")
parens_permu = t(data.table(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11))

for(i in seq(nrow(formulas))) {
    for(j in seq(nrow(parens_permu))) {
        f = paste0(formulas[i,])
        p = paste0(parens_permu[j,])
        tmp = c(p[1] ,p[2] ,f[1], p[3] ,p[4], f[2],
                p[5] ,p[6] ,f[3], p[7] ,p[8], f[4],
                p[9] ,p[10],f[5], p[11],p[12],f[6],
                p[13],p[14],f[7], p[15],p[16])
        if (i==1 & j==1) full_formulas = data.table(t(tmp))
        if (i>1 | j>1) full_formulas = rbind(full_formulas, data.table(t(tmp)))
    }
}

# evaluate
for(i in seq(nrow(full_formulas))) {
    equation = paste(full_formulas[i], collapse='')
    solution = tryCatch(eval(parse(text=equation)), error = function(e) NA)
    if (i==1) solutions = data.table(equation, solution)
    if (i>1) solutions = rbind(solutions, data.table(equation, solution))
}
solutions[solution==24]

To shorten this you could certainly remove the comments.  I don't know about whitespace in R but there certainly seems to be some extra whitespace here too.  If you want some tips from people who actually program in R you can visit http://codegolf.stackexchange.com/questions/4024/tips-for-golfing-in-r.


text:
Largest Product in MxN grid
Given an MxN grid of numbers, find the greatest product of a length 4 subsequence in any row, column, or diagonal. Subsequences cannot wrap around (e.g. 5 1 2 3 in the row 1 2 3 4 5).
I/O can be anything reasonable: files, stdin/stdout, copy+pasting expressions/arguments, variables. (If I'm missing any esoteric I/O option, feel free to go ahead and post your solution anyways)

Can we assume that all numbers are positive integers?

I see a no-brain method searching for every rows, every columns, etc. But I hardly see any solution beside straight forward. Also, once you solved this problem go validate it on euler project: http://projecteuler.net/problem=11

@Howard Yes -- although I would think that most solutions would generalize fine to negative integers.

J, 26 chars
>./,4*/\"1(,|:,]/.,]/.@|.)

Just an expression to which a rank 2 array could be appended.
,|:,]/.,]/.@|. takes the rank 2 array and concatenates 4 intermediate rank 2 arrays, the input's identity, transposition, and obliques, respectively. Here I feel like there's an uncomfortable amount of redundancy, because there are 2 ]s, 3 ,s, and 2 /.s... I can't think of a way to refactor those out.
>./,4*/\"1 is just a straightforward maximum of each length 4 subsequence of each row of the newly made array, which of course corresponds to rows/columns/diagonals of the original.

Mathematica 190
A 9x5 matrix.
m = RandomInteger[{1, 99}, {9, 5}];
m // MatrixForm

Code
This produces the product and the factors.
{e, f} = Dimensions@m; z = Reverse; w = Flatten;
j = Join[m, n = m\[Transpose], p = z /@ m, q = z /@ n,
w[Table[Diagonal[#, k], {k, -(e - 4), f - 4}] & /@ {m, n, p, q}, 1]];
Sort[w[Partition[#, 4, 1] & /@ j, 1] /. {a_, b_, c_, d_} :> {a b c d, {a, b, c, d}}][[-1]]

{37714500, {90, 85, 58, 85}}


text:
Enumerate all number that are palindromic in at least two of base 2, 8, 10, 16 or 64
Multi palindromic numbers
Finding all number for which at least two** representation are palindromic, with more than one** characters, if in decimal, octal, hexadecimal, binary or in base64.
** have to be editable, see Variables below.
Edited: After lot of reflexion  about comment from @DavidCarraher, I found an important issue about the range to be used. Mostly in the goal of reducing ratio operation/output. For this, variables section of this question was modified.
Details
Representation of numbers are:

binary     : 01
octal      : 01234567
decimal    : 0123456789
hexadecimal: 0123456789abcdef   (in lower case)
base64     : 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_ Nota: This representation is compatible with bash: printf "%o" $((64#r0r)) give 330033 (r0r is a palindrome in both base64 and octal)

The ouput present first a count of palindromes, than all 5 variantes from smaller representation to bigger:
Count Base64 Hexa   Decimal  Octal    Binary
3     11     41     65       101      1000001
3     33     c3     195      303      11000011
3     55     145    325      505      101000101
3     77     1c7    455      707      111000111
4     99     249    585      1111     1001001001
3     ll     555    1365     2525     10101010101
3     rr     6db    1755     3333     11011011011
3     JJ     b6d    2925     5555     101101101101
3     ZL     f6f    3951     7557     111101101111
4     __     fff    4095     7777     111111111111
4     101    1001   4097     10001    1000000000001
3     111    1041   4161     10101    1000001000001
3     202    2002   8194     20002    10000000000010
4     303    3003   12291    30003    11000000000011
3     333    30c3   12483    30303    11000011000011

Nota this sample display number that's palindromes in at least 3 representation, not 2, see Variables below.
Variables

Minimum of palindrome length, default to 2
Minimum number of palindrome by number, default to  2 (/5). There are 5 representation. Print a number when at least 2 of them are palindromic.
Range to check for: could be from 1 to 2^31 or smaller. This could be an array BoundRange=(1,1000) or two variables: RangeSta=1 RangeEnd=1000.

This variables have to be changeables in simple way (modification of code at only one place or given as argument).
Output
No formating needed, only 6 colons, space separated will suffice.
2 9 9 9 11 1001
2 h 11 17 21 10001
2 r 1b 27 33 11011
2 x 21 33 41 100001
2 J 2d 45 55 101101
2 P 33 51 63 110011
2 _ 3f 63 77 111111
3 11 41 65 101 1000001
2 19 49 73 111 1001001
2 1l 55 85 125 1010101

Limits (range)
There is no real consideration of maximum useable of the range as this is depending on language used, But a range have to be fixed:

min: 1 (notation in octal!)
max: depending on language used, but 2^31 seem to be an overall minimum.

For tests, the range could be fixed to somthing smaller...
Goal
The more efficient algorithm with less operation count by line of output will win. (This may have to be explained)**.

Ratio  operation count / output line count
Shortness of code, but with readable variables ie: One variable is one. Regardless of his name length. (don't obfusc)
Quickness of execution (comparission only by language, not accross different languages. Ie: I won't try to compare a c version with a bash one. )

Operations count
The count of operation are mainly theorical. Meaning, a simple conversion is one operation whenever it is done by builtin functions, like printf or by more complex routine like sub base in Dom Hastings's answer
**As I don't know all languages, and there is some place to unusual ideas, subtles algorithms may need to be explained...

Better use “base 64” instead of “base64”. At least for me base64(65)="NjU=" vs. 65₆₄=11 are different.

@manatwork: The base64 encoding that many programming languages use, encodes the ASCII values of the characters.

“This have to be explained” Indeed. Please explain.

@manatwork If you use regular base64 for encoding 65 (as ascii value of A) you become QQ, if you use bash's base64, you obtain 11 (echo $((64#11)) ). Both result are palindrome. At this level (two bytes, upto 16 bits, it's easy to understand: 11 are translation of QQ. Other sample: Dec 4097 = 10001 octal = 00010000 00000001 binary = $'\020\1' ascii to uuencode to "EAE" palindromic too.)

@JB If your algo have a better ratio operation count / output line count than others, you have to explain how.

And how do you count operations?

@JB As natural I can, but mainly in term of algorithm! I know this could be discussed. But I will try to stay honest (and listen for comment before making a wrong vote ;) For sample: swapping two variable is one operation, regardless of how this is effectively done (using a third variable or a language syntaxe like (a,b)=(b,a)).

Is there some upper bound on the size of the numbers here, or are we supposed to carry on all the way up to infinity?

@Gareth He wants an enumeration. That is, for each number that fits this palindromic criteria, there exists some amount of time, such that your program will output it eventually. Also, each natural number should correspond to a unique palindromic number

What do you mean by "Finding all numbers"?  Is it sufficient to provide a test for any positive integer?

@DavidCarraher I'm not totally sure about the answer to this question, but in my mind, I believe no (I have to think a little more).

Then what is the range of numbers we should examine?

@DavidCarraher You're right! I add this on question. Hopefull, no one for now do consideration of this.

Sample: dec 719848917 = oct 5272002725 = bin 101010111010000000010111010101 was found in browsing from 0 to 1.000.000.000 in less than a 30 secs on a Pentium 4 @3Ghz (but taked 3 minutes on my old PentiumIII 500MHz).

I'm not sure I see where there can be any significant variation in operations/output: The computation required is very rigidly specified, and there is no room for algorithmic variation.

@MtnViewMark Having a maximum of range is an important thing. If your script require, to make the job for a range from 0 to 20'000'000, more than 5 seconds, there is something to improve...

I think I got it now. Thank you for forcing us all to think out of the box!

Mathematica
f[number,minPalindromeLength,minCount]works as follows If number is a palindrome with minPalindromeLength in at least minCount bases, f returns the information about that number.
g[max,minPalindromeLength,minCount] makes an table of "palindrome numbers" from 1 through max.
f[number_,minPalindromeLength_:2,minCount_:2]:=Module[{print,palindromeQ,count,
convert64=Thread[Range[0,63]->Characters["0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_"]],
digits=IntegerDigits[number,#]&/@(bases={64,16,10,8,2})},
palindromeQ[dig_]:=(dig==Reverse[dig]);
count = Total@Boole[palindromeQ/@ Cases[digits,x_/;Length[x]>minPalindromeLength-1]];
If[count>minCount-1,Join[{count,Subscript[StringJoin[IntegerDigits[number,64]/.convert64],64]},BaseForm[number,#]&/@Rest[bases]],Sequence[]]];

g[max_,minPalindromeLength_:2,minCount_:2]:=
(Print["\nPalindromes: minPalindromeLength = ",minPalindromeLength "\tand minCount ", minCount ];
DeleteCases[Table[f[z,minPalindromeLength,minCount],{z,9,max}],Null]//Grid);

g[5000,2,3]
g[5000,3,3]
g[5000,4,2]

Warning: Question is modified (sorry) in that way: a maximum has to be specified. Your code seem not to be optimal in the meaning: oper/output.

Haskell
Total rewrite; complete new algorithm:
module Main where

import Data.List (foldl', group, unfoldr)
import qualified Data.Vector.Unboxed as V
import System.Environment (getArgs)
import System.Exit (exitFailure)
import System.IO (hPutStrLn, stderr)

bases :: [Integer]
bases = [64, 16, 10, 8, 2]

alphabet :: V.Vector Char
alphabet = V.fromList
    "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_"

fromBase :: Integer -> [Integer] -> Integer
fromBase base = foldl' ((+).(*base)) 0

toBase :: Integer -> Integer -> [Integer]
n `toBase` b = unfoldr digit n
  where
    digit 0 = Nothing
    digit m = let (q,r) = m `divMod` b in Just (r,q)

formatPalindromic :: (Integer,Int) -> String
formatPalindromic (n,count) =
    show count ++ concatMap (showDigits . (n `toBase`)) bases
  where
    showDigits = (' ':) . map digit . reverse
    digit = (alphabet V.!) . fromInteger

genEvenPalendromes :: Integer -> [[Integer]]
genEvenPalendromes base = [1..] >>= sequence . flip replicate digits >>= asPal
  where
    digits = [0..base-1]
    asPal (0:_) = []
    asPal s = [s ++ reverse s]

genOddPalendromes :: Integer -> [[Integer]]
genOddPalendromes base = [1..] >>= sequence . flip replicate digits >>= makePals
  where
    digits = [0..base-1]
    makePals (0:_) = []
    makePals s = let r = reverse s in [ s ++ d : r | d <- digits ]

merge :: (Ord a) => [a] -> [a] -> [a]
merge as [] = as
merge [] bs = bs
merge as@(a:at) bs@(b:bt) | a <= b    = a : merge at bs
                          | otherwise = b : merge as bt

allPalendromes :: Int -> Integer -> [Integer]
allPalendromes minLength base = merge (limit evens) (limit odds)
  where
    limit =  map (fromBase base) . dropWhile ((< minLength) . length)
    evens = genEvenPalendromes base
    odds = genOddPalendromes base

allPalendromics :: Int -> Int -> [(Integer,Int)]
allPalendromics minRequired minLength =
    onlyMultis $ countEm $ mergeEm $ genEm
  where
    genEm = map (allPalendromes minLength) bases
    mergeEm = foldl' merge []
    countEm = map (\s -> (head s, length s)) . group
    onlyMultis = filter ((>= minRequired) . snd)

parseArgs :: IO (Int, Int, Maybe Integer)
parseArgs = do
    args <- getArgs
    case args of
        [] -> return (2, 2, Nothing)
        [r] -> return (read r, 2, Nothing)
        [r,l] -> return (read r, read l, Nothing)
        [r,l,m] -> return (read r, read l, Just $ read m)
        _ -> do
            hPutStrLn stderr "usage: multiple-palindromes-needed min-length max-value"
            hPutStrLn stderr "-or- defaults to 2, 2, no-limit"
            exitFailure

main :: IO ()
main = do
    (minRequired, minLength, maxValue) <- parseArgs
    let result = allPalendromics minRequired minLength
        limit = maybe id (\v -> takeWhile ((<= v) . fst)) maxValue
    mapM_ (putStrLn . formatPalindromic) $ limit result

Runs on my system (1.8 GHz Intel Core i7) in under 0.1s:
& ghc -o /tmp/palin -O -fforce-recomp -outputdir /tmp -Wall 15225-Palindromic.hs
& time ( /tmp/palin 2 2 20000000 | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2 19119 1241049 19140681 111010111 1001001000001000001001001
2 19899 1248249 19169865 111101111 1001001001000001001001001
2 19999 1249249 19173961 111111111 1001001001001001001001001
    1149

real    0m0.071s
user    0m0.067s
sys     0m0.010s

Generates all solutions to 2, 3, 99 999 999 999 quickly:
& time ( /tmp/palin 2 3 99999999999 | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2 1nADADh 15e49e49d1 94029892049 1274447444721 1010111100100100111100100100111010001
2 1n@FK_h 15fea6efd1 94466666449 1277651567721 1010111111110101001101110111111010001
2 1rIGIr1 16ecaac6c1 98459895489 1335452543301 1011011101100101010101100011011000001
   12495

real    0m7.866s
user    0m7.687s
sys     0m0.170s

Note: Unlike my last solution, this code has not been hand optimized at all: It is straight forward idiomatic Haskell (with the exception of alphabet being a Vector).

Unfortunely, in your last edition, you've dropped compile command. Please replace them.

I'm sorry, why the concern about where clauses? They don't cost anything in Haskell - and occasionally they can speed things up.

I don't understand the concern over [0..base-1]? Perhaps you aren't familiar with Haskell - that list will be computed once, and then simply looped over.

If there is any op/line to be saved here, it is that rather than use a Map, the ten streams of palindromes (two for each base, evens and odds) could be merged (as they are strictly monotonic), and then pull off runs of the same number that are long enough. This would cause the whole computation to be pipelined, and need constant memory no matter the max value. In fact, one could generated all values infinitely, easily this way. But I'm not sure it will be all that faster. I could try that later today... have to head to work now!

Sorry, the concern is not about [0.. and where but about [1..  and filter. (... and maybe where too... I have to learn haskell!)

Ah yes, you do have to learn Haskell! It is wonderful.... In any event, Haskell is lazy, so even though genEvenPalindromes looks like it is generating an infinite list, it is only generating one result at a a time as the rest of the computation needs it. filter is the same - there is never a second list built.

Ok, but anyway there are loop!? Having filter in the loop instead of making proper limits must take more time!? Do I am wrong?

I'm pretty sure that you are not quite understanding how Haskell works. If you are worried that filter ((>=minLength).length) is applying excess checks, you are right - I replaced it with a dropWhile in the code above, which stops checking length once we hit the part of the list that is long enough. The effect on the timing is in the noise.

Implemented the merge version - now takes only 70% of the time it did before. And takes only constant memory!

Python
Rather straightforward; could be optimized somewhat. For example, the octal representation is calculated twice. (Still, I hope that's much faster than creating a base 64 representation in pure python.)
Also, all representations are calculated, even if after, say, 3 representations it is clear that there will not be enough palindromes. However, i feel that the code is much cleaner as it is.
mindigits, minpalins = 2, 3
print("Count Base64 Hexa   Decimal  Octal    Binary")

from itertools import count

oct_to_64={"%02o"%i:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_"[i] for i in range(64)}

def base64(i):
    octalstring="{0:o}".format(i)
    if len(octalstring) % 2:
        octalstring = "0" + octalstring
    return "".join(oct_to_64[octalstring[i:i+2]] for i in range(0,len(octalstring), 2))

encoders=[base64, "{0:x}".format, str, "{0:o}".format, "{0:b}".format]
for i in count(8**(mindigits-1)):
    encodeds = [encoder(i) for encoder in encoders]
    palindromes = [encoded for encoded in encodeds if encoded[::-1]==encoded and len(encoded)>=mindigits]
    num_palins = len(palindromes)
    if num_palins >= minpalins:
        print("%-5s %-6s %-6s %-8s %-8s %s" % tuple([num_palins] + encodeds))

Output:
Count Base64 Hexa   Decimal  Octal    Binary
3     11     41     65       101      1000001
3     33     c3     195      303      11000011
3     55     145    325      505      101000101
3     77     1c7    455      707      111000111
4     99     249    585      1111     1001001001
3     ll     555    1365     2525     10101010101
3     rr     6db    1755     3333     11011011011
3     JJ     b6d    2925     5555     101101101101
3     ZL     f6f    3951     7557     111101101111
4     __     fff    4095     7777     111111111111
4     101    1001   4097     10001    1000000000001
3     111    1041   4161     10101    1000001000001
3     202    2002   8194     20002    10000000000010
4     303    3003   12291    30003    11000000000011
3     333    30c3   12483    30303    11000011000011
3     404    4004   16388    40004    100000000000100

and so on...

+1 as you're the first and your solution match the request.

Warning: Question is modified (sorry) in that way: a maximum has to be specified. Your code seem not to be optimal in the meaning: oper/output.

Perl
So I don't think this is necessarily efficient, but I guess it'll at least provide a benchmark for other Perl scripts! I originally got distracted by making the shortest code (should have RTFQ...). I imagine I could improve this more by replacing the manual base conversions <64 with sprintf so I might look at that later on.
# length of palindrome
$length = 2;
# minimum number of palindromes
$number = 2;

sub base {
    ($-, $base, $n) = @_;
    do {
        $n = (0..9,a..z,A..Z,'@',_)[$- % $base].$n
    } while $- = $- / $base;

    $n
}

while (++$i) {
    @nums = map {
        base($i, $_)
    } (64, 16, 10, 8, 2);

    $count = scalar grep { length >= $length && $_ eq scalar reverse $_ } @nums;

    print "$count @nums\n"x($count >= $number)
}

Output:
2 9 9 9 11 1001
2 h 11 17 21 10001
2 r 1b 27 33 11011
2 x 21 33 41 100001
2 J 2d 45 55 101101
2 P 33 51 63 110011
2 _ 3f 63 77 111111
3 11 41 65 101 1000001
2 19 49 73 111 1001001
2 1l 55 85 125 1010101
2 1z 63 99 143 1100011
2 1T 77 119 167 1110111
2 1V 79 121 171 1111001
2 22 82 130 202 10000010
2 2p 99 153 231 10011001
2 2G aa 170 252 10101010

I like your universal base conversion tool

Who said perl is write only? I find your version more readable than the python one! ;-)

Hah, thanks! I used that instead of switching between sprintf and another method to save bytes, as I say though, probably less efficient :(
I'm glad it's a bit readable, the original golfed one made much less sense!

Warning: Question is modified (sorry) in that way: a maximum has to be specified. Your code seem not to be optimal in the meaning: oper/output.

Nit with this solution: 65 is output twice. I suspect something that was 4-multi-palindromic would be output even more times.

Ahh yeah, my original version had:
print "$count @nums\n"x$count;
I did update the code, but not the output, oops!

DomHastings bounty is gone to @MtnViewMark, I've published all my versions under my not-an-answer.

I like the pseudo code nature of your answer. It gave me a good conceptual implementation to wrap my head around before writing my own code.

D (thinking outside the box solution)
With the defaults (palindrome length >= 2, in bases >= 2) and the range 1..20_000_000 this takes ~8 ms on my 2 Ghz notebook. Most of the time (~6 ms) is spent for formatting and printing (to /dev/null). The actual result generation takes about 2 ms.
It works by first generating a list of all palindromes for each of the 5 bases at compile-time. The generator skips directly from one palindrome to the next by adding e.g. 110 to the number 7557 -> 7667. It's a bit like manually implementing a very weird increment instruction, but avoids checking ALL numbers by converting them to the respective base. (Only a tiny fraction of the numbers in the range 1..2³¹ are actually palindromes.)
At runtime these 5 lists are processed by finding the lowest value amongst them and counting the occurrences. The number of occurrences maps to the 'Count' field in the output and the value is the number that is a palindrome in one ore more representations. The value is then removed from the front of all the lists that had it.
All the occurrence counts and values that match the filter criteria are added to a result set and afterwards printed.
Lines of code: 280
import std.stdio, std.string, core.time, std.range, core.bitop, std.traits,
       std.getopt, std.algorithm;

int main(string[] args) {
    // Process command line
    uint palindromeLength = 2;
    uint numPalindromes = 2;
    uint rangeLow = 1;
    uint rangeHigh = 2^^31;
    bool showHelp = false;

    getopt(args,
           "length", &palindromeLength,
           "num",    &numPalindromes,
           "low",    &rangeLow,
           "high",   &rangeHigh,
           "help",   &showHelp);

    if (showHelp) {
        writeln("Finds numbers that are palindromes in one or more bases.");
        writeln("The compared bases are 2, 8, 10, 16 and 64.");
        writeln("The following options are available (default values are given):");
        writeln("  --length=2  Filter palindromes below a certain length.");
        writeln("  --num=2     Only show numbers that are palindromes in as many bases.");
        writeln("  --low=1     The first number to check (in decimal).");
        writeln("  --high=2³¹  The last number to check (in decimal).");
        writeln("  --help      Show this help screen.");
        return 0;
    }

    if (palindromeLength == 0) {
        stderr.writeln("--length must be at least 1!");
        return 1;
    }
    if (numPalindromes < 1 || numPalindromes > 5) {
        stderr.writeln("--num must be in the range 1 to 5!");
        return 1;
    }
    if (rangeLow > rangeHigh) {
        stderr.writeln("--low must be less than --high!");
        return 1;
    }

    // We check the --length and --low option here
    auto restrictRange(immutable uint[] values, immutable size_t[] index) {
        immutable(uint)[] result;
        if (palindromeLength < index.length)
            result = values[index[palindromeLength] .. $];
        if (rangeLow < 2)
            return result[rangeLow .. $];
        return result.assumeSorted.upperBound(rangeLow - 1).release();
    }

    // Start of timing...
    auto t1 = TickDuration.currSystemTick;

    alias base2 = Palindromes!2.data;
    alias base8 = Palindromes!8.data;
    alias base10 = Palindromes!10.data;
    alias base16 = Palindromes!16.data;
    alias base64 = Palindromes!64.data;

    // Use all palindrome lists that have at least one number in range.
    auto use = [
        restrictRange(base2.values, base2.lengthIndex),
        restrictRange(base8.values, base8.lengthIndex),
        restrictRange(base10.values, base10.lengthIndex),
        restrictRange(base16.values, base16.lengthIndex),
        restrictRange(base64.values, base64.lengthIndex),
    ].filter!(a => a.length > 0 && a[0] <= rangeHigh).array();

    // This section will filter by --num and --high
    struct Group {
        uint count;
        uint value;
    }
    Group[] groups;
    groups.reserve (use.map!"a.length".reduce!"a + b"());

    do {
        // Find the lowest value and how often it occurs
        uint low = uint.max;
        uint lowCnt = 0;
        foreach (u; use) {
            if (u[0] < low) {
                low = u[0];
                lowCnt = 1;
            } else if (u[0] == low) {
                lowCnt++;
            }
        }
        if (lowCnt >= numPalindromes)
            groups ~= Group(lowCnt, low);

        // Remove the value and dead lists
        for (size_t i = 0; i < use.length;) {
            if (use[i][0] == low) {
                if (use[i].length == 1 || use[i][1] > rangeHigh) {
                    use[i] = use[$-1];
                    use.length--;
                    continue;
                } else {
                    use[i] = use[i][1 .. $];
                }
            }
            i++;
        }
    } while (use.length);
    auto t2 = TickDuration.currSystemTick;

    // Print the result
    writefln("Lookup took %.2f ms", 0.000001 * (t2-t1).nsecs);
    writeln("Count Base64 Hexa     Decimal    Octal       Binary");
    foreach (grp; groups)
        writefln("%s     %-6s %-8x %3$-10s %3$-11o %3$-32b",
                 grp.count, grp.value.toBase64, grp.value);

    return 0;
}

char[] toBase64(uint value) {
    string tab = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_";
    char[6] result = "      ";
    size_t pos = 6;
    do {
        result[--pos] = tab[value % 64];
        value /= 64;
    } while (value);
    return result[pos .. $].dup;
}

/**
 * Finds all palindromes for a given number base in the range 2 to 256 within
 * the limits given by data type ℕ, which can be either ubyte, ushort or uint.
 */
template Palindromes(uint base, ℕ = uint)
    if (isUnsigned!ℕ && ℕ.sizeof <= 4 && base > 1 && base <= 256)
{
    // The maximum number of digits for this base that can be represented in ℕ.
    enum digits = {
        uint result = 1;
        ℕ power = 1;
        while (ℕ.max / base >= power) {
            result++;
            power *= base;
        }
        return result;
    }();

    // Number of ways we can add a value to 0, keeping it a palindrome.
    enum options = (digits + 1) / 2 * (digits / 2 + 1);

    /* Number of ways to increment a number of `length` digits, keeping it a
     * palindrome.
     */
    enum optionsForLength(size_t length) { return (length + 1) / 2; }

    /* Lookup array for the sum of the values of the digits at positions n
     * and 0, used to increment one palindrome in this base to the next one.
     */
    immutable increments = {
        ℕ[options] result;
        size_t idx = 0;
        ℕ high = 1, low = 1;
        foreach (length; 0 .. digits) {
            ℕ h = high, l = low;
            do {
                result[idx++] = (h == l) ? h : cast(ℕ) (h + l);
                h *= base;
                l /= base;
            } while (l);

            if (length & 1)
                low *= base;
            else
                high *= base;
        }
        return result;
    }();

    /* When a slot in a palindrome overflows, this array is used to reset
     * the slot and all lesser slots much like when you do 999+1=1000.
     */
    immutable resets = {
        ℕ[options] result = 0;
        uint idx = 0;
        foreach (length; 1 .. digits + 1) {
            foreach (i; 0 .. optionsForLength(length)) {
                immutable prev = i ? result[idx - 1] : 0;
                immutable curr = (base - 1) * increments[idx];
                result[idx++] = cast(ℕ) (prev + curr);
            }
        }
        return result;
    }();

    // The count of palindromes in this base for a given number of digits.
    enum numPalindromesOfLengthUpTo(size_t digits) {
        return base ^^ (digits / 2) - 1 + base ^^ ((digits + 1) / 2);
    }

    // The real number of palindromes in this base that fit into ℕ.
    enum numPalindromes = {
        static if (bsr(base) == bsf(base) && ℕ.sizeof * 8 % bsf(base) == 0) {
            // All digits of this base fit evenly into ℕ.
            return numPalindromesOfLengthUpTo(digits);
        } else {
            // Some palindromes with the most significant digit != 0
            // cannot be represented and must be droped.
            enum options = optionsForLength(digits);

            auto remainder = ℕ.max;
            size_t result = numPalindromesOfLengthUpTo(digits - 1);
            foreach_reverse(i; 0 .. options) {
                immutable increment = increments[$ - options + i];
                auto n = remainder / increment;
                remainder -= n * increment;
                if (i == options - 1) n--;
                if (i == 0) n++;
                result += n * (base ^^ i);
            }
            return result;
        }
    }();

    /* Structure that iterates over the palindromes in this base.
     * To avoid overflow, an external check is required.
     */
    struct PalindromeRange
    {
    private:
        ubyte[(digits + 1) / 2] slots = 0;
        uint offset = 0;

    public:
        uint width = 1;
        ℕ front = 0;

        void popFront() {
            // Highest digit value in this base.
            enum max = cast(ubyte) (base - 1);

            size_t si = 0;
            if (slots[0] >= max) {
                do {
                    si++;
                } while (si < slots.length && slots[si] >= max);
                front -= resets[offset + si - 1];
                slots[0 .. si] = 0;
                if (si == optionsForLength(width)) {
                    offset += optionsForLength(width);
                    if (width++ == digits) return;
                    si = optionsForLength(width) - 1;
                }
            }
            slots[si]++;
            front += increments[offset + si];
        }
    }

    struct PalindromeData {
        ℕ[numPalindromes] values;
        size_t[digits+1] lengthIndex;
    }

    immutable data = {
        PalindromeData result;
        uint width;
        auto pr = PalindromeRange();
        foreach (i; 0 .. numPalindromes) {
            result.values[i] = pr.front;
            if (width != pr.width) {
                width = pr.width;
                result.lengthIndex[width] = i;
            }
            pr.popFront();
        }
        return result;
    }();
}

Not an answer.
This is not an answer to the question, but to other answers...
This is not regular on SE, but I think this could be usefull in the meaning of PPCG.
First
I've found 12 495 numbers which are palindrome in at least two of all five representations and containing at least three characters, between 1 and 99 999 999 999
Some samples:
printf "%o\n" 94466666449
1277651567721

echo $(( 64#1rIGIr1 ))
98459895489

printf "%o\n" 0x1557557551
1252725272521

My modified (perl) version of Dom Hastings's answer took ~90 seconds on my desktop...
Of course original version of same script is able to browse approx from 1 to 60 000 by using the same time, on same pc.
Here is a need to think out of the box...
My point of view:
My system is not so small:
CPU Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
Dual core run on 64 bits GNU/Linux
With 4Gb RAM.

Comparissions.
For making this something equitable, I will render outputs there to be able to make some comparissions.
For rendering output, I will use the following command:
time ( /tmp/palin-XXX.YY 20000000 2 2 | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1

I will try to respect publication order.
First: WolframH's Python answer
@@ -1 +1,3 @@
-mindigits, minpalins = 2, 3
+mindigits, minpalins, maxint = 2, 2, 20000000
@@ -4 +6 @@
-from itertools import count
@@ -15 +17 @@
-for i in count(8**(mindigits-1)):
+for i in range(8**(mindigits-1), maxint ):

Than:
time ( ./palin.py 20000000 2 2 | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2     19119  1241049 19140681 111010111 1001001000001000001001001
2     19899  1248249 19169865 111101111 1001001001000001001001001
2     19999  1249249 19173961 111111111 1001001001001001001001001
1150

real    3m0.768s
user    2m48.895s
sys     0m0.560s

Second: Dom Hastings's perl answer
@@ -15 +15 @@
-while (++$i) {
+while (++$i<20000000) {

Give:
time ( perl ./palin-dom-b.pl | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2 19119 1241049 19140681 111010111 1001001000001000001001001
2 19899 1248249 19169865 111101111 1001001001000001001001001
2 19999 1249249 19173961 111111111 1001001001001001001001001
1149

real    14m58.174s
user    14m54.512s
sys     0m0.412s

Third: David Carraher's Mathematica
Unfortunely, I don't know how to test this, but as I could read, there seem not to be different algorithm...
That's little a surprise, becaud David warned my about maximum and this is an important notion in this question.
Fourth: MtnViewMark's Haskell
Whithout any modification and after compilation conforming to answer indication:
time ( ./palin.haskel | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2 19119 1241049 19140681 111010111 1001001000001000001001001
2 19899 1248249 19169865 111101111 1001001001000001001001001
2 19999 1249249 19173961 111111111 1001001001001001001001001
1149

real    0m26.631s
user    0m24.802s
sys     0m0.124s

Hmm, this seem to be very interesting, in that: I didn't know haskell before.
But this miss something in them of operation/output
My results:
I've wrote two versions. The first prototype was bash (yes I could be quicker using bash than a python version;-):
time ( ./palin.sh 20000000 2 2 | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2     (19899) (1248249) (19169865) 111101111 1001001001000001001001001
2     (19999) (1249249) (19173961) 111111111 1001001001001001001001001
List len: 46572, Output len: 1149, Operations: 173548: ratio: 151.04
1150

real    1m40.052s
user    1m9.588s
sys     0m13.249s

... and this version is penalized by an operation counter: I count 173 548 operation for computing all values under all 5 base, from 1 to 20 000 000 !!!
And there is same work with a perl version:
time ( perl ./palin-d-shrink.pl 20000000 2 2 | tee >(tail -n3 >/dev/fd/3) | wc -l ) 3>&1
2     (19119) (1241049) (19140681) 111010111 1001001000001000001001001
2     (19899) (1248249) (19169865) 111101111 1001001001000001001001001
2     (19999) (1249249) (19173961) 111111111 1001001001001001001001001
1149

real        0m0.631s
user        0m0.612s
sys         0m0.016s

Recap:
First python          3m0.768s
First perl           14m58.174s
Mathematica          -- unknow (but seem not having less oper/lines ) --
Haskel                0m26.631s (this is compiled)
My bash prototyp      1m40.052s  -> 1m16.067s see Nota under bash explanation
My perl (shrinked)    0m0.631s

I insist: here is a need to think out of the box!!
End of BOUNTY: Bravo MtnViewMark's Haskell
You was the first to rewrite your code to build all possible values in a drawing fashion  first before searching for values that match requirement.
There is my perl shrinked version:
#!/usr/bin/perl -w
use strict;my%vars;my$maxr=999999;my$minn=3;my$minl=3;$maxr=$1if$ARGV[0]&&$ARGV
[0]=~/^(\d+)$/;$minn=$1if$ARGV[1]&&$ARGV[1]=~/^(\d+)$/;my%value;$minl=$1if$ARGV
[2]&&$ARGV[2]=~/^(\d+)$/;my@digits=("0".."9","a".."z","A".."Z","@","_");my$i=0;
map{$value{$_}=$i++}@digits;sub base{my($n,$base)=@_;my$str='';do{$str=$digits[
$n%$base].$str}while$n=int($n/$base);$str}sub rbase{my($num,$base)=@_;my$out=0;
$out = $out * $base + $value{$1} while $num =~ s /^(.)//;$out}sub ebase{defined
($vars{$_[1]}{$_[0]})?$vars{$_[1]}{$_[0]}:"(".base(@_).")"}sub palinlst{my$base
=pop;my$maxst=base($maxr,$base);my$half=int(length($maxst)/2+.5);my($lasteven,$
lastodd)=do{length($maxst)%2? (rbase($digits[$base-1]x ($half-1), $base),rbase(
substr($maxst,0,$half), $base)): (rbase(substr($maxst, 0,$half),$base), rbase($
digits[$base-1]x$half, $base))}; foreach my$p($lasteven+1..$lastodd){ my$part1=
base($p,$base); my$part2=reverse $part1; my$str=$part1.substr($part2,1);my$val=
rbase($str,$base);if(length($str)>=$minl){$vars{$base}{$val}=$str;$vars{'count'
}{$val}++}};foreach my$p(1..$lasteven){my$part1=base($p,$base);my$part2=reverse
$part1;my$str=$part1.$part2; my$val=rbase($str,$base);if(length($str)>=$minl){$
vars{$base}{$val}=$str;$vars{'count'}{$val}++};$part2=reverse$part1;$str=$part1
.substr($part2,1);$val=rbase($str,$base);if(length($str)>=$minl){$vars{$base}{$
val}=$str;$vars{'count'}{$val}++;}}};for my$b(qw(2 8 10 16 64)){palinlst$b;}map
{printf"%-5s %-6s %-6s %-8s %-8s %s\n",$vars{'count'}{$_},ebase($_,64),ebase($_
,16),ebase($_,10),ebase($_,8),ebase($_,2);}grep{$vars{'count'}{$_}>=$minn}sort{
$a<=>$b}keys$vars{'count'};  #  (C)  2013  -  LGPL v2  -  palindrome@F-Hauri.ch

This is shrinked, not obfuscated! You could make them readable by running perltidy. I use this form to make cut'n paste easier.
perltidy < ./palin-shrinked.pl

I think this become readable.
Explanation (using bash for readabilty;-)  1m40.052s  1m16.067s
As the final version is 139 lines long, I will split them there in order to explain each part:
#!/bin/bash

printf -v RANGEND "%u" ${1:-1000} # Max decimal value of palin to compute
MINCNT=${2:-2} # Minimum number of palindrome by output line default:2
MINLEN=${3:-2} # Minimum length of palindrome  default:2
OUTFMT="%-5s %-6s %-6s %-8s %-8s %s\n"
opcount=0
shopt -s extglob

int2b64 () { local _i _func='{ local _lt=({0..9} {a..z} {A..Z} @ _) _var _out;
                                printf -v _var "%022o" $1 ;_out="'
    for ((_i=0; _i<22; _i+=2)) ;do
        printf -v _func '%s${_lt[8#${_var:%d:2}]}' "$_func" $_i
    done
    _func+='";printf ${2:+-v} $2 "%s" ${_out##*(0)}; }'
    eval "${FUNCNAME}()" $_func
    $FUNCNAME $@ ; }
int2bin () { local _fmt="" _i
        for _i in {0..7}
        do
            fmt+="_var=\${_var//$_i/%s};"
        done
        printf -v fmt "$fmt\n" 000 001 010 011 100 101 110 111
        eval "${FUNCNAME}()"'{ local _var;printf -v _var "%o" $1;
                           '${fmt}'printf ${2+-v} $2 "%s" ${_var##*(0)}; }'
        $FUNCNAME $@ ; }

There is the first functions, I use the trick to re-define $FUNCNAME before first use.
rev() { local _func='{ printf ${2+-v} $2 "%s" ' _i
    for ((_i=64;_i--;)) do _func+='${1:'$_i':1}' ; done
    eval "rev()" $_func ';}'; rev $@ ; }
int2hex() { printf ${2+-v} $2 "%x" $1 ; }
int2oct() { printf ${2+-v} $2 "%o" $1 ; }
int2dec() { printf ${2+-v} $2 "%u" $1 ; }

Some more function, easy to understand, The hard part is comming now:
makePalinList() {
    local max=${1:-1000} vmax palin
    local forms=('' '' bin '' '' '' '' '' oct '' dec '' '' '' '' '' hex
        ''{,,,}{,,}{,,}{,}b64)
    local digmax=('' '' 1 '' '' '' '' '' 7 '' 9 '' '' '' '' '' f
        ''{,,,}{,,}{,,}{,}_)
    local cmd=${forms[$2]}
((opcount+=5))
    int2$cmd $max vmax

with this, I make that int$form[64] will be expanded before execution to intb64 (under bash, there is no need to use eval there).
vmax is the max value to render. So now we have to compute each case (even and odd string length):
    local vpart=$((5*${#vmax}+5))
    local vpskel=${vmax:0:${vpart%?}}
    local lasteven lastodd
    if ((${#vmax}%2)) ;then
        lastodd=$(($2#$vpskel))
        vpskel=${vpskel:1}
        lasteven=$(($2#${vpskel//?/${digmax[$2]}}))
    else
        lasteven=$(($2#$vpskel))
        lastodd=$(($2#${vpskel//?/${digmax[$2]}}))
    fi

I will let you think about all this... Now we have to compute start of ranges
    local firsteven=$(((MINLEN+1)/2)) firstodd=$((MINLEN/2+1))
    printf -v firsteven "%${firsteven}s" ""
    printf -v firstodd   "%${firstodd}s" ""
    firsteven=${firsteven// /0}
    firsteven=${firsteven/0/1}
    firsteven=$(($2#$firsteven))
    firstodd=${firstodd// /0}
    firstodd=${firstodd/0/1}
    firstodd=$(($2#$firstodd))

Wow.
Nota: My previous (not published) version was not using firsteven and firstodd but simply 1.. and a in loop condition: ${#palin} -ge $MAXLEN before each printf -v lst$cmd[....
Adding this and the following if at end  of next part improved my script a lot: from ~100 seconds, my script only take 76 seconds now for computing previous test 20000000 2 2
Now there could be an issue where next if could not match:
    if [ $firstodd -lt $lasteven  ] ;then
        for ((i=firsteven;i<firstodd;i++)) ;do
            int2$cmd $i b
            rev $b r
            palin=$b$r
            printf -v lst$cmd[$(($2#$palin))] $palin
            ((counts[$(($2#$palin))]++))
            ((opcount+=3))
        done
        for ((i=firstodd;i<=lasteven;i++)) ;do
            int2$cmd $i b
            rev $b r
            palin=$b$r
            printf -v lst$cmd[$(($2#$palin))] $palin
            ((counts[$(($2#$palin))]++))
            palin=$b${r:1}
            printf -v lst$cmd[$(($2#$palin))] $palin
            ((counts[$(($2#$palin))]++))
            ((opcount+=4))
        done
        for ((i=lasteven+1;i<=lastodd;i++)) ;do
            int2$cmd $i b
            rev $b r
            palin=$b${r:1}
            printf -v lst$cmd[$(($2#$palin))] $palin
            ((counts[$(($2#$palin))]++))
            ((opcount+=4))
        done

And if else:
    else

        for ((i=firsteven;i<=lasteven;i++)) ;do
            int2$cmd $i b
            rev $b r
            palin=$b$r
            printf -v lst$cmd[$(($2#$palin))] $palin
            ((counts[$(($2#$palin))]++))
            ((opcount+=3))
        done

        for ((i=firstodd;i<=lastodd;i++)) ;do
            int2$cmd $i b
            rev $b r
            palin=$b${r:1}
            printf -v lst$cmd[$(($2#$palin))] $palin
            ((counts[$(($2#$palin))]++))
        done

    fi

That's all (for now)...
}
for base in 2 8 10 16 64; do makePalinList $RANGEND $base ;done

Now we just have to print all values (adding parenthesis if value have to be computer -> ie not already exist -> ie not match requirement.)...
lines=0;for i in ${!counts[@]};do
    [ ${counts[i]} -ge $MINCNT ] && \
        printf "%-5s %-6s %-6s %-8s %-8s %s\n" ${counts[i]} \
        ${lstb64[i]:-($(int2b64 $i))} \
        ${lsthex[i]:-($(int2hex $i))} \
        ${lstdec[i]:-($i)} \
        ${lstoct[i]:-($(int2oct $i))} \
        ${lstbin[i]:-($(int2bin $i))} && ((lines++))
  done

if [ $lines -gt 0 ] ;then ratio=000$((opcount*1000/lines))
    printf "List len: %s, Output len: %d, Operations: %d: ratio: %.2f\n" \
    ${#counts[@]} $lines $opcount ${ratio:0:${#ratio}-3}.${ratio:${#ratio}-3}
else echo no output; fi

Ok, there is a zipped version of this bash script, to make cut'n paste easy:
#!/usr/bin/perl -w
my$u="";open my$st,"|gunzip";sub d{my$l=pack("c",32+.75*length($_[0]));print$st
unpack("u",$l.$_[0]);"";};while(<DATA>){tr#A-Za-z0-9+/##cd; tr#A-Za-z0-9+/# -_#
;$u.=$_;while($u=~s/(.{80})/d($1)/egx){};};d($u);__DATA__
H4sIAHg8jlICA9VX227bRhB9Fr9iQq1C0jLFiy9xxBCx0TpFgdgpCueltiBQ0soiwosgUoJbYv+9s7u8
iZbjh6JFKkgid3fmzMzZ4XC2/8aahYk1C7KVoqw3YZIvwdzB71e3v1zf/gzqYKsCKZyx6di2zaAPN8ET
LOg8jIMIdkG0pZAuYR1EYQJ5CvM0Xm9zCsrNr7c/3d75pHDHpiv0wiSMtzEk23hGN7XSYpPGFGZ/QrrN
URNwiiL+MthG+djlMJ+vbxHmpAMT0eQxX3VgWopfvt59urnz1YF5lsHAPK//Lqq/7CFRlXQ9T7dJ7ttK
tkrXOZgZ0Kf8MUpnioJcuLPzU9ANKCBK5xjwNITpcpvMfa2eiXJfL+zR6D2DIhiN/sLL1Wj0B4NLmBow
3QUbmGJsngKvfBryhZI6sF03RfId8DiAr2oCYpluQNenoW976M4H1+WXoe8aBniLVDmAxh0GbZCRAp29
v+jjFQ2MB4uxyyZMA5UIETQ1DYX+Ik2ouBHzQ19TvRKOb+fQ3DEgLjqY8dTgvvX7R7ptMA+Y9JFiYiBs
8ekrJsHVzTXTDY7O0cQ6qRaAXAJqSaoxg9pUL2OMWcXglB6PGalHAc70O6b0WpEKUuJ86Ks8LP9BhmdZ
GI01yJincmkMqNdQguLoHv5jCgDmNf4csB28Og5gouMPrzh2HEfpHYqm2X+05T3bOrFv391yjRRon2kN
sV1eEanNa+8ZacqG7vYIKxPzBUgNyu2tM+j81JuGpulh6izSerP5064hedrYweTwmmyQPAij1W6C5jHN
A5xr7+SKPgm/DjnyJDO6lEzn+YuS6Z4klpwXJbe1pBIH3+hvvCB8DjMBLTyXBMXBk98qZTscy+LRkkFu
4szXNQ3wyzNS3tVfdJhf0JvuCgat9DStOD4+ZkX9Y1hAjBb+InzkbpQGnC7IO/73vju7PASMxQU/Leh5
vMDwRAD3xJ0wRdfL6jb0zwzpBGeSoCAQHjxnQGkh7NbBJveJrp8dkaLPV9mw0qwksm80QjN8cWyP8Ybr
DD4y1pKKgiynO5qIm3SxkKaXmHQV7ECUq3xFE6VXCnG7xO0TaQKt9hpj4gbTUQpz6Eq6XLOsjxYpJLki
eFa6TaOMPtdqbHSMvwa3lE9QO2HCTYOty9fV0DEsHqBYK9HliuXimoRqVaMKAlMZN7AaMXxmVfWQLELi
ZC2Mw5Zsy6EGy7LAstl31m3LebYsKaknagqqoGrrXfTO6j52i+1qXCJXaXIP9QqYUQ6kzieYyKQBpSdf
Croe+rWDXvih0vPC4bB8Ifb28z6EmZwSNWsGGzkSdcAnM1KNa8ajLOea96XPQtAwJiDvpLSui+cs6wpx
JyqJ+lk84XPyjdQJQjj+wa/C7Qbxg4RS4xcb8Uj+y3SdHqKromjoVIT9o03/7yNpatPhRH4xCf53mfwj
bkxrE7CiM4X7jicgyjtMFy6Ad37ngO0R74v2Wgog1cmICAVPQCn81JJhR86BRJ9KijelA5cTVvXlWNiK
cjacMDAfKRB5TsLC9vYtPNQ96ivHln0cVCMFkoKtBo7Hpk706uhCQsNoBLBFaQvgsCOAbU0pELZmsedp
q/EWaF8N+6Q9wzx+IYAx6brgRvBeniwUWePFPJKQg13X9U2Qh6mP7Rmp0+yId2uWEN5/c6piP/AcOEZS
juFLeX4U4wWO11SgJRkfjyU03o7cJWfwQR5Ein6zTZVLpLSMq1KJ9zl9ccvMEzaqptuTCn+Ygc5XKSRp
eZb1eHL9DRLsWT9gDwAA

You could simply run:
perl >/tmp/palin-bash.sh

than paste previous script into your console.

Interesting! I haven't had much of a chance to look at this again, but I'm very intrigued to see your modifications!

@DomHastings : I'ts not only modifications, maybe the expression could better by You have to think  from the inner box ... !?

GolfScript 94
Didn't do the formatting really, but this works in GolfScript.  Doing the formatting would probably add 20-30 characters.
~:j;:i;
10 5?,
{[2 8 10 16 64]\{\base}+%}%
{{.,i(>\{.,2<{;1.(}{(\)@=}if}do`1`=&}%{+}*j(>},
{p}%

This also limits the numbers to 10000 (in decimal).  That number can be changed, of course, to the maximum integer, but this runs pretty quickly as is.
Example call:  echo '3 2' | ruby golfscript.rb h.gs
Output:
[[1 0 0 0 0 0 0 0 0 1] [1 0 0 1] [5 1 3] [2 0 1] [8 1]]
[[1 0 0 1 0 0 1 0 0 1] [1 1 1 1] [5 8 5] [2 4 9] [9 9]]
[[1 1 0 0 0 0 0 0 0 1 1] [3 0 0 3] [1 5 3 9] [6 0 3] [24 3]]
[[1 1 0 1 1 0 1 1 0 1 1] [3 3 3 3] [1 7 5 5] [6 13 11] [27 27]]
[[1 0 1 0 0 0 0 0 0 1 0 1] [5 0 0 5] [2 5 6 5] [10 0 5] [40 5]]
[[1 0 1 0 1 0 0 1 0 1 0 1] [5 2 2 5] [2 7 0 9] [10 9 5] [42 21]]
...

You know, at IBM they pay by number of lines written.


text:
Find the joker in deck of cards
You have a French deck of cards that sorted like this: 2 - 10, Princes, Queens, Kings, Aces.
The deck represented with array of numbers from 1 to 52(included)
Now the dealer is shuffling the deck 3 times and inserting a Joker in a random position of the deck.
The joker represented with the number 0
The idea of shuffling is slicing the array in random position and moving it to the front like in the next examples:

1,2,3,4,5,6,7,8,9,10 -> 6,7,8,9,10,1,2,3,4,5 // Sliced at 6
1,2,3,4,5,6,7,8,9,10 -> 8,9,10,1,2,3,4,5,6,7 // Sliced at 8

Find the joker position in the array. The challenge is doing this without iterating over the entire deck.
Winning priority:

Best time performance
Shortest code

wait, so the challenge is to grep an array for a specific element as fast as possible, but there are no clues where the element could be except the array length is known in advance (thus a linear search has to be applied)? Not to mention the problem is underspecified (how are the cards represented?).

IOW, the best solution is to code a linear search in C (trivial) and let the compiler unroll the loop fully? Where's the challenge in that?

"The challenge is doing this without iterating over the entire deck." - uh, no, that is impossible. We have to look at each position except one in the worst case. If we are not allowed to look at them individually, what kinds of group views are possible? If we are to infer anything from the other cards, you need to specify what a shuffle means. Distribute each card of the deck into one of n (2?) stacks, then concatenate the stacks? Split the deck into n stacks and merge them randomly? If the shuffle is fully random, nothing can be inferred from other card positions.

oh. That kind of shuffle. That isn't really a shuffle but at least now we can apply binary search here.

it is clear now but still not a good challenge (or at least put in an overcomplicated fashion). Hint: what happens when you shuffle twice?

so, the joker starts at the front, then you "shuffle" thrice, then we get to look at the array?

@JanDvorak yep, this is it.

I assume deletion as soon as you read my answer ;-)

Considering your recent question history (and associated reputation gains), I strongly suggest you made use of the sandbox in meta before asking in main.

Cool, did not knew you got sandbox. lol

@Babibu you were told about it already several times, IIRC.

@JanDvorak what is IIRC?

IIRC = If I Remember Correctly. Urban Dictionary knows that. Google knows Urban Dictionary knows that.

Your question was mildly more interesting when you added the joker after shuffling. But even then it was all about golfing a binary search with a few twists.

@JanDvorak Will it be OK if I revert it to the previous version? Now that I am thinking about it, I like that twist better.

You should really use the sandbox next time. Maybe you should post a new question, this time through the sandbox? If only to learn the ropes.

If this is a code-golf then why is fastest execution time the main priority ?

@Babibu, I voted to close because you don't have a single objective criteria for winning here (the "best time performance" goal conflicts with code-golf).

This question appears to be off-topic because it is a chameleon question. You can't just change the criteria like that.

polyglot, constant time, 8 characters
52-a[52]

The trick is to realise what actually happens when you shuffle the array. Imagine the array as circular. Let us render the array starting at zero with the actual start/end signified with a bar:
0 1 2 3 4 5 6 7 8 9 |

Now, what actually happens when you shuffle the top three cards to the bottom and re-render:
7 8 9 0 1 2 3 4 5 6 |
0 1 2 3 4 5 6 | 7 8 9

Let's shuffle three more cards:
0 1 2 3 | 4 5 6 7 8 9

The only thing shuffles do is that they rotate the whole array, but don't change the ordering up to rotation.
So, if the array ends with a zero, we want to output the last index. The array has 53 elements, so the last index is 52.
If the array starts with a zero, it ends with its largest value. We want to output zero in this case.
Similarly, if the zero is n positions from the end, the last element of the array is n. Thus, the position of zero is the last position in the array, minus the value at the last position.

This is an example to 3 shuffles starting from no shuffles to 3. 0123456789 -> slice at 5 = 5678901234 -> slice at 8 = 8901234567. The solution is 2 in this case

@Babibu the algorithm works correctly. 9-7=2

Oh sorry, just now understand it. Cool

This is really the only possible answer. Though shorter code may be possible.


text:
Circular primes
Given a number determine if it is a circular prime.
A circular prime is a prime where if you rotate the digits you still get prime numbers.
1193 is circular prime because 1931 and 9311 and 3119 are all primes.
Input:          Output:
1193            circular
11939           circular
1456            nothing
193939          circular
1111111         nothing
7               circular
23              nothing

Shortest code wins.

I don't think this should have the code-challenge tag.

@Cruncher Wouldn't solving such problem in shortest possible code require creative thinking? If it is not code-challenge then I will gladly remove it, just assumed it to be challenge.

Not a big deal, but they're sort of disjoint. http://codegolf.stackexchange.com/tags/code-challenge/info "A code challenge is a competition for creative ways to solve a programming puzzle for an objective criterion other than code size."

@Cruncher sorry about that. Thanks for clarifying it for me :)

-1 You stated: "Shortest code wins" but awarded the check to a submission that was 4 times as long as the shortest submitted!

@DavidCarraher I asked for specific output. I do not see the shortest answer provide such output. Try running some programs and see if input and output matches for what is requested.

You must be kidding.

@DavidCarraher please do enlighten me which is the answer whose's code if I copy paste and run will yield the output on the given input specified above?

My own code returns True if a number is circular, False if a number is not circular.  I find that a reasonable alternative to "circular" and "nothing".  The shorter solution in J appears to follow the same Boolean convention (True, False).

@DavidCarraher Some problems on this site require specific output.  This is one.  Deal with it and stop whining. "Oh, poor me, my output 99,98,97... is equivalent to the lyrics of '99 bottles of beer on the wall' but it wasn't an accepted answer!"

@Boothby.  Bad example.  "99 bottles of beer on the wall" is all about crafting a specific output, the lyrics of a song.  The present example is advertised a test of circularity of a number: "Given a number determine if it is a circular prime."  Example output was given. But it was not stated (nor should it have been, in my view) that that specific format is required).

@DavidCarraher, It most certainly is stated. despite your wishes to the contrary.  Look at the question, and see "Input" and "Output".  This is a 'compound question': solve a challenge and format the output.

GolfScript, 47 characters
:s,,{)s/(+~:P{(.P\%}do(},!"nothing
circular"n/=

Input must be given on STDIN without trailing newline (online example).

It's beautiful :)

J, 47 chars (w/ formatted output)
('nothing';'circular'){~*/1&p:".(|."0 1~i.&#)":

J, 23 chars (boolean only)
*/1&p:".(|."0 1~i.&#)":

": is a string conversion; i.&# produces a range of integers [0,len), and |."0 1~ is a rotation of the string by each successive integer of the range.
". converts the list of rotations back into numbers, 1&p: converts the list of numbers into booleans (i.e. "prime?" predicate), and */ is a multiply reduce over the booleans (i.e. and).

Wow I really like this :) nicely done

Add an {'nothing';'circular' and beat the Python submission :)

@marinus Done, though it really hurts my sense of aesthetics... The interface between the human and the program is always the least fun to code.

Months after the fact, I finally just realized I could replace [:i.# with i.&#, which was bugging me at the time... L'esprit_de_l'escalier. Take that, GolfScript!

Python, 106 chars
p=input();n=`p`
for i in n:
 n=n[1:]+n[0];e=2
 while`e`!=n:p*=int(n)%e;e+=1
print'cniortchuilnagr'[p<1::2]

I see what you did there with the answer :) very clever

Oh man! I just did mine in Python and I came up with "cniortchuilnagr" independently.

Whoa! I got the idea from http://codegolf.stackexchange.com/a/406/9395

You can make this both shorter and correct if you use for i in n... otherwise, this will fail to rule out certain primes with more than 10 digits.

Mathematica 62 61
f@s_ := And @@ PrimeQ[FromDigits@StringRotateLeft[s, #] & /@ Range@9]

Usage
f["1193"]

True

f["11939"]

True

f["1456"]

False

f["193939"]

True

f["1111111"]

False

f["7"]

True

f["23"]

False

You can use FromDigits instead of ToExpression.

I had no idea that FromDigits could handle strings!

Ruby, 110 109 chars
require'mathn'
x=gets.chop.split''
puts (0..x.size).all?{|n|x.rotate(n).join.to_i.prime?}?:circular:'nothing'

You can shorten 1 character by using Symbol instead of String for :circular.

Mathematica, 75 64
And@@PrimeQ[FromDigits/@NestList[RotateLeft,IntegerDigits@#,9]]&

You can save a few characters by using RotateRight or RotateLeft to rotate the digits.

@DavidCarraher: Thanks, it saves quite a few, actually. How at one point I must have thought my elaborate Part trick would be shorter, I find most puzzling, but even now, you're still a good three characters ahead.

R, 139
a=scan()
p=0
A=nchar(a)
S=substr
for(i in 1:A){b=as.integer(paste0(S(a,i+1,A),S(a,1,i)));p=p+!sum(!b%%1:b)<3}
c('nothing','circular')[!p+1]

Python3.3, 160C
def m():
 s=input()
 r=range
 for i in r(len(s)):
  a=int(s)
  if all(a%i for i in r(2,a)):return 0
  s=s[1:]+s[:1]
 return 1
print("cniortchuilnagr"[m()::2])

Smalltalk, 195 chars
[:x|r:=[:n|(n\\10)*(10 raisedTo:n log floor)+(n//10)].s:=OrderedCollection with:x.[(m:=r value:s last)=x]whileFalse:[s add:m].^(s allSatisfy:[:each|each isPrime])ifTrue:['circular']ifFalse:['nothing']]

formatted
[:x|
  r:=[:n|(n\\10)*(10 raisedTo:n log floor)+(n//10)].
  s:=OrderedCollection with:x.
  [(m:=r value:s last)=x]whileFalse:[s add:m].
  ^(s allSatisfy:[:each|each isPrime])ifTrue:['circular']ifFalse:['nothing']]

APL, 53
'nothing' 'circular'[1+^/{⌊/⍵|⍨1↓⍳⍵-1}¨⍎¨{⍵⌽∆}¨⍳⍴∆←⍞]

Japt, 23 bytes
Would obviously be a hell of a lot shorter without the unnecessarily strict output requirement, which accounts for more than half the score here.
ÆìéX jÃ×g`Í(ˆg circÔ³`¸

Try it (includes all test cases)
ÆìéX jÃ×g`...`¸     :Implicit input of integer U
Æ                   :Map each X in the range [0,U)
 ì                  :   Convert U to digit array
  éX                :   Rotate right X times and convert back to integer
     j              :  Is prime?
      Ã             :End map
       ×            :Reduce by multiplication
        g           :Index into (0-based)
         `...`      :  Compressed string "circular nothing"
              ¸     :  Split on spaces

Husk, 22 19 bytes
?¨ÿċ◊¨¨ø±¨ΛoṗdSṀṙŀd

Try it online!
-3 bytes from Jo King. (simplified using Ṁ)

You can simplify that last bit of logic for 19 bytes

05AB1E, 7 6 bytes
-1 thanks to @ovs!
gL._pP

Outputs 1 if a circular prime, and 0 if not! :D
Try it online!
This is actually my first effortful code answer in this site! Yey!
How?
g         # Get the number of digits in the input number.
 L        # Push a list of all numbers from 1 to the length.
  ._      # For each number 'n' in the list, rotate the input to to the left n times and push a list of all outcomes.
    p     # Is each rotation a prime? If prime, convert that number to 1, else convert it to 0.
     P    # Push the product of all 1's or 0's (if a rotation is not prime, the product should be zero).
          # Print the product automatically.

05AB1E, 17 16 bytes
Again -1 thanks to @ovs!
gL._pP“‹ë“si“ÒŽ“

This code follows the output standard suggested by the test cases. I wrote this just in case my previous answer is invalid. If it is not, please count 6B as my score!
Try it online!
How again?
gL._pP              # Works just like the previous answer.
      “‹ë“          # Push the string "nothing" from the 05AB1E dictionary.
          s         # Bring back the number output again.
           i        # If the number is 1...
            “ÒŽ“    # Push the string "circular" again from the 05AB1E dictionary.

Thanks to @Kevin Cruijssen's tip on compressing strings! :)
Edit: Wow, I noticed that both of my answers are currently the shortest (during the time of writing). That is kind of ironic for a first effortful answer. That means I won!

My interpretation of the spec was the same as yours until I looked through the solutions. Pretty sure now that we have to output the words in the spec and the comments on the challenge would seem to back that up.

@Shaggy Yea, but a Mathematica answer claims that it outputs "True" and "False" for output.

If you rotate the input by the input length, you still get the input. This means gL works instead of g<Ý. And for this the builtin ā (length range) exists.

@ovs Indeed you are right!

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