text:
The Lazy Programmer's XML Parser
Background
You are working as a programmer for a car sales company.
Your task for this week is to program an XML parser that takes in data about available models from different car manufacturers, and pretty-prints information about the newest models.
Luckily for you, the testing department has provided only one test case!
The faster you can write code that passes it, the more time you have for procrastination during the rest of the week.
Input
Your input is exactly this piece of XML data, supplied by the testing department.
It contains data about some car manufacturers, their series of cars, and the models in these series.
You may assume a trailing newline.
<?xml version="1.0" ?>
<products>
  <manufacturer name="Test Manufacturer 1">
    <series title="Supercar" code="S1">
      <model>
        <name>Road Czar</name>
        C
        <year>2011</year>
      </model>
      <model>
        <name>Ubervehicle</name>
        U
        <year>2013</year>
      </model>
      <model>
        <name>Incredibulus</name>
        I
        <year>2015</year>
      </model>
      <model>
        <name>Model 1</name>
        01
        <year>2010</year>
      </model>
    </series>
    <series title="Test series 22" code="Test">
      <model>
        <name>Test model asdafds</name>
        TT
        <year>2014</year>
      </model>
    </series>
  </manufacturer>
  <manufacturer name="Car Corporation">
    <series title="Corporation Car" code="CC">
      <model>
        <name>First and Only Model</name>
        FOM
        <year>2012</year>
      </model>
    </series>
  </manufacturer>
  <manufacturer name="Second Test Manufacturer">
    <series title="AAAAAAAAAAAAAA" code="D">
      <model>
        <name>Some older model</name>
        O
        <year>2011</year>
      </model>
      <model>
        <name>The newest model</name>
        N
        <year>2014</year>
      </model>
    </series>
    <series title="BBBBBBBBBBBBBBB" code="asdf">
      <model>
        <name>Another newest model here</name>
        TT
        <year>2015</year>
      </model>
    </series>
  </manufacturer>
</products>

Output
Your output is this string.
It lists the car manufacturers in alphabetical order, followed by a colon and the number of series they make.
Under each manufacturer, it lists the series name, model name, and code of each of their models, starting from the newest and going backward by year.
Trailing whitespace and line breaks are acceptable, as long as your output looks similar to this when printed.
Car Corporation: 1 series
  Corporation Car, First and Only Model (CC-FOM)
Second Test Manufacturer: 2 series
  BBBBBBBBBBBBBBB, Another newest model here (asdf-TT)
  AAAAAAAAAAAAAA, The newest model (D-N)
  AAAAAAAAAAAAAA, Some older model (D-O)
Test Manufacturer 1: 2 series
  Supercar, Incredibulus (S1-I)
  Test series 22, Test model asdafds (Test-TT)
  Supercar, Ubervehicle (S1-U)
  Supercar, Road Czar (S1-C)
  Supercar, Model 1 (S1-01)

Rules and Scoring
You may write either a function or full program.
The lowest byte count wins, and standard loopholes are disallowed.
Note that the input is fixed: you don't need to support any other inputs than the one given here.
Your program is allowed to return nonsense or even crash if the input is modified in any way.
You may also ignore the input and hard-code the output, if desired.
However, you may not use XML or HTML parser libraries or built-ins.

Would an HTML parser be allowed or would that be bending the rules?

I never want to buy a car from this company.

@vihan I'll (rather arbitrarily) decide that HTML parsers are not allowed either, since the two formats are so similar.

What about XSLT? ;)

@BetaDecay I'm going to allow XSLT as an exception, since it would probably be very tedious and annoying not to use XML parsing operations in that language. :P And it won't compete with the CJam answer anyway.

CJam, 109 107 bytes
"rzn ¸À¨ 4T\$D"S/q"<>"'"er'"/
f{\:i2/_E5bf.+.+\ff=)1<_s,9/+":  series
"2/.+\"  ,  ()
-"2/Z4e\f.\}

Note that four of the characters in the string at the beginning are unprintable.
Try it online in the CJam interpreter.
Idea
This is basically a hardcode that splits the input at all occurrences of <, > and ", selects specific chunks and interleaves them with the remaining parts of the output.
After splitting the input, the chunks at indexes 110, 114 and 122 are Car Corporation, Corporation Car and First and Only Model. The codes for series and name can be found at indexes 116 and 126, which can be calculated by adding 2 and 4 to the indexes of the names. Finally, the number of series is the length of the string Car Corporation divided by 9 (obviously).
Thus, we encode the part of the output that corresponds to this manufacturer as [114 122 110] or rather the string "rzn".
Code
e# Split the string at spaces.

"rzn ¸À¨ 4T\$D"S/

e# After replacing characters with their code points, this will be the result:
e# [[114 122 110] [184 192 144 168 144 152 140] [12 52 84 92 12 36 12 20 12 68 8]]

e# Read from STDIN, replace < and > with " and split at double quotes.

q"<>"'"er'"/

f{       e# For each chunk of the split string, push the split input; then:
\:i2/    e# Replace characters with character codes and split into chunks of
         e# length 2.
_E5b     e# Copy the result and push [2 4].
f.+      e# Replace each pair [I J] in the copy with [I+2 J+4].
.+       e# Vectorized concatenation.
         e# For the first chunk, we've achieved
         e# [114 122 110] -> [[114 122] [110]]
         e#               -> [[114 122] [110]] [[116 126] [110 112 4]]
         e#               -> [[114 122 116 126] [110 112 4]]
\ff=     e# Replace each integer with the chunk of the split input at that index.
)1<      e# Pop the first chunk and reduce it to the first string.
_s,9/    e# Divide that strings length by 9 and append the integer to the array.
":  series
"2/      e# Push [": " " s" "er" "ie" "s\n"].
.+       e# Vectorized concatenation; pushes the manufacturer line.
\        e# Swap the remaining strings on top of the stack.
"  ,  ()
-"2/     e# Push ["  " ", " " (" ")\n" "-"].
Z4e\     e# Swap the chunks at indexes 3 and 4.
\f.\     e# Interleave both arrays of strings.
}

Bubblegum, 227 225 bytes
0000000: 6d 50 45 b6 02 31 10 dc cf 29 6a 87 eb 92 1d ee 0e 07  mPE..1...)j.......
0000012: 08 93 1e 3c e1 45 be 9d fe 37 ae bd 2b 7d 95 54 85 41  ...<.E...7..+}.T.A
0000024: 55 9b 83 36 c2 ad b5 2a a1 00 4b 66 4d 36 c0 23 0f f6  U..6...*..KfM6.#..
0000036: a5 d1 58 1b eb 20 94 c4 50 ed 7e d1 d7 92 76 88 57 ab  ..X.. ..P.~...v.W.
0000048: 99 c6 b0 9f 08 a6 14 6a 96 66 c4 9e be 50 3e 12 a1 f3  .......j.f...P>...
000005a: 86 4c 09 c5 7b 67 e5 f9 d2 28 2b ed 56 64 a0 e8 9b 83  .L..{g...(+.Vd....
000006c: d8 9f 3a 99 20 c4 85 95 51 66 36 4b 70 ac fc 74 69 cc  ..:. ...Qf6Kp..ti.
000007e: 56 f4 9c 88 d7 32 83 4f c6 a9 de 13 f4 4e 92 b9 1b 87  V....2.O.....N....
0000090: 89 e0 6d 24 0a 4f 33 a7 fe 40 26 e4 37 a3 ad 42 43 72  ..m$.O3..@&.7..BCr
00000a2: bd f0 3b 6f 11 9f 16 32 ed 04 eb a7 fc d9 8d 62 91 f7  ..;o...2.......b..
00000b4: dc 97 f0 6a 11 49 f6 1e b9 cb fc 7b dd 7c 41 e6 8b 56  ...j.I.....{.|A..V
00000c6: eb 70 47 a7 b6 f9 b3 3c d1 42 a2 fa 27 cc 49 ac 3e 89  .pG....<.B..'.I.>.
00000d8: 97 ff 2e 9c a4 7c 21 f1 0f                             .....|!..

This isn't very competitive, but I just couldn't resist to post my first Bubblegum answer to an actual kolmogorov-complexity challenge.
The hexdump can be reversed with xxd -r -c 18 > xml.bg.
The code completely ignores the input. Compression has been done with zopfli, which uses the DEFLATE format but obtains a better ratio than (g)zip.
Thanks to @Sp3000 for -2 bytes!

sed, 449 bytes
Assumes sed to be run with the -nr options.
/\?|<p/d;:M
/<ma/{s/.*"(.*)".*/Q\1: X series/;/C/ s/X/1/;s/X/2/;H;d}
/<se/{s/.*"([^"]*)".*"([^"]*)".*/@\1!\2/;H;d}
/<mo/{
G;s/.*@(.*)*$/\1/;x;s/@(.*)*$//;x;:A N
/<\/m/!bA
s/\n/!/g;s/  +//g;s|<[/a-z]*>||g;s/(.*)!(.*)!(.*)!(.*)!(.*)!/%\1, \3 (\2-\4)@\1!\2/;H}
/<\/se/{x;s/\n*@.*$//;x}
$!{n;bM}
x;s/\n//g;s/Q(.*)Q(.*)%(.*)Q(.*)/\2\n  \3\n\4\n\1/
s/%(.*)%(.*)%(.*)\n(.*)%(.*)%(.*)%(.*)%(.*)%(.*)/\n  \3\n  \2\n  \1\n\4\n  \7\n  \9\n  \6\n  \5\n  \8/;p

Ungolfed version:

# Remove first 2 lines
/\?|<p/ d

:M
#manufacturer
/<ma/ {
    s/.*"(.*)".*/Q\1: X series/
    #Car corp
    /C/ s/X/1/
    #other
    s/X/2/
    H
    d
}

#series: store in hold buffer. (treating the hold buffer as a list, with @ as a delimeter)
/<se/{
    s/.*"([^"]*)".*"([^"]*)".*/@\1!\2/
    H
    d
}
/<mo/ {
    # pull series from hold buffer
    G
    s/.*@(.*)*$/\1/

    # remove series from hold buffer
    x
    s/@(.*)*$//
    x

    # Concatenate model into one line
    :A N
    /<\/m/ !{
        bA
    }
    s/\n/!/g

    # Remove junk
    s/  +//g
    s|<[/a-z]*>||g

    # Append formatted line to hold buffer, replace series at the end
    s/(.*)!(.*)!(.*)!(.*)!(.*)!/%\1, \3 (\2-\4)@\1!\2/
    H
}
/<\/se/ {
    #pop series name
    x
    s/\n*@.*$//
    x
}

$ ! {
    n
    b M
}
# end of loop

x
s/\n//g

# "sort"
s/Q(.*)Q(.*)%(.*)Q(.*)/\2\n  \3\n\4\n\1/
s/%(.*)%(.*)%(.*)\n(.*)%(.*)%(.*)%(.*)%(.*)%(.*)/\n  \3\n  \2\n  \1\n\4\n  \7\n  \9\n  \6\n  \5\n  \8/
p

Welcome to Programming Puzzles & Code Golf!

Bash, 388 368 365
base64 -d<<<H4sICKVS9FUCA2hlcmUAbVFBasMwELwH8oc92mBD5GNuqUogB9dQOw9QpDUWKFJYWS3t6yvJtI3T7k07szOzKy4IuKObIzFrZ/fAwCNp9NsN3APABVVw1ORnEFZBZ80HtE6hgYLz+ti15XbTo3QRGzCSWmHDKOQcCGkPzZ3q07oqOFg3T0hg8T1NXrNqbCAUwquxHoYyzR1WVcEw4XqkeK5f/mX27orgjIoeP8wuMv8EBbaO2ocbkkybn6wkVPoSTPBQ9Kw+ZaessPChaarlvXjE6GJUkZx63zv8Cp4vSG84aWkw650f8FcnFPDP+D0J5Q/ocnmWsR0rvwC2OTuexgEAAA==|zcat

Small test because:
$ bash ./go_procrastination.sh cars.xml
Car Corporation: 1 series
  Corporation Car, First and Only Model (CC-FOM)
Second Test Manufacturer: 2 series
  BBBBBBBBBBBBBBB, Another newest model here (asdf-TT)
  AAAAAAAAAAAAAA, The newest model (D-N)
  AAAAAAAAAAAAAA, Some older model (D-O)
Test Manufacturer 1: 2 series
  Supercar, Incredibulus (S1-I)
  Test series 22, Test model asdafds (Test-TT)
  Supercar, Ubervehicle (S1-U)
  Supercar, Road Czar (S1-C)
  Supercar, Model 1 (S1-01)

Even if you insist on avoiding unprintable characters and warnings, this can be made a lot shorter. 1. Your compressed file contains the name of the original file, car_manufacturer.txt. 2. A here string would be 3 bytes shorter. 3. Using zopfli instead of vanilla gzip saves 12 more bytes.

Thanks for the advice. Indeed that saved some bytes. But to keep in the mood of the challenge, lazyness discouraged installing zopfli or one of the PAQ Data Compression Programs. :)

The here string is an easy golf though. Just replace <<L with <<<(base encoded stuff).

And 3 bytes shaved. Nice.

source: Stack Exchange

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

sort: votes


text:
The Margin is too Narrow
Around the year 1637, Pierre de Fermat wrote in the margins of his copy of the Arithmetica:
It is impossible to separate a cube into two cubes, or a fourth power
into two fourth powers, or in general, any power higher than the
second, into two like powers. I have discovered a truly marvelous
proof of this, which this margin is too narrow to contain.

Unfortunately for us, the margin is still too narrow to contain the proof. Today, we are going to write into the margins a simple program that confirms the proof for arbitrary inputs.
The Challenge
We want a program for function that given a power, separates it into two pairs of two powers that are as close to the power as possible. We want the program that does this to be as small as possible so it can fit into the margins.

Input
The power and the power number: c, x
Constraints: c > 2 and x > 2
Input can be through program arguments, function arguments, or from the user.
Output
This exact string: "a^x + b^x < c^x" with a, b, c, and x replaced with their literal integer values. a and b must be chosen so that a^x + b^x < c^x and no other values of a or b would make it closer to c^x. Also: a>=b>0
Output can be through function return value, stdout, saved to a file, or displayed on screen.

Examples:
> 3 3
2^3 + 2^3 < 3^3
> 4 3
3^3 + 3^3 < 4^3
> 5 3
4^3 + 3^3 < 5^3
> 6 3
5^3 + 4^3 < 6^3
> 7 3
6^3 + 5^3 < 7^3
> 8 3
7^3 + 5^3 < 8^3

Due to Fermat's average writing skills, unprintable characters are not allowed. The program with the least number of characters wins.

Leaderboards
Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N characters

Alternatively, you can start with:
## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the leaderboard snippet:
# [><>](http://esolangs.org/wiki/Fish), 121 bytes

var QUESTION_ID=57363,OVERRIDE_USER=32700;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

I think it should be a>=b>0 or your first example would be invalid. And why do we have to display < when you want it to be <=?

@flawr Fixed :)

Would it be ok to take the arguments in the opposite order? First x, then c?

@RetoKoradi Sure :)

Pyth, 38 bytes
Ls^Rvzbjd.imj\^,dz+eoyNf<yTy]Q^UQ2Q"+<

Takes input in this format:
x
c

Matlab, 169 153 bytes
The score can be +-1 depending on the unsolved problems in the comments=) The score stays the same. This is just a bruteforce search for the best (a,b) pair.
Pretty disappointing: I first tried experimented with some 'fancy' stuff and then realized two simple nested for loops are way shorter...
function f(c,x);
m=0;p=@(x)int2str(x);
X=['^' p(x)];
for b=1:c;for a=b:c;
n=a^x+b^x;
if n<c^x&n>m;m=n;s=[p(a) X ' + ' p(b) X ' < ' p(c) X];end;end;end;
disp(s)

Old version:
function q=f(c,x);
[b,a]=meshgrid(1:c);
z=a.^x+b.^x;
k=find(z==max(z(z(:)<c^x & a(:)>=b(:))),1);
p=@(x)int2str(x);x=['^' p(x)];
disp([p(a(k)) x ' + ' p(b(k)) x ' < ' p(c) x])

Remove the spaces in m = 0? Still, that won't get you close to my answer :-PP

Also, it looks like you could remove q= from the function definition

I don't see the q variable being used anywhere.  You can shave off a couple of bytes by simply doing function f(c,x) and removing the semi-colon as well.

Mathematica, 79  95 80 bytes
This just might fit onto the margin.
c_~f~x_:=Inactivate[a^x+b^x<c^x]/.Last@Solve[a^x+b^x<c^x&&a>=b>0,{a,b},Integers]

Testing
f[3, 3]
f[4, 3]
f[5, 3]
f[6, 3]
f[7, 3]
f[8, 3]

CJam, 51 46 43 bytes
q~_2m*\f+{W$f#)\:+_@<*}$W='^@s+f+"+<".{S\S}

This full program reads the power, then the base from STDIN.
Try it online in the CJam interpreter.

Matlab, 141 140 bytes
This is coded as function that displays the result in stdout.
function f(c,x)
b=(1:c).^x;d=bsxfun(@plus,b,b');d(d>c^x)=0;[~,r]=max(d(:));sprintf('%i^%i + %i^%i < %i^%i',[mod(r-1,c)+1 ceil(r/c) c;x x x])

Example use:
>> f(8,3)
ans =
7^3 + 5^3 < 8^3

Or try it online in Octave.
Thanks to @flawr for removing one byte.

I always avoided sprintf because it seemed so complicated while actually it really isn't! And I forgot about bsxfun once again, so thats a very elegant solution. I especially like the way you abused the single/double indexing in the last argument=) (You could remove a space there too!)

Thanks! I usually use disp too, except in Code Golf :-P

If you use fprintf instead of sprintf, it doesn't display "ans"

@Jonas But it prints the result and then the prompt >> in the same line, which is a bit strange

You can use fprintf, but you'd have to insert a manual carriage return.

@rayryeng But still the >> symbol appears to the right of the printed string, which is strange-looking

@LuisMendo - does it??? weird.

@rayryeng On my system, fprintf('\n%i', 11) outputs 11>>, with the blinking cursor to the right of >>

ahh, why don't you put it after the %i??  In that case, it eats up your byte count, so forget that!

@rayryeng Do you mean $i\n? That gives each number in a different line, so I can't use it here

@LuisMendo - Oh you're right.  I forgot you're using a matrix as input into the printf statement.  Never mind then.

@rayryeng I was starting to think it was a Windows thing :-) Thanks for the  ideas!

R, 139 characters
function(c,x)with(expand.grid(a=1:c,b=1:c),{d=a^x+b^x-c^x
d[d>0]=-Inf
i=which.max(d)
sprintf("%i^%4$i + %i^%4$i < %i^%4$i",a[i],b[i],c,x)})

CJam, 53 51 bytes
l~:C\:X#:U;C2m*{Xf#:+_U<*}$W=~"^"X+:T" + "@T" < "CT

Try it online
The input format is x c, which is the reverse of the order used in the examples.
Explanation:
l~    Read and interpret input.
:C    Store c in variable C.
\     Swap x to top.
:X    Store it in variable X.
#     Calculate c^x.
:U;   Store it in variable U as the upper limit, and pop it from stack.
C2m*  Generate all pairs of values less than c. These are candidates for a/b.
{     Start of mapping function for sort.
  X     Get value of x.
  f#    Apply power to calculate [a^x b^x] for a/b candidates.
  :+    Sum them to get a^x+b^x.
  _U<   Compare value to upper limit.
  *     Multiply value and comparison result to get 0 for values above limit.
}$    End of sort block.
W=    Last a/b pair in sorted list is the solution.
~     Unpack it.
"^"X+ Build "^x" string with value of x.
:T    Store it in variable T, will use it 2 more times in output.
" + " Constant part of output.
@     Rotate b to top of stack.
T     "^x" again.
" < " Constant part of output.
C     Value of c.
T     And "^x" one more time, to conclude the output.

Python 2, 182 161 157 bytes
I usually answer in MATLAB, but because there are already two solutions in that language, I'd figure I'd try another language :)
def f(c,x):print max([('%d^%d + %d^%d < %d^%d'%(a,x,b,x,c,x),a**x+b**x) for b in range(1,c+1) for a in range(b,c+1) if a**x+b**x<c**x],key=lambda x:x[1])[0]

Ungolfed code with explanations
def f(c,x): # Function declaration - takes in c and x as inputs

    # This generates a list of tuples where the first element is
    # the a^x + b^x < c^x string and the second element is a^x + b^x
    # Only values that satisfy the theorem have their strings and their
    # corresponding values here
    # This is a brute force method for searching
    lst = [('%d^%d + %d^%d < %d^%d'%(a,x,b,x,c,x),a**x+b**x) for b in range(1,c+1) for a in range(b,c+1) if a**x+b**x<c**x]

    # Get the tuple that provides the largest a^x + b^x value
    i = max(lst, key=lambda x:x[1])

    # Print out the string for this corresponding tuple
    print(i[0])

Example Runs
I ran this in IPython:
In [46]: f(3,3)
2^3 + 2^3 < 3^3

In [47]: f(4,3)
3^3 + 3^3 < 4^3

In [48]: f(5,3)
4^3 + 3^3 < 5^3

In [49]: f(6,3)
5^3 + 4^3 < 6^3

In [50]: f(7,3)
6^3 + 5^3 < 7^3

In [51]: f(8,3)
7^3 + 5^3 < 8^3

Try it online!
http://ideone.com/tMjGdh
If you want to run the code, click on the edit link near the top, then modify the STDIN parameter with two integers separated by a space.  The first integer is c and the next one is x.  Right now, c=3 and x=3 and its result is currently displayed.

136 reordering and remove useless space

Pyth, 53 52 50 bytes
Ls^ReQbs[j" + "+R+\^eQ_Sh.MyZf<yT^FQ^UhQ2" < "j\^Q

Try it online.
Takes as input c,x where c is the target number and x is the base.

Pyth, 60 bytes
Input is given as c,k
=k^ReQUKhQLfghTeT^tb2jd.i+R+\^eQa@yUKxJsMykh.M?>Z^KeQ0ZJK"+<

Try it Online

C, 175 bytes
a,b,m,A,B,M;p(
a,x){return--x
?a*p(a,x):a;}f
(c,x){M=p(c,x)
;for(a=c,b=1;a
>=b;)(m=p(c,x)
-p(a,x)-p(b,x
))<0?--a:m<M?
(M=m,B=b++,A=
a):b++;printf
("%d^%d + %d"
"^%d < %d^%d",
A,x,B,x,c,x);}

To fit the code into the margin, I've inserted newlines and split a string literal above - the golfed code to be counted/compiled is
a,b,m,A,B,M;p(a,x){return--x?a*p(a,x):a;}f(c,x){M=p(c,x);for(a=c,b=1;a>=b;)(m=p(c,x)-p(a,x)-p(b,x))<0?--a:m<M?(M=m,B=b++,A=a):b++;printf("%d^%d + %d^%d < %d^%d",A,x,B,x,c,x);}

Function f takes c and x as arguments, and produces the result on stdout.
Explanation
This is an iterative solution that zigzags the line defined by a^x + b^x = c^x.  We start with a=c and b=1.  Obviously, that puts us on the wrong side of the line, because c^x + 1 > c^x.  We decrement a until we cross the line.  When we're below the line, we increment b until we cross it in the other direction.  Repeat until b meets a, remembering the best solution in A and B as we go.  Then print it.
p is a simple recursive implementation of a^x (for x>0) since C provides no operator for exponentiation.
In pseudo-code:

a=c
b=1
M = c^x

while a >= b
do
   m = c^x - a^x - b^x
   if m < 0
      a -= 1
   else // (m > 0, by Fermat's Last Theorem)
      if m < M
         A,B,M = a,b,m
      b += 1
done
return A,B

Limitations
c^x must be representable within the range of int.  If that limitation is too restrictive, the signature of p could be trivially modified to long p(long,int) or double p(double,int), and m and M to long or double respectively, without any modification to f().
Test program
This accepts c and x as command-line arguments, and prints the result.
#include<stdio.h>
int main(int argc, char**argv) {
    if (argc <= 2) return 1;
    int c = atoi(argv[1]);
    int x = atoi(argv[2]);
    f(c,x);
    puts("");
    return 0;
}

Japt -S, 38 33 31 30 bytes
pV
õ ï Ôæ@>XxpVÃïNÅ iÄ p<N Ëq^

Try it
                      :Implicit input of integers U=c & V=x

pV\nõ ï Ôæ@>XxpVÃ     >FINDING THE PAIR
pV                    :Raise U to the power of V
  \n                  :Reassign to U
    õ                 :Range [1,U]
      ï               :Cartesian product with itself
        Ô             :Reverse
         æ            :Find the first element that returns true
          @           :When passed through the following function as X
           >          :  U is greater than
            Xx        :  X reduced by addition
              pV      :  After raising each to the power of V
                Ã     :End find

ïNÅ iÄ p<N Ëq^        >FORMATTING THE OUTPUT
ï                     :Cartesian product with
 N                    :  Array of all inputs (i.e., the original [U,V])
  Å                   :  Slice off the first element
    i                 :Insert
     Ä                :  "+" at 0-based index 1
       p<N            :Push "<", and the array of all inputs
           Ë          :Map
            q^        :  Join arrays with (and split strings on) "^"

                      :Implicit output joined with spaces

Haskell, 120 bytes
I think I've golfed this as much as I can:
c%x=a&" + "++b&" < "++c&""where(_,a,b)=maximum[(a^x+b^x,a,b)|b<-[1..c],a<-[b..c],a^x+b^x<c^x];u&v=show u++"^"++show c++v

Ungolfed:
fn c x = format a " + " ++ format b " < " ++ format c ""
    where format :: Integer -> String -> String
          -- `format u v` converts `u`, appends an exponent string, and appends `v`
          format u v = show u ++ "^" ++ show c ++ v
          -- this defines the variables `a` and `b` above
          (_, a, b) = maximum [(a^x + b^x, a, b) | b <- [1..c],
                                                   a <- [b..c],
                                                   a^x + b^x < c^x]

Usage:
Prelude> 30 % 11
"28^30 + 28^30 < 30^30"

Haskell, 132 128 bytes
x!y=x++show y
c#x=(\[_,a,b]->""!a++"^"!x++" + "!b++"^"!x++" < "!c++"^"!x)$maximum[[a^x+b^x,a,b]|a<-[0..c],b<-[0..a],a^x+b^x<c^x]

Usage example: 7 # 3 returns the string "6^3 + 5^3 < 7^3".

Perl 5, 119 bytes
A subroutine:
{for$b(1..($z=$_[0])){for(1..$b){@c=("$b^$o + $_^$o < $z^$o",$d)if($d=$b**($o=$_[1])+$_**$o)<$z**$o and$d>$c[1]}}$c[0]}

Use as e.g.:
print sub{...}->(8,3)

Ruby, 125 bytes
Anonymous function. Builds a list of a values, uses it to construct a,b pairs, then finds the max for the ones that fit the criteria and returns a string from there.
->c,x{r=[];(1..c).map{|a|r+=([a]*a).zip 1..a}
a,b=r.max_by{|a,b|z=a**x+b**x;z<c**x ?z:0}
"#{a}^#{x} + #{b}^#{x} < #{c}^#{x}"}

JavaScript (Node.js), 114 bytes
c=>x=>{for(a=B=[];++a<c;)for(b=0;++b<c;)B[c**x-a**x-b**x]=`${a}^${x} + ${b}^${x} < ${c}^${x}`;return B.find(_=>_)}

Try it online!
JavaScript (Node.js), 117 bytes
c=>x=>[...B=Array(c)].map((_,a,P)=>P.map((_,b)=>B[c**x-a**x-b**x]=`${a}^${x} + ${b}^${x} < ${c}^${x}`))&&B.find(_=>_)

Try it online!
Brute-force all a,b<c

all_licenses: 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/


text:
Show tree rings age
Introduction
Yesterday I saw a birthday puzzle. Congrats!!
Also this week I watched an episode of the TV show Bones where a dead body was found buried under a tree. To calculate the time of death, they counted the tree rings.
Tree rings form because trees grow slower during the winter and faster during the summer. Thus you can calculate the tree's age by counting the rings. Also you can see natural events like rainy or dry seasons.

Challenge
Given an integer n >= 1 as input, write a full program to output the tree age rings.
Because rings can change of shape use three diferent characters ('0', '*', '+') to show climate cycles.
Age 1
0

Age 2
***
*0*
***

Age 3
+++++
+***+
+*0*+
+***+
+++++

Age 4
0000000
0+++++0
0+***+0
0+*0*+0
0+***+0
0+++++0
0000000

Size of the tree is a square of sides 2*n - 1
Winning
Shortest code in bytes wins.

What about when age=5?

the rings have a three steps cycle.('0', '*', '+') so 5 year is *

Is the size the area, the perimeter or the length of each side?

@BetaDecay I update the question. If you can suggest a better wording let me know.

I think this question would have some more character to it if you had to paint a tree's growth pattern incorporating the effects of the seasons and natural events.

@Luminous I tought in use a bigger array and request for a random char to describe unpredictable climate. But tought will complicate much for my first problem

That first problem being??

@Luminous I mean my first problem question in Code golf.

Oh! You don't have to subject yourself to something that's more simple than what you can imagine because it's your first problem. That's what the sandbox is for.

Pyke, 13 bytes
0QV"0*+"o@A.X

Based on this excellent Pyke answer on another challenge, so make sure to upvote that one as well!
Try it online.
Explanation:
0              # Start with a "0" in the center
 QV            # Loop the input amount of times:
   "0*+"       #  Push string "0*+"
        o      #  Push index++ (0 by default; and increases by 1 after pushing)
         @     #  And use it to index it into the string (0-based with automatic wraparound)
          A    #  Deep apply the following command:
           .X  #   Surround the string with this character around it
               # (after which the result is output implicitly)

BBC Basic, 93 bytes
1I.r:r=r-1:F.i=-r TOr:F.j=-r TOr:p=ABS(i):q=ABS(j):IFp<q TH.p=q
2V.48-(p MOD3)*6MOD7:N.:P.:N.

The abbreviated keywords help out a lot here. In line 2, I'm using the VDU command (equivalent to C's putchar()) to print each character. This is a lot more efficient than P.MID$("0*+",p MOD3+1,1).
Here it is running in BeebEm3 on a Mac:

How you create that gif?

@JuanCarlosOropeza Not very efficiently. I used QuickTime Player to capture the screen, QuickTime Player 7 to export the video to PNG images, GraphicConverter to turn them into a GIF, and ezgif.com to optimize the results.

K5, 27 30 26 25 22 bytes
"0"{4(|+y,)/x}/"0*+"3!1_!

This approach iteratively "wraps" a core (beginning with "0") on all four sides using some other character ({4(|+y,)/x}). The sequence of seasonal wrappings is determined by a modulo 3 (3!) sequence. It's a bit fiddly to get the base case to line up just right.
edit:
"0*+"3!u|\:u:t,1_|t:|!

This alternative builds the entire rectangular array at once from the provided exclusive range (!) reversed and joined with itself after dropping an item (t,1_|t:|). We then take the cartesian product maximum (u|\:u:), take the entire matrix modulo 3 (3!) and index into the array of characters.
In action:
  "0*+"3!u|\:u:t,1_|t:|!1
,,"0"

  "0*+"3!u|\:u:t,1_|t:|!3
("+++++"
 "+***+"
 "+*0*+"
 "+***+"
 "+++++")

  "0*+"3!u|\:u:t,1_|t:|!5
("*********"
 "*0000000*"
 "*0+++++0*"
 "*0+***+0*"
 "*0+*0*+0*"
 "*0+***+0*"
 "*0+++++0*"
 "*0000000*"
 "*********")

I don't know K, but is this a full program and not just a function?

It is both a full program and a function. It's an example of what is called a "tacit definition". The distinction is extremely arbitrary anyway.

CJam, 25 bytes
q~,_1>W%\+_ff{e>"0*+"=}N*

Test it here.
Explanation
q~,       e# Read input N, turn into range [0 1 ... N-1]
_1>       e# Duplicate and cut off the zero.
W%        e# Reverse.
\+        e# Prepend to original range to give [N-1 ... 1 0 1 ... N-1]
_         e# Duplicate
ff{       e# Nested map for each pair of elements in that array.
  e>      e# Take the maximum, i.e. chessboard distance from the centre.
  "0*+"=  e# Select the right character using cyclic indexing into this string.
}
N*        e# Join the lines with line feeds.

Python 2, 83 bytes
I=n=input()
while I+n-1:I-=1;i=abs(I);w=("O*+"*n)[i:n];print w[::-1]+w[0]*2*i+w[1:]

Prints line by line. Each line is chopped into three parts:

The left cycling part, including the first repeated char.
The repeating center part
The right cycling part.

For n=4:
0    000000
0+    ++++    0
0+*    **    +0
0+*0        *+0
0+*    **    +0
0+    ++++    0
0    000000

We generate the left part in reverse as w, clone its last character 2*i times, then add on the original version without the first character.

Matlab, 63 bytes
n=input('')-1;x='0*+';t=abs(-n:n);x(mod(bsxfun(@max,t,t'),3)+1)

Example:
>> n=input('')-1;x='0*+';t=abs(-n:n);x(mod(bsxfun(@max,t,t'),3)+1)
5
ans =
*********
*0000000*
*0+++++0*
*0+***+0*
*0+*0*+0*
*0+***+0*
*0+++++0*
*0000000*
*********

Python 2, 83 bytes
n=input()
R=range(1-n,n)
for i in R:print''.join('0*+'[max(i,-i,j,-j)%3]for j in R)

If we think of the tree as a coordinate grid, the symbol at (i,j) is determined by max(abs(i),abs(j))%3, or equivalently max(i,-i,j,-j)%3.
For each row i, we join and print the symbols in that row.

You could shorten this by putting the range statement straight in the third line.

@EthanBrouwer I'm using R twice, and it's longer than 5 chars, so assignment wins out.

touche! I only saw the first one. My bad. :)

Pyth, 23 bytes
VK+_StQUQsm@"0*+"eS,dNK

Try it online: Demonstration
Explanation:
VK+_StQUQsm@"0*+"eS,dNK   implicit: Q = input number
    StQ                   the list [1, 2, ..., Q-1]
   _                      reverse it [Q-1, ..., 2, 1]
       UQ                 the list [0, 1, ..., Q-1]
  +                       combine them [Q-1, ..., 1, 0, 1, ..., Q-1]
 K                        and store in K
VK                        for each N in K:
          m           K      map each element d in K to:
                 eS,dN          the maximum of d and N
           @"0*+"               and pick the corresponded char (modulo 3)
         s                   join the chars to a string and print

MATLAB, 80 78 73 bytes
Thanks Luis Mendo for helping me shave 5 bytes!
A=eye(2*input('')-1);a='0*+';a(mod(bwdist(A.*rot90(A),'chessboard'),3)+1)

Example
>> A=eye(2*input('')-1);a='0*+';a(mod(bwdist(A.*rot90(A),'chessboard'),3)+1)

5

ans =

*********
*0000000*
*0+++++0*
*0+***+0*
*0+*0*+0*
*0+***+0*
*0+++++0*
*0000000*
*********

Ungolfed and Code Explanation
%// Accepts an integer n from the user and creates a 2*n - 1 x 2*n - 1 identity matrix
A=eye(2*input('')-1);

%// Creates an array of three characters to print each level of the ring
a='0*+';

%// By taking the identity matrix and element-wise multiplying with its 90 degree rotated
%// version of itself, this creates a zero matrix except for the centre most
%// value, which is 1
%// This takes the distance transform via the chessboard / Chebyshev distance
%// from the centre element
%// This mirrors what "level" each square would be at
%// 1: https://en.wikipedia.org/wiki/Distance_transform
%// 2: https://en.wikipedia.org/wiki/Chebyshev_distance
b = bwdist(A.*rot90(A),'chessboard');

%// Because each level cycles through each of the characters in the
%// character array a, we need to perform a mod operation so that
%// all of the values cycle from 1 to 3
%// This changes the distance transform output so that we range
%// from 1 to 3 instead
c = mod(b,3) + 1;

%// The values in the matrix c correspond exactly to the locations
%// we need to sample from the array a and we display our result
a(c)

Minor Note
bwdist is a function that's part of the image processing toolbox, and can only be run in MATLAB.  Octave (IIRC) does not have bwdist implemented yet so this can't be run in Octave.

You can save a few bytes: use eye and multiply element-wise by its rot90'ed version to generate the "seed" matrix: I=eye(2*input('')-1);a='0*+';a(mod(bwdist(I.*rot90(I),'chessboard'),3)+1)

Oh cool! Thanks @LuisMendo

Charcoal, 15 14 bytes
ＦＮ«Ｂ⊕⊗ι§0*+ιＭ↖

Try it online!
explanation
ＦＮ                 #start a for loop, iterating n (input) times
   «                 #the loop contains 2 expressions so a body is opened
    Ｂ               #draw a box
      ⊕⊗ι          #size of box is 2*i+1
           §0*+ι     #character of the box is "0*+" index i
                Ｍ↖  #move up left 1
                     #the result is printed implicitly

15 bytes
ＦＮ«Ｂ⊕×²ι§0*+ιＭ↖

Improved version by Psuedo Nym replaced ×² with ⊗, the in-built doubled operator.

-1 byte: ＦＮ«Ｂ⊕⊗ι§0*+ιＭ↖

Python 2, 134 bytes
def l(x,c=1):
 p="\n\x1b[%d"%c;d=p+";%dH"%c
 if x:s=x*2-1;d+=(p+"G").join(["0*+"[(x+1)%3]*s]*s)+l(x-1,c+1)
 return d
print l(input())

Perl 5, 57 bytes
Using the approach from @xnor's answer, please upvote them!
//,say map{qw(0 * +)[max(abs,abs$')%3]}@;for@;=- --$_..$_

Try it online!

Sed, 277 252 characters
(251 character code + 1 character command line option.)
Expects input in unary format.
:m
s/1/0/
s/1/*/
s/1/+/
tm
h
s/^/:/
:r
s/(.*):(.)/\2\1:/
tr
s/://
G
s/\n.//
h
:
/^(.)\1*$/ba
s/(.)(.)(\2*)\1/\1:\2\3:\1/
:c
s/(:_*)[^_](.*:)/\1_\2/
tc
:u
s/(.)(:\1*)_/\1\2\1/
tu
s/://g
H
b
:a
g
s/[^\n]+/:/
:f
s/(.*):(\n[^\n]+)/\2\1:/
tf
s/://
G
s/\n//

Sample run:
bash-4.3$ sed -rf treering.sed <<< 1
0

bash-4.3$ sed -rf treering.sed <<< 11
***
*0*
***

bash-4.3$ sed -rf treering.sed <<< 111
+++++
+***+
+*0*+
+***+
+++++

bash-4.3$ sed -rf treering.sed <<< 1111
0000000
0+++++0
0+***+0
0+*0*+0
0+***+0
0+++++0
0000000

Matlab 92
input('')-1;x=ones(2*n+1,1)*abs(-n:n);z=mod(max(x,x'),3);z(z>1)=2;z(z<1)=7;disp([z+41,''])

PowerShell, 68 bytes
$f={($l=($c='+0*'[$_--%3])+"$c$c"*$_)
if($_){&$f $_|%{"$c$_$c"}
$l}}

Try it online!
Unrolled:
$f={
    $_--
    $char='+0*'[$_%3]
    $line=$char+"$char$char"*$_
    Write-Output $line
    if($_){
        &$f $_|ForEach-Object{
            Write-Output "$char$_$char"
        }
        Write-Output $line
    }
}

Canvas, 15 bytes
Ｈ0*+＠¹２×╷：＊；２２╋

Try it here!
Can probably be shortened further.
Explanation
H0*+@¹2×|:*;22╋
H               push an empty art object, start a loop using input
 0*+            string "0*+"
    @           get the nth element, circularly <-----------+
     ¹          loop iteration                              |
      2×        double it                                   |
        |       decrement it                                |
         :      duplicate it                                |
          *     use that to box the character from here ----+
           ;    swap the box with the previous iteration
            22╋ overlap at (2,2)

Japt -h, 20 bytes
Ñ ÆP=Õû"0*+"gX=z)XÑÄ

Try it or run all test cases
Ñ ÆP=Õû"0*+"gX=z)XÑÄ     :Implicit input of integer U
Ñ                        :U*2
  Æ                      :Map each X in the range [0,U*2)
   P=                    :  Reassign to P (initially the empty string)
     Õ                   :  Transpose P
      û                  :  Centre pad with
       "0*+"             :    Literal string
            g            :    Get character at 0-based index
             X=          :      Reassign to X
               z         :      X floor divided by 2
                )        :    End get
                 XÑÄ     :    To length X*2+1

Ruby, 85 characters
puts (m=0..(n=gets.to_i-1)*2).map{|i|m.map{|j|"0*+"[[(i-n).abs,(j-n).abs].max%3]}*""}

Sample run:
bash-4.3$ ruby -e 'puts (m=0..(n=gets.to_i-1)*2).map{|i|m.map{|j|"0*+"[[(i-n).abs,(j-n).abs].max%3]}*""}' <<< 4
0000000
0+++++0
0+***+0
0+*0*+0
0+***+0
0+++++0
0000000

Moonscript - 104 bytes
m=io.read!
n=2*m-1
for y=1,n
 io.write ({'0','*','+'})[(math.max y-m,x-m,m-y,m-x)%3+1]for x=1,n
 print!

C, 138 bytes
j,k,l;t(i){l=2*i;char*c=calloc(l,l);memset(c,10,l*(l-2));for(;k<i;++k)for(j=k;j<l-1-k;)memset(c+j++*l+k,"+0*"[(i-k)%3],l-2*k-1);puts(c);}

Function t taking one integer parameter - the age.
Ungolfed (with main function to easily run the above one):
#include "stdlib.h" /* calloc - only necessary for 64-bit system */
j,k,l;t(i)
{
    l=2*i;
    char*c=calloc(l,l);
    memset(c,10,l*(l-2)); /* fill with '\n' */
    for(;k<i;++k)for(j=k;j<l-1-k;)memset(c+j++*l+k,"+0*"[(i-k)%3],l-2*k-1);
    puts(c);
}

main(int c,char**v)
{
    t(atoi(v[1]));
}

The stdlib.h may be necessary on some systems, because without it the return type of the undeclared function calloc would default to int. Because int and char* are not necessarily of same size, an invalid pointer could be written into c. In most 32-bit systems both char* and int have same size, but this is not true for 64-bit systems.

JavaScript (ES6), 114
Using alert for output - bad proportional font and the result is ugly. In the snippet below the alert is redirect to the snipped body, giving a better result.
The newline inside backticks is significant and counted.
Test running the snippet in Firefox.

/* Redefine alert for testing purpose */ alert=x=>O.innerHTML=x;

[...'*+0'.repeat(n=prompt()-1)].map((c,i)=>i<n?b=[z=c.repeat(i-~i),...b,z].map(r=>c+r+c):0,b=[0]);alert(b.join`
`)

I try run the code snippet, but nothing happen. Dont know if that is because I open stack overflow in chrome?

@JuanCarlosOropeza maybe that. I have written: Test running the snippet in Firefox but obviously I was just kidding, Chrome (no version of Chrome) is not EcmaScritpt 6 compliant, missing the => functions.

@JuanCarlosOropeza I have to correct myself. The newest release of Chrome has the arrow function, but does not understand the spread operator .... Still far from ES6

05AB1E, 23 bytes
0¸sG…0*+Nè©δ.ø®N·>×.ø}»

Try it online or verify a few more test cases.
Explanation:
0¸                     # Start with a 0 wrapped in a list as the center: [0]
  sG                   # Loop `N` in the range [1, input):
    …0*+               #  Push string "0*+"
        Nè             #  Use `N` to index into this string
                       #  (0-based with automatic wraparound)
          ©            #  Store this character in variable `®` (without popping)
           δ.ø         #  Surround each line with this character
               N·>     #  Push 2 * `N` + 1
              ®   ×    #  Repeat the character `®` that many times as string
                   .ø  #  And surround the list with this string
   }»                  # After the loop: join all strings by newlines
                       # (after which the resulting string is output implicitly as result)

PowerShell, 118 bytes
param($n)((--$n..0+1..$n|%{-join(($z=($x='0*+'*$n)[$n..$_])+"$($x[$_])"*2*$_+($z[($n-$_-1)..0],'')[$n-eq$_])}),0)[!$n]

Try it online!
:(

recursion rulez :)

@mazzy You sure you don't want to post that as your own?

J, 22 bytes
'0*+'{~3|>./~&:|@i:@<:

Try it online!


text:
Cut a pizza into identical slices

This is what I thought this question was going to be, before I fully read it.
A group of code golfers walk into The Nineteenth Bite Pizzeria and order a pizza. It comes in an irregular shape, made of unit squares. Your task is to help them cut it into identical slices. That is, the slices must have the exact same shape and size; they can be rotated but not flipped/mirrored. For example, if they are Tetris pieces, they must be the same kind, you can't use both an L piece and a J piece.
Input
You will be given the number of people in the group on the first line (always an integer from 2 to 10, inclusive), followed by a rectangular matrix of ' ' (space) and '#' characters, representing the pizza. All the '#' characters are connected through their edges. The number of '#' characters is guaranteed to be a multiple of the number of people.
Output
You should print the same matrix, with each '#' character replaced with a digit from 0 to n-1 (n being the number of people). Each digit should mark a slice. The slice shape must be connected through the square edges. The slice numbering doesn't need to be in any particular order. If there are multiple ways of cutting the pizza, any of them is acceptable.
If it's not possible to cut the pizza as required, you should print the string "No pizza for you!" instead.
Scoring
This is code golf. Your score will be the number of bytes in the program. Characters will be counted through their UTF-8 encoding. Lowest score wins.
Examples
Input:
3
 #
###
####
   #

Output:
 0
100
1122
   2

Input:
4
###
# #
###

Output:
001
2 1
233

Input:
2
#    #
######

Output:
No pizza for you!

Input:
5
    #
   ####
  #####
 #####
#####
####
  #

Output:
    0
   1000
  21110
 32221
43332
4443
  4

Input:
4
   #
 ####
######
  #####
  ####

Output:
   0
 1000
111203
  12233
  2233

Requirements

You should write a full program that reads from the standard input and writes to the standard output.
The program must be runnable in Linux using freely available software.
Your program should finish each of the above examples in less than 1 minute on a modern computer.
No standard loopholes.

The Nineteenth Bite :^)

@FryAmTheEggman © Calvin's Hobbies

Bonus for regex solutions.

PHP code, 1808 971 bytes
Quick and dirty implementation in PHP. First brute-force all possible slice shapes, next brute-force all positions and orientations of the slices.
Usage: cat pizza.txt | php pizza.php
Edit: reduced code size by more than 45% by rewring algorithm using recursion rather than nested loops. However, this eats memory (and pizza's ;-)). Pizza's larger than 8x8 will probably run out of memory. The nested loop variant can easily handle any size, but is twice the code size.
<?php define('A',98);$n=fgets(STDIN);$d=array();$m=$u=str_pad('',A,'+');$s=0;while($g=fgets(STDIN)){$g=rtrim($g);assert(strlen($g)<=A-2);$s++;$m.='+'.str_pad(rtrim($g),A-2,' ').'+';for($l=0;$l<strlen($g);$l++)if($g[$l]=='#')$d[]=$s*A+$l+1;}$m.=$u;$r=count($d)/$n;x(reset($d),array(array()),0,0,0,0);die('No pizza for you!');function x($e,$c,$b,$a,$q,$t){global$r,$m,$d;$h=$a*A+$b;if(!in_array($e+$h,$d))return;if(in_array($h,$c[0]))return;$c[0][]=$h;$c[1][]=$b*A-$a;$c[2][]=-$a*A-$b;$c[3][]=-$b*A+$a;if(count($c[0])<$r)do{x($e,$c,$b+1,$a,$b,$a);x($e,$c,$b,$a+1,$b,$a);x($e,$c,$b-1,$a,$b,$a);x($e,$c,$b,$a-1,$b,$a);$v=($b!=$q||$a!=$t);$b=$q;$a=$t;}while($v);else w($c,$m,0,reset($d),0);}function w(&$p,$f,$o,$e,$i){global$n,$d;foreach($p[$i]as$h){$j=$e+$h;if(!isset($f[$j])||$f[$j]!='#')return;$f[$j]=chr(ord('0')+$o);}if(++$o==$n){for($k=A;$k<strlen($f)-A;$k++)if($k%A==A-1)echo PHP_EOL;else if($k%A)echo$f[$k];exit;}foreach($d as$j)for($i=0;$i<4;$i++)w($p,$f,$o,$j,$i);}

Ungolfed, documented code
Below is the documented, original code. To keep my sanity, I worked with the full source code, and wrote a simple minifier script to strip statements like assert() and error_reporting(), remove unnecessary brackets, rename variables, functions and constants to generate the golfed code above.
<?php
error_reporting(E_ALL) ;

// Width of each line of pizza shape.
// Constant will be reduced to single character by minifier,
// so the extra cost of the define() will be gained back.
define('WIDTH', 98) ;

// Read number of slices
$nrSlices = fgets(STDIN) ;

// Read pizza shape definition and
// convert to individual $positionList[]=$y*width+$x and
// linear (1D) $pizzaShape[$y*WIDTH+$x] with protective border around it.
//
// WARNING: assumes maximum pizza width of WIDTH-2 characters!
$positionList = array() ;
$pizzaShape = $headerFooter = str_pad('', WIDTH, '+') ;
$y = 0 ;
while ($line = fgets(STDIN))
{  $line = rtrim($line) ;
   assert(strlen($line) <= WIDTH-2) ;
   $y++ ;
   $pizzaShape .= '+'.str_pad(rtrim($line), WIDTH-2, ' ').'+' ;
   for ($x = 0 ; $x < strlen($line) ; $x++)
   {  if ($line[$x] == '#') $positionList[] = $y*WIDTH + $x+1 ;
   }
}
$pizzaShape .= $headerFooter ;

// Determine size of a slice
$sliceSize = count($positionList)/$nrSlices ;

// Build all possible slice shapes. All shapes start with their first part at
// the top of the pizza, and "grow" new parts in all directions next to the
// existing parts. This continues until the slice has the full size. This way
// we end up with all shapes that fit at the top of the pizza.
//
// The shape is defined as the offsets of the parts relative to the base
// position at the top of the pizza. Offsets are defined as linear offsets in
// the 1-D $pizzaShape string.
//
// For efficiency, we keep track of all four possible rotations while building
// the slice shape.
//
growSlice(reset($positionList), array(array()), 0, 0, 0, 0) ;
die('No pizza for you!') ;

function growSlice($basePosition, $shapeDeltas, $dx, $dy, $prevDx, $prevDy)
{  global $sliceSize, $pizzaShape, $positionList ;

   // Check validity of new position
   // Abort if position is not part of pizza, or
   // if position is already part of slice
   $delta = $dy*WIDTH + $dx ;
   if (!in_array($basePosition+$delta, $positionList)) return ;
   if (in_array($delta, $shapeDeltas[0])) return ;

   // Add all four rotations to shapeDeltas[]
   $shapeDeltas[0][] = $delta ;
   $shapeDeltas[1][] = $dx*WIDTH - $dy ;
   $shapeDeltas[2][] = -$dy*WIDTH - $dx ;
   $shapeDeltas[3][] = -$dx*WIDTH + $dy ;

   // Have we built a full slice shape?
   if (count($shapeDeltas[0]) < $sliceSize)
   {  // Grow shape either at current position or at previous position
      do
      {  growSlice($basePosition, $shapeDeltas, $dx+1, $dy,   $dx, $dy) ;
         growSlice($basePosition, $shapeDeltas, $dx,   $dy+1, $dx, $dy) ;
         growSlice($basePosition, $shapeDeltas, $dx-1, $dy,   $dx, $dy) ;
         growSlice($basePosition, $shapeDeltas, $dx,   $dy-1, $dx, $dy) ;
         $retry = ($dx != $prevDx || $dy != $prevDy) ;
         $dx = $prevDx ;
         $dy = $prevDy ;
      } while ($retry) ;
   } else
   {  // Try to cover the entire pizza by translated and rotated instances of
      // the slice shape.
      fitSlice($shapeDeltas, $pizzaShape, 0, reset($positionList), 0) ;
   }
}

function fitSlice(&$shape, $pizza, $id, $basePosition, $rotation)
{  global $nrSlices, $positionList ;

   // Try to fit each part of the slice onto the pizza. If the part falls
   // outsize the pizza, or overlays another slice we reject this position
   // and rotation. If it fits, we mark the $pizza[] with the slice $id.
   foreach ($shape[$rotation] as $delta)
   {  $position = $basePosition + $delta ;
      if (!isset($pizza[$position]) || $pizza[$position] != '#') return ;
      $pizza[$position] = chr(ord('0')+$id) ;
   }

   // If $nrSlices slices have been fitted, we have found a valid solution!
   // In that case, we display the solution and quit.
   if (++$id == $nrSlices)
   {  for ($pos = WIDTH ; $pos < strlen($pizza)-WIDTH ; $pos++)
      {  if ($pos % WIDTH == WIDTH-1) echo PHP_EOL ;
         else if ($pos % WIDTH) echo $pizza[$pos] ;
      }
      exit ;
   }

   // The current slice did fit, but we have still more slices to fit.
   // Try all positions and rotations for the next slice.
   foreach ($positionList as $position)
   {  for ($rotation = 0 ; $rotation < 4 ; $rotation++)
      {  fitSlice($shape, $pizza, $id, $position, $rotation) ;
      }
   }
}

I'm getting "PHP Fatal error:  Cannot redeclare _() in pizza.php on line 1"

@aditsu: there is only one function _() in the golfed version. Did you accidently copy-paste the code twice?

The file size is 972 so I don't think the code could fit twice. The ungolfed code seems to work btw :)

I noticed you have define('_',98), doesn't that conflict with function _? I don't know php so I can't tell...

@aditsu: The golfed code works fine on my Mac with PHP 5.4.43, but it appears _() is an alias for gettext() on other platforms. Changed minifier to avoid _() altogether.

Seems to work now :)


text:
Goodness, it's covered in tabs!
Space indentation users, unite! We must fight against all the lowly tab users!
Your mission (should you choose to accept it) is to write a program or function that takes in two arguments:

A string: This is the input.
A positive integer: This the number of spaces per tab.

You must go through every line of the string and replace every tab used for indentation with the given number of spaces, and every tab not used for indentation (e.g. in the middle of a line) with one space.
Note that lines such as \t \tabc are undefined behavior; they were inserted by the evil tab users to complicate your programs.
According to the Tabs Must Die Society, your program must be as short as possible to avoid detection by the evil tab users.
Example
\t is used to represent tabs here.
Input string:
a
\t\tb\tc
d

Input number:
4

Output:
a
        b c
d

The middle line was indented by 8 spaces, 4 per tab (since the given number was 4).
Input string:
\ta\t\tb

Input number:
4

Output:
    a  b

NOTE: This is not a duplicate of the tab expansion challenge; it requires a very different input format and slightly different requirements.

The given output only has 4 spaces instead of 8. Typo?

@CONORO'BRIEN Yep. Fixed.

Can input number be unary for retina ?

Yes, as long as the question doesn't explicitly ask for decimal numbers (which it doesn't).

As said a long time ago on some deleted comments, on one of my questions, different input doesn't make enough difference. The answers on the other question can be slightly modified to work on this one. I'm sorry, but I'm voting to close this one as duplicate. Like or hate it.

possible duplicate of Expand tabs (implement expand(1))

Suggested alternate title: My God, it's full of tabs!

Can we assume that the input contains only printable ASCII, tabs and newlines?

@Dennis Sure!!!

Proposed test case: \ta\t\tb, 4 (my previous revision was failing that one)

Can a line only consists of tabs? Or is this an invalid input?

Does the input string contain actual \t (two characters), or the ASCII code 9 (horizontal tab), or at our convenience?

@IsmaelMiguel This is very different from that challenge. The linked challenge involves calculating tabstops; this is simply "tab = 4 spaces."

@Doorknob Did the rules changed?

@LuisMendo The literal ASCII code 9.

@Jakube That's valid input.

How come in the first test case, the output of the second line is (8 spaces)b c and not (8 spaces)b    c (since "b" and "c" had a tab in between them?)

@ASCIIThenANSI If you mean why there weren't 4 spaces in between b and c, that's because the rules say tabs that aren't indentation are always replaced by 1 space.

@kirbyfan64sos Such a strange rule, since that's not how tabs work. They should be replaced by a number of spaces such that the first character after the tabs lands on a multiple of the input number.

@mbomb007 But then this challenge would be too similar to the other tabstop one. Besides, I'm thinking of the scenarios like the way Plan 9 uses tabs (#ifdef\tX instead of #ifdef X).

@kirbyfan64sos What should the result be in this example: \t \tHello? Should the second tab be replaced with a single space?

@mbomb007 I would say no, since that's technically indentation, but then I'd probably invalidate half the answers here, so I'll count is as "undefined behavior". :)

-1 because tab indentation is better :P (no downvote was actually made)

@JamesSmith The words -1 because are all that appeared in my Stack Exchange Android notifications, so I had momentarily freaked out. :)

We need an answer in Whitespace.

This is truly evil.

2 space indent master race

CJam, 30 24 23 bytes
q{_9=NA=Seasi*' ?@?:N}/

I usually refuse to post malicious code on the internet…
This is a full program that reads the string from STDIN and the number as a command-line argument.
Try it online in the CJam interpreter.
How it works
q                        Read all input from STDIN.
 {                   }/  For each character C in the input:
  _9=                      Push 1 if C is a tab and 0 otherwise.
     NA=                   See below.
        Seasi*             Push a string of W spaces, where W is the integer from
                           the command-line arguments.
              '            Push a spaces character.
                ?          Select the string if NA= pushed a truthy value, the
                           single space otherwise.
                 @         Rotate C on top of the stack.
                  ?        Select the string of spaces or the single space if _9=
                           pushed 1, the character C otherwise.
                   :N      Save the result in N.

What NA= does:

For the first character, N will contain its default value, i.e., the string "\n".
For all subsequent characters, N will contain the result of the last iteration, i.e., the last character from input, a space character or a string of one or more spaces.
If N is a string, NA= selects the element at index 10 of N (wrapping around). The result will be a space or a linefeed character. Both are truthy.
If N is a character, NA= pushes 1 for a linefeed and 0 otherwise.
Because of the above, NA= will push a truthy value for the first character, a character preceded by a linefeed or a character preceded by a string of spaces (indentation that has already been replaced).
In all other cases (including a tabulator that has been replace by a space character), NA= will push a falsy value.

Good thing you're doing the Internet a service by removing malicious tabs. ;)

K5, 53 45 bytes
{{,/(b+a&~b:x*&\a:9=y){$[x;x#" ";y]}'y}[x]'y}

In action:
  {{,/(b+a&~b:x*&\a:9=y){$[x;x#" ";y]}'y}[x]'y}[4;(,"a";"\t\tb\tc";,"d")]
(,"a"
 "        b c"
 ,"d")

I just want the record to show that this question is morally reprehensible.

-21346106841 for ... this question is morally reprehensible.

This needs to end up the top voted answer, simply so people will see the footnote.

You can return the result instead of printing it for 3 bytes.

@kirbyfan64sos: I'm printing the result to avoid needing to join the lines. If I can accept and return the result as a list of strings, one for each line, I could save \0:and"\n"\`.

@JohnE I didn't put a rule saying you can't, so I'm guessing you can. :)

oK, then- the alternative IO format saves 8 bytes.

Perl, 23 bytes
22 bytes code + 1 bytes command line
Hopefully not too cheeky to assume the numeric input can be given via the -i parameter! Ensure to replace \t in the below code with the actual tab character.
s/\G\t/$"x$^I/ge;y/\t/ /

Usage example:
printf "a\n\t\tb\tc\nd" | perl -p entry.pl -i4

Or for convenience:
printf "a\n\t\tb\tc\nd" | perl -pe 's/\G\t/$"x$^I/ge;y/\t/ /' -i4

Explanation:
Using the -p argument will execute the program for every line in the input, then print the result at the end.
In the above example, the regex substitution replaces \G\t with " "x4 (a space repeated four times). \G is a little-known regex construct which matches either the position of first match if the first iteration, or from the position of the previous match if not the first iteration, meaning it will only replace all tabs at the start of the string, and will do so one-by-one. The y/\t/ / simply replaces all remaining tabs with spaces.

Julia, 69 59 bytes
f(s,n)=(r=replace)(r(s,r"^\t*"m,i->" "^endof(i)n),"\t"," ")

Ungolfed:
function f(s::String, n::Int)
    # Replace the leading indentation tabs
    r1 = replace(s, r"^\t*"m, i -> " "^endof(i)n)

    # Replace any remaining tabs between words
    r2 = replace(r1, r"\t", " ")

    # Return
    r2
end

Saved 10 bytes and fixed an issue thanks to Glen O!

Is there any benefit to replacing the leading indentation tabs separately? It seems to me that it should be handled directly by the "remaining tabs" part. Also, your "replace the tabs between text" part will only match a single tab, what if you have "hello\t\t1"?

If we assume all indentation is done with tabs (no "\t \t" situations), you could do this: f(s,n)=(r=replace)(r(s,r"^\t*"m,i->" "^endof(i)n),"\t"," "), which uses a replacement function and will catch all of the indentation tabs in one hit.

@GlenO Wow, that's really genius. Thanks so much!

I noticed my answer got downvoted. Is there anything I've done wrong? I'd be happy to address any issues.

I don't see any issue. Maybe it's just one of those vindictive types that downvote because they don't like a language, or things like that? I can't see any flaws.

Mathematica, 42 37 bytes
Thanks to @LegionMammal978 for multiple code-saving suggestions.
The first parameter, # is for the input text, the second parameter, #2, for the number of spaces per tab.
StringReplace[#,"\t"->" "~Table~{#2}]&

Also, you can change Table[" ",{#2}] to " "~Table~{#2} to save a byte. Why are you StringJoining the empty string onto it?

Haskell, 82 bytes
n!('\t':x)=([1..n]>>" ")++n!x
n!x=f<$>x
f '\t'=' '
f x=x
g n=unlines.map(n!).lines

Then g 3 "a\n\t\tb\tc\nd" does the thing.

Some late competition

CoffeeScript, 72 bytes
(s,n)->s.replace(/^\t+/mg,(m)->" ".repeat(m.length*n)).replace /\t/g," "

(Trying to golf it at least 2 more bites, so it will beat the ES6 solution... Help appreciated :D)
Usage:
f=(s,n)->s.replace(/^\t+/mg,(m)->" ".repeat(m.length*n)).replace /\t/g," "
str="""
My nice\tString
\tIndent <--
\t\tDouble
""" #\t is recognized as tab by CS
alert(f(str,4))

Retina, 42 bytes
All occurrences of . are spaces, all \t are literal tabs (1 byte), and <empty> represents a blank file. It's just for readability. I'm also not entirely sure that I'm doing the loop correctly, but I think so. Each line should be placed in its own file. I've added 1 byte for each additional file.
Input is assumed to be in Unary on its own line at the end of the input.
(1*)$
_$1
m+`(?<!^|\t)\t
.
(`1$
<empty>
)`\t
\t.
\t|_
<empty>

Explanation
I add a _ before the Unary input to delimit it during replacement, so that I don't remove any trailing ones from the input string. Then, I replace all tabs not at the beginning of a line with a single space. Then, I loop, removing a single 1 and adding a single space after each tab, until I run out of input. Finally, I clean up by removing the tabs and underscore.

Python, 72 68 bytes
Tabs are literal tabs (1 byte), so r'...' is not needed. Unfortunately, Python requires "fixed-width" look-behinds / look-aheads, so I can't use (?<!^|\t). Uses pretty much the same method as my Retina solution.
import re
lambda s,n:re.sub('\t',' '*n,re.sub('(?<!^)(?<!\t)\t',' ',s))

This doesn't seem to work when a line has two leading tabs, nor does it work for most leading tabs or tabs in between letters..

Ruby 49 bytes
def r s,t;s.gsub! /^\t/,' '*t;s.gsub!"\t",' ';end

This doesn't work if there are two tabs at the beginning of a line.

JavaScript (ES6), 70
Using template strings, the newline is significant and counted

(s,n,r=n)=>[...s].map(c=>c<`
`?` `.repeat(r):(r=c<` `?n:1,c)).join``

Test running the snippet below in Firefox.

F=(s,n,r=n)=>[...s].map(c=>c<`
`?` `.repeat(r):(r=c<` `?n:1,c)).join``

// TEST
out=x=>O.innerHTML+=x+'\n\n'

out('Input: "A\\n\\t\\tB\\tC\\nD" 4\nOutput:\n'+F('A\n\t\tB\tC\nD',4))

out('Input: "\\tA\\t\\tB" 4\nOutput:\n'+F('\tA\t\tB', 4))

Wow one downvote! Could be someone who can't read or understand 'Test in Firefox' ?

I suspect language bias. Julia and CJam got downvotes as well.

Stax, 20 bytes
ÜR╧█╧╫≡eX,)~σOÜ¢G╩N‼

Run and debug it
This program reads the first line as the indent width, and the rest of the input as the program.

Japt v2.0a0, 17 bytes
r/^\t+/m_çVçÃr\tS

Try it

Haskell, 75 bytes
s#m|let('\t':r)#n=(' '<$[1..n])++r#n;(x:r)#n=x:r#(m^sum[1|x<' ']);e#_=e=s#m

Try it online! This assumes the input contains only printable chars as well as tabs and newlines, as allowed by OP in the comments.
Explanation:
The outer # function takes a string s and a number m and calls the inner locally defined # function with the same arguments. This is done to keep track of the original m value, as the inner # function changes the number:

('\t':r)#n=(' '<$[1..n])++r#n If you encounter a tab, replace it by n spaces and leave n unchanged.
(x:r)#n=x:r#(m^sum[1|x<' ']) If some x which is not a tab is encountered, keep it as is but set n to the original number m if x is a newline and to 1 otherwise. This is done by m^sum[1|x<' ']: m is taken to the power of sum[1|x<' '] which evaluates to 1 when x is smaller than a space (i.e. a newline), so we get m^1 = m. Otherwise it's 0 and we have m^0 = 1.

Java 11, 134 bytes
n->s->{var r="";for(var p:s.split("\n")){for(;p.charAt(0)==9;p=p.substring(1))r+=" ".repeat(n);r+=p+"\n";}return r.replace('\t',' ');}

Try it online.
NOTE: Java 11 isn't on TIO yet, so " ".repeat(n) has been emulated as repeat(" ",n) instead (with the same byte-count).
Explanation:
n->s->{                 // Method with integer & String parameters and String return-type
  var r="";             //  Result-String, starting empty
  for(var p:s.split("\n")){
                        //  Loop over the rows (split by new-lines)
    for(;p.charAt(0)==9;//   Inner loop as long as the current row starts with a tab
       p=p.substring(1))//     After every iteration: remove the first character (tab)
      r+=" ".repeat(n); //    Append `n` amount of spaces to the result-String
    r+=p+"\n";}         //   Append the rest of the row with a newline to the result
  return r.replace('\t',' ');}
                        //   Replace any remaining tabs with a space, and return the result


text:
A Program that Prints Programs
Challenge
Your goal is to write a program that prints another program.
That printed program should print another program, and the new program should print another program, until the end.
Rules

Each program must less than 256 bytes. (If this needs to be changed, leave a comment)
The last program must be an empty program.
There must be a finite number of programs, so the program cannot be a quine.
The programs must all run in the same language.
No input is allowed.
The winning program is the program that prints as many programs as possible, counting itself.

Good Luck!

The maximum score is 2^2048, or 3.2317e616.

For making it easier to compare big scores, please include an approximation to your score in the form a*10^b where 1<=a<10 and b is a natural number.

Actually, my previous calculation was wrong. Assuming the program must be in bytes the maximum possible score is  or 1.2673e614.

CJam, 4.56 × 10526 programs
2D#2b{"\256b_(256b:c'\s`_:(er`":T~{;38'ÿ*`{:T~{;63'ÿ*`{:T~{;88'ÿ*`{:T~{;114'ÿ*`{:T~{;140'ÿ*`{:T~{;166'ÿ*`{:T~{;192'ÿ*`{:T~{;219'ÿ*`{Q?\"_~"}s(\T}?\"_~"}s(\T`}?\"_~"}s(\T`}?\"_~"}s(\T`}?\"_~"}s(\T`}?\"_~"}s(\T`}?\"_~"}s(\T`}?\"_~"}s(\T`}?\"_~"}_~

Exact score: 254219 + 254192 + 254166 + 254140 + 254114 + 25488 + 25463 + 25438 + 25413 + 3
All programs have to be saved using the ISO-8859-1 encoding to comply with the file size limit.
Thanks to @ChrisDrost who pointed out a bug and suggested the nesting approach.
Try it online in the CJam interpreter.
254219 + 2 ≈ 4.56 × 10526 programs
The line share of the score can be achieved by the following, much simpler program1.
"ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
{\256b_(256b:c'\s`_:(er`Q?\"_~"}_~

Running this program produces the program
"ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ"
{\256b_(256b:c'\s`_:(er`Q?\"_~"}_~

and after 254219 - 1 more iterations, the program
{\256b_(256b:c'\s`_:(er`Q?\"_~"}_~

This last non-empty program exits with an error2 and prints nothing (the empty program).
How it works
Assume the string is already on the stack.
{      e# Push a code block.
  \    e# Swap the string on top of the code block.
       e# This will cause a runtime error if there is no string on the stack.
  256b e# Convert the string (treated as a base-256 number) to integer (I).
  _(   e# Copy the integer and decrement the copy.
  256b e# Convert the integer into the array of its base-256 digits.
  :c   e# Cast each base-256 digit to character. Converts from array to string.
  '\s  e# Push a string that contains a single backslash.
  `    e# Push its string representation, i.e., the array ['" '\ '\ '"].
  _:(  e# Push a copy and decrement each character. Pushes ['! '[ '[ '!].
  er   e# Perform transliteration to replace "s with !s and \s with [s.
       e# This skips characters that require escaping.
  `    e# Push its string representation, i.e., surround it with double quotes.
  Q    e# Push an empty string.
  ?    e# Select the first string if I is non-zero, the empty string otherwise.
  \    e# Swap the selected string with the code block.
  "_~" e# Push that string on the stack.
}      e#
_~     e# Push a copy of the code block and execute it.
       e# The stack now contains the modified string, the original code block
       e# and the string "_~", producing an almost exact copy of the source.

254192 ≈ 5.35 × 10461 more programs
This is where things get a little crazy.
The first program is highly compressible. By writing a similar program that, instead of the empty program, eventually produces the first program from the above section, we can improve the score by 254192 programs3.
The program
"ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
{"\256b_(256b:c'\s`_:(er`":T~{;219'ÿ*`{Q?\"_~"}s(\T}?\"_~"}_~

is similar to the first program of the previous section, and running the former and its output for 254192 iterations produces the latter.
Assume the string is already on the stack:
{                           e# Push a code block.
  "\256b_(256b:c'\s`_:(er`" e# Push that string on the stack.
                            e# The characters inside it behave exactly as
                            e# they did in the previous section.
  :T~                       e# Save the string in T and evaluate it.
  {                         e# If the integer I is non-zero, keep the generated
                            e# string; else:
    ;                       e#   Pop the code block from the stack.
    219'ÿ*`                 e#   Push a string of 219 ÿ's (with double quotes).
    {Q?\"_~"}               e#   Push that block on the stack.
    s                       e#   Push its string representation.
    (\                      e#   Shift out the { and swap it with the tail.
    T                       e#   Push T.
  }?                        e#
  \                         e# Swap the selected string with the code block
                            e# or T with the tail of the code block.
  "_~"                      e# Push that string on the stack.
}                           e#
_~                          e# Push a copy of the code block and execute it.

Moar programs
The first program of the previous section is still highly compressible, so we can apply a similar method and write a program that, after 254166 iterations, produces the aforementioned program.
Repeating this technique over and over again until we hit the 255 byte limit, we can add a total of 254166 + 254140 + 254114 + 25488 + 25463 + 25438 + 25413 + 1 ≈ 1.59 × 10399 programs to those of the previous sections.

1 Newline added for clarity.
2 Per consensus on Meta, this is allowed by default.
3 or 0.0000000000000000000000000000000000000000000000000000000000000012 %

Let us continue this discussion in chat.

JavaScript, 1000 programs
x=999;
q=";alert(x=999?`q=${JSON.stringify(q)+q}`.split(x).join(x-1):``)";
alert(
    x ? `x=999;q=${JSON.stringify(q)+q}`.split(x).join(x-1) // basically .replaceAll(x, x-1)
      : ``
)

Whether this is valid depends on precisely how to understand the third rule.

It isn't technically a quine, since it prints out a modified version of its own source code rather than an identical copy. It does use quine-like techniques, obviously. I think we'll need clarification from @TheTurtle.

@JohnE and Ypnypn This is something like I envisioned. This works.

You still are well below the code length limit. Why don't you change 999 to something bigger?

Python 2, 9.7*10^229 programs
O=0
if len(hex(O))<191:print"O=0x%x"%(O+1)+open(__file__).read()[-68:]

Nice, didn't think of string repetition!

Ruby, 1.628 × 10^237 programs
a=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;_="a=%#x-1;_=%p;puts _%%[a,_]if a";puts _%[a,_]if a

Same approach as my Perl answer, but because Ruby handles big ints already, it's easier to store as hex.

Ruby, 9.277 × 10^90 programs
a=0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;b=0xf;(b<1)&&(a-=1)&&b=eval('0x'+'f'*(74-("%x"%a).length));_="a=%#x;b=%#x;(b<1)&&(a-=1)&&b=eval('0x'+'f'*(74-('%%x'%%a).length));_=%p;puts _%%[a,b-1,_]if a";puts _%[a,b-1,_]if a

So this attempt is a slightly different variation on the previous quine-like, but because of all the extra functions I'm not getting the number anywhere near as high as the other one... Was interesting to try another approach though!

C, 2.2 * 10^177 programs
#define S(s)char*q=#s,n[]="#####################################################################################################";i;s
S(main(){while(n[i]==91)n[i++]=35;i==101?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})

It's not perfect, but pretty good. I mean it's exactly 255 bytes long and generates programs of the same length. You could probably fiddle arround some more to gain some more programs, but I'll leave it as it is for now.
The program is based of a simple C quine. Additionally there's a quite simple counting algorithm which counts through all possible values of the char array n. We have as many programs as permutations of the string n.
The char range is limmited to a range from # (=35) to [ = (91). That's because I don't want any " or \ in the string, because they need to be escaped.
The program generation ends when all values in the char array n are [. Then it outputs a simple dummy program main(){}, which itself outputs nothing.
#define  S(s) char *q = #s; /* have the source as a string */ \
char n[] = "#####################################################################################################"; \
int i; \
s /* the source itself */
S(main() {
    while(n[i]=='[') /* clear out highest value, so next array element be incremented */
        n[i++]='#';
    i==101 /* end of array reached? output dummy program */
        ? q = "main(){}"
        : n[i]++; /* count one up in the whole array */
    printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)", n, q);
})

As a demonstration that it should work I just changed the limits, so only characters between ASCII-Code 35 and 36 are used and only 4 array elements.
The resulting programs are
% echo > delim; find -iname 'program_*.c' | xargs -n1 cat delim

#define S(s)char*q=#s,n[]="####";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$###";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="#$##";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$$##";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="##$#";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$#$#";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="#$$#";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$$$#";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="###$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$##$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="#$#$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$$#$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="##$$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$#$$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="#$$$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="$$$$";i;s
S(main(){while(n[i]==36)n[i++]=35;i==4?q="main(){}":n[i]++;printf("#define S(s)char*q=#s,n[]=\"%s\";i;s\nS(%s)",n,q);})
#define S(s)char*q=#s,n[]="####";i;s
S(main(){})

This outputs 2^4 + 1 = 17 different programs.
So the program above outputs ((91-35)+1)^101 + 1 = 57^101 + 1 ~= 2.2 * 10^177 different programs.
I'm not entierly sure if this counts, or if my calculation is even correct

Could you please include that this is about  2.2 * 10^177 (for those who want to compare)?

Didn't know how to calculate this one, but I included it ;-)

wolframalpha.com =)

Python, 1 × 10^194 programs
n=99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
if n:print open(__file__).read().replace(str(n),str(n-1))

This must be run from a file, not an interactive repl.
It is not a quine.
Thanks to @The Turtle for helping me save 3 bytes, which is more room for nines!
Thanks to @poke for helping me save 2 bytes, which is more room for nines!

@ Cheese Lover The if n!=0 is redundant. You can just write if n.

You can get rid of two spaces too; after the if n: and between the replace arguments.

Perl, 1 × 10^163
Otherwise this is a pretty basic quine, shrunk down to as few chars as possible, that only runs whilst the counter isn't 0.
use bigint;$i=9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999||die;$_=<<'e';eval
print"use bigint;\$i=$i-1||die;\$_=<<'e';eval
${_}e
"
e

Common Lisp, 10113-1
(LET ((X
       99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999))
  (WHEN #1=(PLUSP X)
    #2=(SETF *PRINT-CIRCLE* T)
    #3=(PRINT (LIST 'LET `((X ,(1- X))) (LIST 'WHEN '#1# '#2# '#3#)))))

There are 113 nines.
The next program has 112 nines followed by a 8
The next program has 112 nines followed by a 7
...

The number of nines is limited by the maximum size of code, 256, taking into account the spaces introduced by the printer.

Perl, 1.4*10^225
use bignum;open$F,__FILE__;$_=<$F>;s/0x\w+/($&-1)->as_hex/e;0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff&&print

Similar approach to python; same result!

><>, 65534 (?) Programs
I've added a question mark next to 65533 since I have yet to verify that it can print 65533 (although I have reason to believe it should). Once I have a bit more time, I'm going to figure out a way to test it.
":?!;1-r00gol?!;a0.�

You can try it online here.
The gist of this program is that it changes the output of the character at the very end and then decrements its numerical value before printing. I got 65534 programs because the ascii value of the character at the end of the code is 65533, so counting the first program we have 65534 (if you count the empty program 65535, I guess). The last program "returned" is nothing; it simply ends when the character value is 0.
I'm quite sure it will be able to print a character for all iterations: I couldn't find a definitive source for how many characters ><> can print, but there are characters directly below 65533, numerically.
Let me know if there are any problems with this implementation; I'm a little unsure about the validity of my entry.

Explanation
I have shamelessly stolen the idea of using a single quotation mark to create a pseudo-quine from the ><> wiki and a comment I saw here once.
":?!;1-r00gol?!;a0.�
"                     begins string parsing
 :?!;                 terminates program if final character is 0, numerically
     1-               decrements final character by 1
       r              reverses stack
        00g           grabs quotation mark (fancy way of putting " ")
           ol?!;      prints and terminates if stack is empty
                a0.   jumps back to o to loop

What it does is parse everything after the quotation mark as characters, then decrement the last one. From there it just reverses the stack (so as to print in the right order), pushes a quotation mark onto the stack, and then prints until the stack is empty.

Bash, 52 programs
Utterly uninspired, and (hopefully) solidly in last place.
echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo


text:
Animations with all colours
Last year, there was a very popular challenge to create an image containing every 24-bit RGB colour.
My challenge is to create a smooth animation (24 frames/s say), where the colour of every pixel of every frame is unique.  I will also allow duplication of colours as long as every colour appears the same number of times (greater than 0), since otherwise the animation will have to be short, or the frames small.
I have produced some examples here, based on the winning solution to the 2d version.  Unfortunately, it seems you can't embed videos, so links will have to do.

Someone already did an animation in this answer from the linked question. I'm not sure if it meets the criteria, though.

Bit more technical specs would be nice. What does "create" mean? Render a video to disc? Display a realtime animation?

You could use a gif...

@wizzwizz4 a GIF cannot hold more than 256 colors; so you can make a 16x16 image with different colors for every pixel - and have no room left for animation.

Mathematica
This is a straightforward implementation with each rgb colour occupying an intersection in a 256 by 256 by 256 unit grid.
The jerkiness seems to be an artefact of the video, not an error in the data, which should be exact.
red values increase downwards, green values increase rightwards, and blue values increase by frame.
Perhaps I'll jumble things up later.
f@b_ := Image@Table[{r, g, b}/255, {r, 0, 255}, {g, 0, 255}]
Export["c.mov", Table[f@b, {b, 0, 255}]]

QuickTime clip

This is puzzling.  It works for me and the permissions are set for anyone to access it.  Are you able to play other videos at vimeo.com ?

It does work now, for some reason.

glad to hear it.

PHP (+ HTML) + JavaScript
Part 1
generate 256 images with distinct red values from 0 to 255;
green value=row index, blue value=column index
for($r=$h=256;$r--;){$i=imagecreatetruecolor($g=$h,$h);for(;$g--;)for($b=$h;$b--;)imagesetpixel($i,$g,$b,imagecolorallocate($i,$r,$g,$b));imagepng($i,"$r.png");imagedestroy($i);}

Note: Depending on Your PHP implementation, this may throw an internal server error.
If it does, take the lowest number of the images that already have been created, insert <number>, after $r= and run again.
Part 2
loop through these images from 0 to 255 and back (0 and 255 taking 2 frames each)
<img><script>r=d=0;setInterval(()=>{document.images[0].src=r+".png",(d?!r--:(++r)>=256)?r-=(d=!d)?1:-1:r},40);</script>