Print the prime factorization of the greatest common divisor of two numbers
Python 3, 255 250  237 226 188 180 150 142 137 136 chars
a,b=map(int,input().split())
t,g='',1
while g&lt;a:
 g,p=g+1,0
 if a%g+b%g&lt;1:
  while a%g+b%g&lt;1:a/=g;b/=g;p+=1
  t+='%d^%d '%(g,p)
print(t)

It's amazing how much I could shorten this by just skipping stuff (like, you know, finding the gcd)! Also I could reduce 10 more chars by making this a function that expects 2 ints, like some other answers, instead of reading from stdin.