问:
Print the Greek alphabet!
Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output the Greek alphabet in lowercase.

Information

Greek alphabet (Capitals):  ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

Greek alphabet (Lowercase): αβγδεζηθικλμνξοπρστυφχψω

Rules/Requirements

Each submission must be a full program.

Builtins to print the Greek alphabet are not permitted

Standard loopholes apply

You must print exactly what is shown.

Scoring

Programs are scored according to bytes. If you are using a character set different to UTF-8 please specify. Try to get the least bytes out of everyone, this is code-golf!

Test cases

```<code>./program
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

./program 1
==> αβγδεζηθικλμνξοπρστυφχψω

./program 'lower'
==> αβγδεζηθικλμνξοπρστυφχψω

./program 123897883421
==> αβγδεζηθικλμνξοπρστυφχψω

./program ""
==> αβγδεζηθικλμνξοπρστυφχψω

greek();
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

greek("blah");
==> αβγδεζηθικλμνξοπρστυφχψω

greek(123);
==> αβγδεζηθικλμνξοπρστυφχψω
</code>```

Submissions

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

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:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

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:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 97049; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<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

```

答:
Ruby, 56 bytes

Full program. I don't think a function/lambda answer will be shorter than this for this language.

Dangit, sigma ς. This is why we can't have nice things. And you too, (unrenderable character that serves as a placeholder for "uppercase" ς)

```<code>print *($*[0]?([*?α..?ω]-[?ς]):[*?Α..?Ρ,*?Σ..?Ω])
</code>```

Title: Print the Greek alphabet!

Body:
Ruby, 56 bytes

Full program. I don't think a function/lambda answer will be shorter than this for this language.

Dangit, sigma ς. This is why we can't have nice things. And you too, (unrenderable character that serves as a placeholder for "uppercase" ς)

print *($*[0]?([*?α..?ω]-[?ς]):[*?Α..?Ρ,*?Σ..?Ω])


答:
Actually, 62 bytes

```<code> "$ù"E"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"@ƒ.X
</code>```

Try it online!

Because some of the uppercase Greek alphabet is not present in CP437, this solution is encoded in UTF-8 and scored accordingly. Here is a hexdump (reversible with xxd -r):

```<code>00000000: 2022 24c3 b922 4522 ce91 ce92 ce93 ce94   "$.."E"........
00000010: ce95 ce96 ce97 ce98 ce99 ce9a ce9b ce9c  ................
00000020: ce9d ce9e ce9f cea0 cea1 cea3 cea4 cea5  ................
00000030: cea6 cea7 cea8 cea9 2240 c692 2e58 0a    ........"@...X.
</code>```

Explanation:

```<code> "$ù"E"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"@ƒ.X
<space>                               push the number of items present on the stack
 `$ù`E                                select `ù` (lowercase) if the number of items is not 0, else `$` (stringify - does nothing to a string)
      "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"      push the uppercase Greek alphabet
                                @ƒ    call the selected function
                                  .   print
                                   X  discard
</code>```

ContentLicense: CC BY-SA 3.0

Title: Print the Greek alphabet!

Body:
Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output the Greek alphabet in lowercase.

Information

Greek alphabet (Capitals):  ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

Greek alphabet (Lowercase): αβγδεζηθικλμνξοπρστυφχψω

Rules/Requirements

Each submission must be a full program.

Builtins to print the Greek alphabet are not permitted

Standard loopholes apply

You must print exactly what is shown.

Scoring

Programs are scored according to bytes. If you are using a character set different to UTF-8 please specify. Try to get the least bytes out of everyone, this is code-golf!

Test cases

```<code>./program
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

./program 1
==> αβγδεζηθικλμνξοπρστυφχψω

./program 'lower'
==> αβγδεζηθικλμνξοπρστυφχψω

./program 123897883421
==> αβγδεζηθικλμνξοπρστυφχψω

./program ""
==> αβγδεζηθικλμνξοπρστυφχψω

greek();
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

greek("blah");
==> αβγδεζηθικλμνξοπρστυφχψω

greek(123);
==> αβγδεζηθικλμνξοπρστυφχψω
</code>```

Submissions

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

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:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

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:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 97049; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<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

```

Body:
Actually, 62 bytes

 "$ù"E"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"@ƒ.X

Try it online!

Because some of the uppercase Greek alphabet is not present in CP437, this solution is encoded in UTF-8 and scored accordingly. Here is a hexdump (reversible with xxd -r):

00000000: 2022 24c3 b922 4522 ce91 ce92 ce93 ce94   "$.."E"........
00000010: ce95 ce96 ce97 ce98 ce99 ce9a ce9b ce9c  ................
00000020: ce9d ce9e ce9f cea0 cea1 cea3 cea4 cea5  ................
00000030: cea6 cea7 cea8 cea9 2240 c692 2e58 0a    ........"@...X.

Explanation:

 "$ù"E"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"@ƒ.X
<space>                               push the number of items present on the stack
 `$ù`E                                select `ù` (lowercase) if the number of items is not 0, else `$` (stringify - does nothing to a string)
      "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"      push the uppercase Greek alphabet
                                @ƒ    call the selected function
                                  .   print
                                   X  discard


问:
Print the tetration

Tetration, represented as \${}^ba\$, is repeated exponentiation. For example, \${}^32\$ is \$2^{2^2}\$, which is \$16\$.

Given two numbers \$a\$ and \$b\$, print \${}^ba\$.

Test cases

```<code>1 2 -> 1
2 2 -> 4
5 2 -> 3125
3 3 -> 7625597484987
etc.
</code>```

Scientific notation is acceptable.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

答:
Perl, 19 bytes

Includes +1 for -p

Give numbers on separate lines on STDIN

```<code>tetration.pl
2
3
^D
</code>```

tetration.pl

```<code>#!/usr/bin/perl -p
$_=eval"$_**"x<>.1
</code>```

ContentLicense: CC BY-SA 4.0

Title: Print the tetration

Body:
Perl, 19 bytes

Includes +1 for -p

Give numbers on separate lines on STDIN

tetration.pl
2
3
^D

tetration.pl

#!/usr/bin/perl -p
$_=eval"$_**"x<>.1


问:
Generate a random digit!
Your task is to generate a random digit following these steps:

First, generate 10 random digits to make a binary number, 50% 0, and 50% 1:

```<code>010011001
</code>```

If it is all zeros, generate a new one.

Convert this to decimal:

```<code>153
</code>```

For each digit, write that amount of alternating 0s and 1s (first digit = 1s, second digit = 0s, third digit = 1s, etc.):

```<code>100000111
</code>```

Convert this to decimal:

```<code>263
</code>```

Take the middle digit (If there is an even number of digits, take the left middle)

```<code>6
</code>```

Remember, this is code-golf, so the code with the smallest number of bytes wins.

答:
Perl, <s>62</s> <s>61</s> <s>55</s> 53 bytes

Get the digit distribution through a lookup table. Implementing the original algorithm is about 15 bytes longer.

```<code>perl -E 'say-(map+(--$n)x$_,unpack"W*","\x90leJZaEC_")[rand 1023]'
</code>```

Just the code:

```<code>say-(map+(--$n)x$_,unpack"W*","\x90leJZaEC_")[rand 1023]
</code>```

Works as shown,, but replace \x90 by the literal byte to get the claimed score

Title: Generate a random digit!

Body:
Perl, <s>62</s> <s>61</s> <s>55</s> 53 bytes

Get the digit distribution through a lookup table. Implementing the original algorithm is about 15 bytes longer.

perl -E 'say-(map+(--$n)x$_,unpack"W*","\x90leJZaEC_")[rand 1023]'

Just the code:

say-(map+(--$n)x$_,unpack"W*","\x90leJZaEC_")[rand 1023]

Works as shown,, but replace \x90 by the literal byte to get the claimed score


问:
Output the ALONED numbers
Consider the natural sequence up-to 6 (disregard 1):

```<code>2,3,4,5,6
</code>```

We start scanning from the left (in this case from 2), search for a number divisible by 2 (here 4) and then remove both the numbers from the list (here 2 & 4), such that the list reduces to:

```<code>3,5,6
</code>```

We continue the same process, here leftmost is 3, so we search for number divisible by 3. 6 is surely that number and thus 3 and 6 are removed,

```<code>5
</code>```

Now, no further such searches can be made Thus, this becomes the list of ALONED numbers for n=6.

OBJECTIVE

Given a number n greater than 1, print all the corresponding aloned numbers.

INPUT

```<code>2
6
15
20
22
</code>```

OUTPUT

```<code>2
5
8,9,11,12,13,15
11,12,13,15,17,19,20
12,13,15,17,19,20,21
</code>```

YET ANOTHER WORKED OUT EXAMPLE

For n= 22

```<code>=>2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
=>3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 2 & 4)
=>5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 3 & 6)
=>7,8,9,11,12,13,14,15,16,17,18,19,20,21,22 (remove 5 & 10)
=>8,9,11,12,13,15,16,17,18,19,20,21,22 (remove 7 & 14)
=>9,11,12,13,15,17,18,19,20,21,22 (remove 8 & 16)
=>11,12,13,15,17,19,20,21,22 (remove 9 & 18)
=>12,13,15,17,19,20,21 (remove 11 & 22) (OUTPUT)
</code>```

This is code-golf, so the shortest code in bytes wins.

答:
Javascript, 149 bytes

```<code>function a(n){o=Array.from(Array((n+1)).keys());o.shift();o.shift();for(i=1;i<o.length;i++){if(o[i]%o[0]==0){o.splice(i,1);o.shift();i=0;}}return o;}
</code>```

Here's a working example. All the HTML and the wrapper() function is just so it's actually interactive.

<!DOCTYPE html>

<meta charset="UTF-8">
<title>Aloned</title>

Enter an integer:

<input type="text" id="i" value="5" />

<input type="button" value="Alone It!" onclick="wrapper()" />

```
</div>
</div>
</p>

<p>This ungolfed code snippet has some comments and lets you interactively see the steps for any given input.
<div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html lang="en">
  <head>
<meta charset="UTF-8">
<title>Aloned</title>
<script>
  function wrapper()
  {
    document.getElementById("o").innerHTML = aloned(parseInt(document.getElementById("i").value));
  }
  function aloned(n)
  {
    // From nils peterson's comment on benmcdonald's answer
    // http://stackoverflow.com/questions/3895478
    // Creates an array from 0 to n.
    o=Array.from(Array((n+1)).keys());

    // Remove 0 and 1 from the start of the array.
    o.shift();
    o.shift();

    // s and t are just used to display the output each iteration.
    var s = String(o);

    // Go through every item in the array (except the first).
    for(i = 1; i < o.length; i++)
    {
      // Check for an item evenly divisible by the first item.
      if (o[i]%o[0]==0)
      {
        var t=" (remove "+o[0]+" and "+o[i]+")";

        // Splice removes the current item, shift removes the first item.
        o.splice(i,1);
        o.shift();

        // Reset the array, so we're looping from the beginning again.
        i=0;

        s = s + "<br />" + String(o) + t;
      }
    }
    return s + " (OUTPUT)";
  }
</script>
  </head>
  <body>
<p>Enter an integer:</p>
<p><input type="text" id="i" value="5" /></p>
<p><input type="button" value="Alone It!" onclick="wrapper()" /></p>
<div id="o"></div>
  </body>
</html></code>```

Title: Output the ALONED numbers

Body:
Javascript, 149 bytes

function a(n){o=Array.from(Array((n+1)).keys());o.shift();o.shift();for(i=1;i<o.length;i++){if(o[i]%o[0]==0){o.splice(i,1);o.shift();i=0;}}return o;}

Here's a working example. All the HTML and the wrapper() function is just so it's actually interactive.

<!DOCTYPE html>
<html lang="en">
  <head>
<meta charset="UTF-8">
<title>Aloned</title>
<script>
  function wrapper(){document.getElementById("o").innerHTML = a(parseInt(document.getElementById("i").value));}
  function a(n){o=Array.from(Array((n+1)).keys());o.shift();o.shift();for(i=1;i<o.length;i++){if(o[i]%o[0]==0){o.splice(i,1);o.shift();i=0;}}return o;}
</script>
  </head>
  <body>
<p>Enter an integer:</p>
<p><input type="text" id="i" value="5" /></p>
<p><input type="button" value="Alone It!" onclick="wrapper()" /></p>
<div id="o"></div>
  </body>
</html>

This ungolfed code snippet has some comments and lets you interactively see the steps for any given input.

<!DOCTYPE html>
<html lang="en">
  <head>
<meta charset="UTF-8">
<title>Aloned</title>
<script>
  function wrapper()
  {
    document.getElementById("o").innerHTML = aloned(parseInt(document.getElementById("i").value));
  }
  function aloned(n)
  {
    // From nils peterson's comment on benmcdonald's answer
    // http://stackoverflow.com/questions/3895478
    // Creates an array from 0 to n.
    o=Array.from(Array((n+1)).keys());

    // Remove 0 and 1 from the start of the array.
    o.shift();
    o.shift();

    // s and t are just used to display the output each iteration.
    var s = String(o);

    // Go through every item in the array (except the first).
    for(i = 1; i < o.length; i++)
    {
      // Check for an item evenly divisible by the first item.
      if (o[i]%o[0]==0)
      {
        var t=" (remove "+o[0]+" and "+o[i]+")";

        // Splice removes the current item, shift removes the first item.
        o.splice(i,1);
        o.shift();

        // Reset the array, so we're looping from the beginning again.
        i=0;

        s = s + "<br />" + String(o) + t;
      }
    }
    return s + " (OUTPUT)";
  }
</script>
  </head>
  <body>
<p>Enter an integer:</p>
<p><input type="text" id="i" value="5" /></p>
<p><input type="button" value="Alone It!" onclick="wrapper()" /></p>
<div id="o"></div>
  </body>
</html>


问:
Does the code terminate?
This is a code golf challenge I thought of with a mathematical bent. The challenge is to write the shortest code possible such that it is an open question whether or not the code terminates. An example of what I mean could be the following piece of python code, adapted from an anwser to this cs stackexchange question.

```<code>def is_perfect(n):
    return sum(i for i in range(1, n) if n % i == 0) == n

n = 3
while not is_perfect(n):
    n = n + 2
</code>```

Mathematicians conjecture that there are no odd perfect numbers, but it has never been proven, so no one knows if this piece of code will ever terminate. Can you come up with other pieces of code (perhaps relying on other open problems like the Collatz conjecture, or the twin primes conjecture) that are shorter, but for which it is unknown whether or not they terminate?

Edit: Some people have brought up a good additional rule - The solutions to the question should be deterministic. Although it might be even more interesting if you could find shorter solutions using nondeterminism. In this case, the rule would be to find a snippet for which the probability of termination is unknown.

答:
Python, 92 bytes

This isn't winning any code golf competitions, and it requires infinite memory and recursion depth, but this is an almost perfect opportunity to plug an interesting problem I asked on math stackexchange two years ago, that no Fibonacci number greater than 8 is the sum of two positive cubes. Funnily enough, it started as an code golf challenge idea, so I guess I've come full circle.

```<code>def f(i,j):
 r=range(i)
 for a in r:
  for b in r:
   if a**3+b**3==i:1/0
 f(j,i+j)
f(13,21)
</code>```

Title: Does the code terminate?

Body:
Python, 92 bytes

This isn't winning any code golf competitions, and it requires infinite memory and recursion depth, but this is an almost perfect opportunity to plug an interesting problem I asked on math stackexchange two years ago, that no Fibonacci number greater than 8 is the sum of two positive cubes. Funnily enough, it started as an code golf challenge idea, so I guess I've come full circle.

def f(i,j):
 r=range(i)
 for a in r:
  for b in r:
   if a**3+b**3==i:1/0
 f(j,i+j)
f(13,21)


问:
A penny saved is a penny

...counted!

You will pass your program a variable which represents a quantity of money in dollars and/or cents and an array of coin values.  Your challenge is to output the number of possible combinations of the given array of coin values that would add up to the amount passed to the code.  If it is not possible with the coins named, the program should return 0.

Note on American numismatic terminology:

1-cent coin: penny

5-cent coin: nickel

10-cent coin: dime

25-cent coin: quarter (quarter dollar)

Example 1:

Program is passed:

```<code>12, [1, 5, 10]
</code>```

(12 cents)

Output:

```<code>4
</code>```

There are 4 possible ways of combining the coins named to produce 12 cents:

12 pennies

1 nickel and 7 pennies

2 nickels and 2 pennies

1 dime and 2 pennies

Example 2:

Program is passed:

```<code>26, [1, 5, 10, 25]
</code>```

(26 cents)

Output:

```<code>13
</code>```

There are 13 possible ways of combining the coins named to produce 26 cents:

26 pennies

21 pennies and 1 nickel

16 pennies and 2 nickels

11 pennies and 3 nickels

6 pennies and 4 nickels

1 penny and 5 nickels

16 pennies and 1 dime

6 pennies and 2 dimes

11 pennies, 1 dime, and 1 nickel

6 pennies, 1 dime, and 2 nickels

1 penny, 1 dime, and 3 nickels

1 penny, 2 dimes, and 1 nickel

1 quarter and 1 penny

Example 3:

Program is passed:

```<code>19, [2, 7, 12]
</code>```

Output:

```<code>2
</code>```

There are 2 possible ways of combining the coins named to produce 19 cents:

1 12-cent coin and 1 7-cent coin

1 7-cent coin and 6 2-cent coins

Example 4:

Program is passed:

```<code>13, [2, 8, 25]
</code>```

Output:

```<code>0
</code>```

There are no possible ways of combining the coins named to produce 13 cents.

This has been through the Sandbox.  Standard loopholes apply.  This is code golf, so the answer with the fewest bytes wins.

答:
Jelly, 15 bytes

```<code>s+\Fṁḷ
2*BW;ç/Ṫ
</code>```

Try it online! or Verify all test cases.

This was more of an exercise in writing an efficient version in Jelly without using builtins. This is based on the typical dynamic programming approach used to calculate the number of ways for making change

Explanation

```<code>s+\Fṁḷ  Helper link. Input: solutions S, coin C
s       Slice the solutions into non-overlapping sublists of length C
 +\     Cumulative sum
   F    Flatten
     ḷ  Left, get S
    ṁ   Mold the sums to the shape of S

2*BW;ç/Ṫ  Main link. Input: target T, denominations D
2*        Compute 2^T
  B       Convert to binary, creates a list with 1 followed by T-1 0's
          These are the number of solutions for each value from 0 to T
          starting with no coins used
   W      Wrap it inside another array
    ;     Concatenate with D
     ç/   Reduce using the helper link
       Ṫ  Tail, return the last value which is the solution
</code>```

Title: A penny saved is a penny

Body:
Jelly, 15 bytes

s+\Fṁḷ
2*BW;ç/Ṫ

Try it online! or Verify all test cases.

This was more of an exercise in writing an efficient version in Jelly without using builtins. This is based on the typical dynamic programming approach used to calculate the number of ways for making change

Explanation

s+\Fṁḷ  Helper link. Input: solutions S, coin C
s       Slice the solutions into non-overlapping sublists of length C
 +\     Cumulative sum
   F    Flatten
     ḷ  Left, get S
    ṁ   Mold the sums to the shape of S

2*BW;ç/Ṫ  Main link. Input: target T, denominations D
2*        Compute 2^T
  B       Convert to binary, creates a list with 1 followed by T-1 0's
          These are the number of solutions for each value from 0 to T
          starting with no coins used
   W      Wrap it inside another array
    ;     Concatenate with D
     ç/   Reduce using the helper link
       Ṫ  Tail, return the last value which is the solution


答:
Actually, 16 bytes

```<code>1`;;pY)▒@D÷íu*`╓
</code>```

Try it online!

This code terminates iff there is some composite number n such that totient(n) divides n-1 (Lehmer's totient problem).

Explanation:

```<code>1`;;pY)▒@D÷íu*`╓
1`            `╓  first integer, starting with 0, where the following function leaves a truthy value on top of the stack:
    pY       *      composite (not prime) and
   ;  )▒            totient(n)
  ;     @D÷íu       is in the list of divisors of n-1
</code>```

Title: Does the code terminate?

Body:
This is a code golf challenge I thought of with a mathematical bent. The challenge is to write the shortest code possible such that it is an open question whether or not the code terminates. An example of what I mean could be the following piece of python code, adapted from an anwser to this cs stackexchange question.

```<code>def is_perfect(n):
    return sum(i for i in range(1, n) if n % i == 0) == n

n = 3
while not is_perfect(n):
    n = n + 2
</code>```

Mathematicians conjecture that there are no odd perfect numbers, but it has never been proven, so no one knows if this piece of code will ever terminate. Can you come up with other pieces of code (perhaps relying on other open problems like the Collatz conjecture, or the twin primes conjecture) that are shorter, but for which it is unknown whether or not they terminate?

Edit: Some people have brought up a good additional rule - The solutions to the question should be deterministic. Although it might be even more interesting if you could find shorter solutions using nondeterminism. In this case, the rule would be to find a snippet for which the probability of termination is unknown.

Body:
Actually, 16 bytes

1`;;pY)▒@D÷íu*`╓

Try it online!

This code terminates iff there is some composite number n such that totient(n) divides n-1 (Lehmer's totient problem).

Explanation:

1`;;pY)▒@D÷íu*`╓
1`            `╓  first integer, starting with 0, where the following function leaves a truthy value on top of the stack:
    pY       *      composite (not prime) and
   ;  )▒            totient(n)
  ;     @D÷íu       is in the list of divisors of n-1


答:
Python 2, 108 bytes

```<code>#coding=iso-8859-7
import sys;print'αβγδεζηθικλμνξοπρστυφχψω'if~-len(sys.argv)else'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ'
</code>```

Terribly golfed, maybe :(

And no, I can't use A.lower().

Thanks to 13285 (alexwlchan) for -11 bytes.

Title: Print the Greek alphabet!

Body:
Python 2, 108 bytes

#coding=iso-8859-7
import sys;print'αβγδεζηθικλμνξοπρστυφχψω'if~-len(sys.argv)else'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ'

Terribly golfed, maybe :(

And no, I can't use A.lower().

Thanks to 13285 (alexwlchan) for -11 bytes.


答:
Racket 191 bytes

```<code>(let loop((fl(range 2(add1 n)))(fg #f))(define i(first fl))(for((j(rest fl))
#:when(= 0(modulo j i))#:final(= 0(modulo j i)))
(set! fl(remove*(list i j)fl))(set! fg #t))(if fg(loop fl #f)fl))
</code>```

Ungolfed (comments after ';'):

```<code>(define (f n)
  (let loop ((fl (range 2 (add1 n)))  ; create a full list of numbers
             (fg #f))                 ; flag to show if main list is modified
    (define i (first fl))
    (for ((j (rest fl)) #:when (= 0 (modulo j i))  ; test divisibility
                        #:final (= 0 (modulo j i)))
      (set! fl (remove* (list i j) fl))  ; remove these from main list
      (set! fg #t))
    (if fg (loop fl #f)              ; if main list modified, check again,
        fl)))                         ; else print modified list.
</code>```

Testing:

```<code>(f 2)
(f 6)
(f 15)
(f 20)
(f 22)
</code>```

Output:

```<code>'(2)
'(5)
'(8 9 11 12 13 15)
'(11 12 13 15 17 19 20)
'(12 13 15 17 19 20 21)
</code>```

Title: Output the ALONED numbers

Body:
Consider the natural sequence up-to 6 (disregard 1):

```<code>2,3,4,5,6
</code>```

We start scanning from the left (in this case from 2), search for a number divisible by 2 (here 4) and then remove both the numbers from the list (here 2 & 4), such that the list reduces to:

```<code>3,5,6
</code>```

We continue the same process, here leftmost is 3, so we search for number divisible by 3. 6 is surely that number and thus 3 and 6 are removed,

```<code>5
</code>```

Now, no further such searches can be made Thus, this becomes the list of ALONED numbers for n=6.

OBJECTIVE

Given a number n greater than 1, print all the corresponding aloned numbers.

INPUT

```<code>2
6
15
20
22
</code>```

OUTPUT

```<code>2
5
8,9,11,12,13,15
11,12,13,15,17,19,20
12,13,15,17,19,20,21
</code>```

YET ANOTHER WORKED OUT EXAMPLE

For n= 22

```<code>=>2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
=>3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 2 & 4)
=>5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 3 & 6)
=>7,8,9,11,12,13,14,15,16,17,18,19,20,21,22 (remove 5 & 10)
=>8,9,11,12,13,15,16,17,18,19,20,21,22 (remove 7 & 14)
=>9,11,12,13,15,17,18,19,20,21,22 (remove 8 & 16)
=>11,12,13,15,17,19,20,21,22 (remove 9 & 18)
=>12,13,15,17,19,20,21 (remove 11 & 22) (OUTPUT)
</code>```

This is code-golf, so the shortest code in bytes wins.

Body:
Racket 191 bytes

(let loop((fl(range 2(add1 n)))(fg #f))(define i(first fl))(for((j(rest fl))
#:when(= 0(modulo j i))#:final(= 0(modulo j i)))
(set! fl(remove*(list i j)fl))(set! fg #t))(if fg(loop fl #f)fl))

Ungolfed (comments after ';'):

(define (f n)
  (let loop ((fl (range 2 (add1 n)))  ; create a full list of numbers
             (fg #f))                 ; flag to show if main list is modified
    (define i (first fl))
    (for ((j (rest fl)) #:when (= 0 (modulo j i))  ; test divisibility
                        #:final (= 0 (modulo j i)))
      (set! fl (remove* (list i j) fl))  ; remove these from main list
      (set! fg #t))
    (if fg (loop fl #f)              ; if main list modified, check again,
        fl)))                         ; else print modified list.

Testing:

(f 2)
(f 6)
(f 15)
(f 20)
(f 22)

Output:

'(2)
'(5)
'(8 9 11 12 13 15)
'(11 12 13 15 17 19 20)
'(12 13 15 17 19 20 21)


答:
05AB1E, 19 bytes

```<code>To<L.RvTNèy×}JC2ä¬¤
</code>```

Try it online!

Explanation

153 used as example

```<code>To<L                  # [1 ... 2^10-1]
                      # STACK: [1 ... 1023]
    .R                # take random number from range
                      # STACK: 153
      v     }         # for each digit
       TNè            # use the digits index in the number to index into 10
          y×          # repeat the number that many times
                      # STACK: 1,00000,111
             J        # join to string
                      # STACK: 100000111
              C       # convert to decimal
                      # STACK: 263
               2ä     # split in 2
                      # STACK: [26,3]
                 ¬¤   # take the last digits of the first part
                      # OUTPUT: 6
</code>```

Title: Generate a random digit!

Body:
Your task is to generate a random digit following these steps:

First, generate 10 random digits to make a binary number, 50% 0, and 50% 1:

```<code>010011001
</code>```

If it is all zeros, generate a new one.

Convert this to decimal:

```<code>153
</code>```

For each digit, write that amount of alternating 0s and 1s (first digit = 1s, second digit = 0s, third digit = 1s, etc.):

```<code>100000111
</code>```

Convert this to decimal:

```<code>263
</code>```

Take the middle digit (If there is an even number of digits, take the left middle)

```<code>6
</code>```

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Body:
05AB1E, 19 bytes

To<L.RvTNèy×}JC2ä¬¤

Try it online!

Explanation

153 used as example

To<L                  # [1 ... 2^10-1]
                      # STACK: [1 ... 1023]
    .R                # take random number from range
                      # STACK: 153
      v     }         # for each digit
       TNè            # use the digits index in the number to index into 10
          y×          # repeat the number that many times
                      # STACK: 1,00000,111
             J        # join to string
                      # STACK: 100000111
              C       # convert to decimal
                      # STACK: 263
               2ä     # split in 2
                      # STACK: [26,3]
                 ¬¤   # take the last digits of the first part
                      # OUTPUT: 6


问:
C# is the Main problem
This programming puzzle is inspired by another question which has been asked here yesterday but which was deleted by the author...

The challenge:

Create an executable binary (Windows .EXE or Linux binary) using Visual C# (or your favorite C# IDE) which prints the following text to the standard output:

```<code>Main() is the main method of C# programs!
</code>```

... without using the 4 consecutive letters M-A-I-N appearing in any source file!

Notes:

If your source code contains the text remainder (for example) it contains the 4 consecutive letters M-A-I-N, however if it contains mxain the 4 letters would not be consecutive any more so mxain would be allowed.

You are not allowed to run any programs but the C# IDE nor change the settings of the C# IDE to run other programs (but the ones it would normally run such as the C# compiler).

Otherwise you could simply say: "I write a Pascal program using the C# IDE and invoke the Pascal compiler in the 'pre-build' steps of my C# project".

This would be too simple.

Users of an IDE that can be extending using "plug-ins" (or similar) or that have built-in binary file editors (hex-editors) would have a too large advantage over users of other C# IDEs.

Therefore these featrues should also not be used.

Using the other non-ASCII-Editors (such as the dialog window editor) is explicitly allowed!

The user asking the original question proposed using the backslash in function names just like this: static void M\u0061in() Because this answer has already been read by other users it will not be accepted any more!

A user asked if it would be allowed to simply type in an .EXE file into the source code editor and to save the file as ".exe" instead of ".cs". Answer: I doub't that this is possible because both valid Windows and Linux binaries contain NUL bytes. However if you find a valid binary that can be created this way you have a valid solution.

The name of this site is "Programming Puzzles & Code Golf" - this is a "Programming Puzzle", not "Code Golf": The challenge is to find a working solution before all other users, not to find a solution shorter than all other solutions.

Therefore the first post describing a working solution wins!

Good luck!

By the way: I have a solution working under Visual C# Express 2010.

答:
Just as a reference

My idea was similar to "milk"'s second idea:

Find a way to let the IDE execute code and write an executable to the disk.

I explicitly mentioned Windows and Linux binaries because I thought about writing the binary .EXE file using System.IO.File.WriteAllBytes() so it would not neccessarily be a .NET EXE file.

My problem was that VS Express 2010 seems not to have an interactive console so I had to find a replacement for that - I found the following:

Create a DLL project with a dialog window and a custom control; compile the project and add the custom control to the dialog window. The dialog window editor will then call the code of the custom control - and in this code you may write the .EXE file to the disk...

Title: C# is the Main problem


答:
05AB1E, 8 bytes

Will terminate when the 6th Fermat prime is found.

```<code>5µNoo>p½
</code>```

Explanation

```<code>5µ          # loop over increasing N (starting at 1) until counter reaches 5
  Noo       # 2^2^N
     >      # + 1
      p½    # if prime, increase counter
</code>```

Title: Does the code terminate?

Body:
05AB1E, 8 bytes

Will terminate when the 6th Fermat prime is found.

5µNoo>p½

Explanation

5µ          # loop over increasing N (starting at 1) until counter reaches 5
  Noo       # 2^2^N
     >      # + 1
      p½    # if prime, increase counter


答:
05AB1E, 16 bytes

Uses CP-1252 encoding.

```<code>24Ý17K913+çJDl¹s
</code>```

Try it online!

Explanation

```<code>24Ý               # push range [0 ... 24]
   17K            # remove 17
      913+        # add 913 to each
          ç       # convert from code point
           J      # join to string
            Dl    # push a lowercase copy
              ¹   # push the input
               s  # swap the top 2 elements of the stack
                  # implicitly display the top of the stack
</code>```

Title: Print the Greek alphabet!

Body:
05AB1E, 16 bytes

Uses CP-1252 encoding.

24Ý17K913+çJDl¹s

Try it online!

Explanation

24Ý               # push range [0 ... 24]
   17K            # remove 17
      913+        # add 913 to each
          ç       # convert from code point
           J      # join to string
            Dl    # push a lowercase copy
              ¹   # push the input
               s  # swap the top 2 elements of the stack
                  # implicitly display the top of the stack


答:
Python 2, n ≈ 28

from operator import mul

def fast_glynn_perm(M):
    row_comb = [sum(c) for c in zip(*M)]
    n=len(M)

    total = 0
    old_grey = 0
    sign = +1

    binary_power_dict = {2**i:i for i in range(n)}
    num_loops = 2**(n-1)

    for bin_index in xrange(1, num_loops + 1):
        total += sign * reduce(mul, row_comb)

        new_grey = bin_index^(bin_index/2)
        grey_diff = old_grey ^ new_grey
        grey_diff_index = binary_power_dict[grey_diff]

        new_vector = M[grey_diff_index]
        direction = 2 * cmp(old_grey,new_grey)

        for i in range(n):
            row_comb[i] += new_vector[i] * direction

        sign = -sign
        old_grey = new_grey

    return total/num_loops
```

<p>Uses the Glynn formula with a Gray code for updates. Runs up to <code>n=23</code> in a minute on my machine. One can surely do better implementing this in a faster language and with better data structures. This doesn't use that the matrix is ±1-valued.</p>

<p>A Ryser formula implementation is very similar, summing over all 0/1 vectors of coefficients rather than ±1-vectors. It takes about twice as long as Glynn's formula because adds over all 2^n such vectors, whereas Glynn's halves that using symmetry to only those starting with <code>+1</code>.</p>

<pre class="lang-python prettyprint-override"><code>from operator import mul

def fast_ryser_perm(M):
    n=len(M)
    row_comb = [0] * n

    total = 0
    old_grey = 0
    sign = +1

    binary_power_dict = {2**i:i for i in range(n)}
    num_loops = 2**n

    for bin_index in range(1, num_loops) + [0]:
        total += sign * reduce(mul, row_comb)

        new_grey = bin_index^(bin_index/2)
        grey_diff = old_grey ^ new_grey
        grey_diff_index = binary_power_dict[grey_diff]

        new_vector = M[grey_diff_index]
        direction = cmp(old_grey, new_grey)

        for i in range(n):
            row_comb[i] += new_vector[i] * direction

        sign = -sign
        old_grey = new_grey

    return total * (-1)**n
</code>```

Title: Calculate the permanent as quickly as possible

Body:
The challenge is to write the fastest code possible for computing the permanent of a matrix.

The permanent of an n-by-n matrix A = (ai,j) is defined as

Here S_n represents the set of all permutations of [1, n].

As an example (from the wiki):

In this question matrices are all square and will only have the values -1 and 1 in them.

Examples

Input:

```<code>[[ 1 -1 -1  1]
 [-1 -1 -1  1]
 [-1  1 -1  1]
 [ 1 -1 -1  1]]
</code>```

Permanent:

```<code>-4
</code>```

Input:

```<code>[[-1 -1 -1 -1]
 [-1  1 -1 -1]
 [ 1 -1 -1 -1]
 [ 1 -1  1 -1]]
</code>```

Permanent:

```<code>0
</code>```

Input:

```<code>[[ 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]]
</code>```

Permanent:

```<code>192
</code>```

Input:

```<code>[[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, 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, -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, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1]]
</code>```

Permanent:

```<code>1021509632
</code>```

The task

You should write code that, given an n by n matrix, outputs its permanent.

As I will need to test your code it would be helpful if you could give a simple way for me to give a matrix as input to your code, for example by reading from standard in.

Be warned that the permanent can be large (the all 1s matrix is the extreme case).

Scores and ties

I will test your code on random +-1 matrices of increasing size and stop the first time your code takes more than 1 minute on my computer.  The scoring matrices will be consistent for all submissions in order to ensure fairness.

If two people get the same score then the winner is the one which is fastest for that value of n. If those are within 1 second of each other then it is the one posted first.

Languages and libraries

You can use any available language and libraries you like but no pre-existing function to compute the permanent. Where feasible, it would be good to be able to run your code so please include a full explanation for how to run/compile your code in Linux if at all possible.`

Reference implementations

There is already a codegolf question question with lots of code in different languages for computing the permanent for small matrices. Mathematica and Maple also both have permanent implementations if you can access those.

My Machine The timings will be run on my 64-bit machine. This is a standard ubuntu install with 8GB RAM, AMD FX-8350 Eight-Core Processor and Radeon HD 4250.  This also means I need to be able to run your code.

Low level information about my machine

cat /proc/cpuinfo/|grep flags gives

flags     : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
  pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
  pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid
  aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt
  aes xsave avx f16c lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a
  misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 tce
  nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate vmmcall
  bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid
  decodeassists pausefilter pfthreshold

I will ask a closely related follow up multi-language question that doesn't suffer from the big Int problem so lovers of Scala, Nim, Julia, Rust, Bash can show off their languages too.

Leader board

n = 33 (45 seconds. 64 seconds for n = 34). Ton Hospel in C++ with g++ 5.4.0.

n = 32 (32 seconds). Dennis in C with gcc 5.4.0 using Ton Hospel's gcc flags.

n = 31 (54 seconds). Christian Sievers in Haskell

n = 31 (60 seconds). primo in rpython

n = 30 (26 seconds). ezrast in Rust

n = 28 (49 seconds). xnor with Python + pypy 5.4.1

n = 22 (25 seconds). Shebang with Python + pypy 5.4.1

Note. In practice the timings for Dennis and Ton Hospel's vary a lot for mysterious reasons. For example they seem to be faster after I have loaded a web browser! The timings quoted are the fastest in all the tests I have done.

Body:
Python 2, n ≈ 28

from operator import mul

def fast_glynn_perm(M):
    row_comb = [sum(c) for c in zip(*M)]
    n=len(M)

    total = 0
    old_grey = 0
    sign = +1

    binary_power_dict = {2**i:i for i in range(n)}
    num_loops = 2**(n-1)

    for bin_index in xrange(1, num_loops + 1):
        total += sign * reduce(mul, row_comb)

        new_grey = bin_index^(bin_index/2)
        grey_diff = old_grey ^ new_grey
        grey_diff_index = binary_power_dict[grey_diff]

        new_vector = M[grey_diff_index]
        direction = 2 * cmp(old_grey,new_grey)

        for i in range(n):
            row_comb[i] += new_vector[i] * direction

        sign = -sign
        old_grey = new_grey

    return total/num_loops

Uses the Glynn formula with a Gray code for updates. Runs up to n=23 in a minute on my machine. One can surely do better implementing this in a faster language and with better data structures. This doesn't use that the matrix is ±1-valued.

A Ryser formula implementation is very similar, summing over all 0/1 vectors of coefficients rather than ±1-vectors. It takes about twice as long as Glynn's formula because adds over all 2^n such vectors, whereas Glynn's halves that using symmetry to only those starting with +1.

from operator import mul

def fast_ryser_perm(M):
    n=len(M)
    row_comb = [0] * n

    total = 0
    old_grey = 0
    sign = +1

    binary_power_dict = {2**i:i for i in range(n)}
    num_loops = 2**n

    for bin_index in range(1, num_loops) + [0]:
        total += sign * reduce(mul, row_comb)

        new_grey = bin_index^(bin_index/2)
        grey_diff = old_grey ^ new_grey
        grey_diff_index = binary_power_dict[grey_diff]

        new_vector = M[grey_diff_index]
        direction = cmp(old_grey, new_grey)

        for i in range(n):
            row_comb[i] += new_vector[i] * direction

        sign = -sign
        old_grey = new_grey

    return total * (-1)**n


答:
CJam, 16 bytes

```<code>25,H-ea'α'Α?f+
</code>```

Try it online!

```<code>25,H-         e# 0 to 24 excluding 17.
ea'α'Α?       e# If the argument list is truthy (non-empty), alpha, otherwise Alpha.
f+            e# Return characters with each number added to the character code.
</code>```

Title: Print the Greek alphabet!

Body:
Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output the Greek alphabet in lowercase.

Information

Greek alphabet (Capitals):  ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

Greek alphabet (Lowercase): αβγδεζηθικλμνξοπρστυφχψω

Rules/Requirements

Each submission must be a full program.

Builtins to print the Greek alphabet are not permitted

Standard loopholes apply

You must print exactly what is shown.

Scoring

Programs are scored according to bytes. If you are using a character set different to UTF-8 please specify. Try to get the least bytes out of everyone, this is code-golf!

Test cases

```<code>./program
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

./program 1
==> αβγδεζηθικλμνξοπρστυφχψω

./program 'lower'
==> αβγδεζηθικλμνξοπρστυφχψω

./program 123897883421
==> αβγδεζηθικλμνξοπρστυφχψω

./program ""
==> αβγδεζηθικλμνξοπρστυφχψω

greek();
==> ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ

greek("blah");
==> αβγδεζηθικλμνξοπρστυφχψω

greek(123);
==> αβγδεζηθικλμνξοπρστυφχψω
</code>```

Submissions

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

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:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

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:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 97049; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<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

```

Body:
CJam, 16 bytes

25,H-ea'α'Α?f+

Try it online!

25,H-         e# 0 to 24 excluding 17.
ea'α'Α?       e# If the argument list is truthy (non-empty), alpha, otherwise Alpha.
f+            e# Return characters with each number added to the character code.


问:
Balanced triplet brackets
A "triplet bracket" (that I made up for this challenge) is one of the following:

```<code>(...+...)
[...:...]
{...|...}
<...-...>
</code>```

A balanced triplet bracket string (BTBS for short) is either an empty string, two BTBSes concatenated, or one of the above triplet brackets with each ... replaced with a BTBS.

Your task is to write a program or function that checks whether a string that consists of only (+)[:]{|}<-> is balanced. Shortest code wins.

Examples

Your program should return truthy for the following strings:

```<code>(+)(+)(+)
[[[:]:]:(+(+))]{<->|<(+)->[:]}(+)
<<<<<<<<<<<<->->->->->->->->->->->->
{|(+[:<-{|(+[:<->])}>])}
[[[:]:[:]]:[[:]:[:]]]
{[:](+)|<->{|}}[(+)<->:{|}(+)]
</code>```

Your program should return falsy for the following strings:

```<code>:[
<|>
(+(+)
[:][:](+[[:]):]
{|{|{|(+{|{|{|}}}}}+)}[:]{|}
{{||}}
<<->-<->-<->>
[(+):((+)+)+(+(+))]
<<<<<->->->->->->
</code>```

Title: Balanced triplet brackets

Body:
JavaScript (ES6), <s>77</s> <s>58</s> <s>57</s> 56 bytes

f=s=>s==(s=s.replace(/\(\+\)|\[:]|{\|}|<->/,''))?!s:f(s)

Test cases

f=s=>s==(s=s.replace(/\(\+\)|\[:]|{\|}|<->/,''))?!s:f(s)

console.log("Testing truthy values");
console.log(f("(+)(+)(+)"));
console.log(f("[[[:]:]:(+(+))]{<->|<(+)->[:]}(+)"));
console.log(f("<<<<<<<<<<<<->->->->->->->->->->->->"));
console.log(f("{|(+[:<-{|(+[:<->])}>])}"));
console.log(f("[[[:]:[:]]:[[:]:[:]]]"));
console.log(f("{[:](+)|<->{|}}[(+)<->:{|}(+)]"));

console.log("Testing falsy values");
console.log(f(":["));
console.log(f("<|>"));
console.log(f("(+(+)"));
console.log(f("[:][:](+[[:]):]"));
console.log(f("{|{|{|(+{|{|{|}}}}}+)}[:]{|}"));
console.log(f("{{||}}"));
console.log(f("<<->-<->-<->>"));
console.log(f("[(+):((+)+)+(+(+))]"));
console.log(f("<<<<<->->->->->->"));


答:
JavaScript (ES6), <s>89</s> <s>83</s> 81 bytes

```<code>(...a)=>String.fromCharCode(...[...Array(24)].map((_,i)=>i*1.06+913+32*a.length))
</code>```

If a character array is acceptable, then for <s>82</s> <s>80</s> 78 bytes:

```<code>(...a)=>[...Array(24)].map((_,i)=>String.fromCharCode(i*1.06+913+32*a.length))
</code>```

Edit: Saved a bunch of bytes thanks to @ETHproductions.

Title: Print the Greek alphabet!

Body:
JavaScript (ES6), <s>89</s> <s>83</s> 81 bytes

(...a)=>String.fromCharCode(...[...Array(24)].map((_,i)=>i*1.06+913+32*a.length))

If a character array is acceptable, then for <s>82</s> <s>80</s> 78 bytes:

(...a)=>[...Array(24)].map((_,i)=>String.fromCharCode(i*1.06+913+32*a.length))

Edit: Saved a bunch of bytes thanks to @ETHproductions.


答:
Pyke, <s>55</s> <s>21</s> 20 bytes

```<code>24Fi16>913s.C)sz!hAl
</code>```

Try it here!

```<code>24F          )       -   for i in range(24):
   i16>              -       i > 16
       913s          -      sum(i, ^, 913)
           .C        -     chr(^)
              s      -  sum(^) - created uppercase alphabet
                  Al - [len, lower, upper][V](^)
                 h   -  V + 1
               z!    -   not input()
</code>```

Title: Print the Greek alphabet!

Body:
Pyke, <s>55</s> <s>21</s> 20 bytes

24Fi16>913s.C)sz!hAl

Try it here!

24F          )       -   for i in range(24):
   i16>              -       i > 16
       913s          -      sum(i, ^, 913)
           .C        -     chr(^)
              s      -  sum(^) - created uppercase alphabet
                  Al - [len, lower, upper][V](^)
                 h   -  V + 1
               z!    -   not input()


答:
Python, 77 bytes

lambda s:eval("s"+".replace('%s','')"*4%('(+)','[:]','{|}','<->')*len(s))==''
```

<p>Uses Arnauld's replacement idea. Generates and evaluates a long string like</p>

<pre class="lang-python prettyprint-override"><code>s.replace('(+)','').replace('[:]','').replace('{|}','').replace('<->','').replace('(+)','').replace('[:]','').replace('{|}','').replace('<->','')
</code>```

to cycle between replacing all the bracket types. Then, checks if the result is the empty string.

Title: Balanced triplet brackets

Body:
A "triplet bracket" (that I made up for this challenge) is one of the following:

```<code>(...+...)
[...:...]
{...|...}
<...-...>
</code>```

A balanced triplet bracket string (BTBS for short) is either an empty string, two BTBSes concatenated, or one of the above triplet brackets with each ... replaced with a BTBS.

Your task is to write a program or function that checks whether a string that consists of only (+)[:]{|}<-> is balanced. Shortest code wins.

Examples

Your program should return truthy for the following strings:

```<code>(+)(+)(+)
[[[:]:]:(+(+))]{<->|<(+)->[:]}(+)
<<<<<<<<<<<<->->->->->->->->->->->->
{|(+[:<-{|(+[:<->])}>])}
[[[:]:[:]]:[[:]:[:]]]
{[:](+)|<->{|}}[(+)<->:{|}(+)]
</code>```

Your program should return falsy for the following strings:

```<code>:[
<|>
(+(+)
[:][:](+[[:]):]
{|{|{|(+{|{|{|}}}}}+)}[:]{|}
{{||}}
<<->-<->-<->>
[(+):((+)+)+(+(+))]
<<<<<->->->->->->
</code>```

Body:
Python, 77 bytes

lambda s:eval("s"+".replace('%s','')"*4%('(+)','[:]','{|}','<->')*len(s))==''

Uses Arnauld's replacement idea. Generates and evaluates a long string like

s.replace('(+)','').replace('[:]','').replace('{|}','').replace('<->','').replace('(+)','').replace('[:]','').replace('{|}','').replace('<->','')

to cycle between replacing all the bracket types. Then, checks if the result is the empty string.


答:
Haskell, <s>114</s> 108 bytes

```<code>import System.Environment
q[a,b]=[a..b]
f[]=q"ΑΡ"++q"ΣΩ"
f _=q"αρ"++q"σω"
main=f<$>getArgs>>=putStr
</code>```

Thanks to @xnor for saving 6 bytes

This might win in the category of longest imports if nothing else…

Title: Print the Greek alphabet!

Body:
Haskell, <s>114</s> 108 bytes

import System.Environment
q[a,b]=[a..b]
f[]=q"ΑΡ"++q"ΣΩ"
f _=q"αρ"++q"σω"
main=f<$>getArgs>>=putStr

Thanks to @xnor for saving 6 bytes

This might win in the category of longest imports if nothing else…


答:
PHP, 84 Bytes

Online Version

<?=($argc<2?trim:mb_strtolower)("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ");
```

<h1>PHP, 87 Bytes</h1>

<pre class="lang-php prettyprint-override"><code>$s="ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ";echo$argc>1?mb_strtolower($s):$s;
</code>```

Title: Print the Greek alphabet!

Body:
PHP, 84 Bytes

Online Version

<?=($argc<2?trim:mb_strtolower)("ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ");

PHP, 87 Bytes

$s="ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ";echo$argc>1?mb_strtolower($s):$s;


答:
Scala, 45 bytes

```<code>Seq.fill(_:Int)(_:Double)reduceRight math.pow
</code>```

Ungolfed:

```<code>(a:Int,b:Double)=>Seq.fill(a)(b).reduceRight(math.pow)
</code>```

Build a sequence of as with b elements, and apply math.pow from right to left.

Title: Print the tetration

Body:
Tetration, represented as \${}^ba\$, is repeated exponentiation. For example, \${}^32\$ is \$2^{2^2}\$, which is \$16\$.

Given two numbers \$a\$ and \$b\$, print \${}^ba\$.

Test cases

```<code>1 2 -> 1
2 2 -> 4
5 2 -> 3125
3 3 -> 7625597484987
etc.
</code>```

Scientific notation is acceptable.

Remember, this is code-golf, so the code with the smallest number of bytes wins.

Body:
Scala, 45 bytes

Seq.fill(_:Int)(_:Double)reduceRight math.pow

Ungolfed:

(a:Int,b:Double)=>Seq.fill(a)(b).reduceRight(math.pow)

Build a sequence of as with b elements, and apply math.pow from right to left.


答:
R, <s>104</s> <s>99</s> 92 bytes

```<code>g=function(x)for(i in sprintf("'\\u%04X'",913:937+32*!missing(x))[-18])cat(eval(parse(t=i)))
</code>```

Golfing down on the second version I had previously. Work the same way as  previous version.

Thanks to @JDL for shaving off 7 bytes!

Old versions at 104 bytes:

I have two different solutions with the same byte count:

```<code>f=function(x){a="ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ";cat(if(missing(x))a else tolower(a))}
</code>```

Or:

```<code>g=function(x)for(i in sprintf("'\\u%04X'",if(missing(x))913:937 else 945:969)[-18])cat(eval(parse(t=i)))
</code>```

Explanations:

#First one is trivial
f=function(x){
     a="ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" #String to print
     #If argument missing, print uppercase else lowercase
     cat(if(missing(x))a else tolower(a))
     }
#Second one more interesting:
g=function(x)
     #Create escaped unicode strings (i. e. "'\\u03B1'" etc.), loop over them...
     for(i in sprintf("'\\u%04X'",if(missing(x))913:937 else 945:969)[-18])
          #...eval the strings
          cat(eval(parse(t=i)))
```
<p>Usage:</p>
```> f()
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
> g()
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
> f(1)
αβγδεζηθικλμνξοπρστυφχψω
> g(1)
αβγδεζηθικλμνξοπρστυφχψω
> f("a")
αβγδεζηθικλμνξοπρστυφχψω
> g("a")
αβγδεζηθικλμνξοπρστυφχψω
```

For some reasons, it doesn't work on R-Fiddle (it changes " to ' by default which makes the code throw an error) but you can try it out on Ideone.

Title: Print the Greek alphabet!

Body:
R, <s>104</s> <s>99</s> 92 bytes

g=function(x)for(i in sprintf("'\\u%04X'",913:937+32*!missing(x))[-18])cat(eval(parse(t=i)))

Golfing down on the second version I had previously. Work the same way as  previous version.

Thanks to @JDL for shaving off 7 bytes!

Old versions at 104 bytes:

I have two different solutions with the same byte count:

f=function(x){a="ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ";cat(if(missing(x))a else tolower(a))}

Or:

g=function(x)for(i in sprintf("'\\u%04X'",if(missing(x))913:937 else 945:969)[-18])cat(eval(parse(t=i)))

Explanations:

#First one is trivial
f=function(x){
     a="ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ" #String to print
     #If argument missing, print uppercase else lowercase
     cat(if(missing(x))a else tolower(a))
     }
#Second one more interesting:
g=function(x)
     #Create escaped unicode strings (i. e. "'\\u03B1'" etc.), loop over them...
     for(i in sprintf("'\\u%04X'",if(missing(x))913:937 else 945:969)[-18])
          #...eval the strings
          cat(eval(parse(t=i)))

Usage:

> f()
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
> g()
ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ
> f(1)
αβγδεζηθικλμνξοπρστυφχψω
> g(1)
αβγδεζηθικλμνξοπρστυφχψω
> f("a")
αβγδεζηθικλμνξοπρστυφχψω
> g("a")
αβγδεζηθικλμνξοπρστυφχψω

For some reasons, it doesn't work on R-Fiddle (it changes " to ' by default which makes the code throw an error) but you can try it out on Ideone.


答:
Scala, 82 bytes

```<code>print((('Α'to'Ρ')++('Σ'to'Ω')).mkString.map(& =>if(args.size<1)&else&toLower))
</code>```

Ungolfed:

```<code>print((('Α'to'Ρ')++('Σ'to'Ω')).mkString.map(s=>if(args.size==0)s else s.toLower))
</code>```

Sadly, (('Α'to'Ρ')++('Σ'to'Ω')) is a Vector[Char], which would be printed as Vector('Α', 'Β', ..., so it has to be converted to a string with mkString.The argument to map is called & to save spaces between &else, else& and & toLower.

Title: Print the Greek alphabet!

Body:
Scala, 82 bytes

print((('Α'to'Ρ')++('Σ'to'Ω')).mkString.map(& =>if(args.size<1)&else&toLower))

Ungolfed:

print((('Α'to'Ρ')++('Σ'to'Ω')).mkString.map(s=>if(args.size==0)s else s.toLower))

Sadly, (('Α'to'Ρ')++('Σ'to'Ω')) is a Vector[Char], which would be printed as Vector('Α', 'Β', ..., so it has to be converted to a string with mkString.The argument to map is called & to save spaces between &else, else& and & toLower.


问:
A game of atomic proportions
Your task make a bot that plays Atomas, with the highest score.

How the game works:

The gameboard starts with a ring of 6 "atoms", with numbers ranging from 1 to 3. You can "play" an atom between two atoms, or on another atom, depending on the atom itself.

You can either have a normal atom, or a special atom.

The normal atom:

You can play a normal atom between any two available atoms on the board.

You start off with atoms in the range 1 to 3, but the range increases by 1 once every 40 moves (so after 40 moves, the range becomes 2 to 4).

If there are atoms on the board that are lower than the range, it has a 1 / no. of atoms of that number on the board chance of spawning.

Let's say you have a 2 to play, and the board looks like this:

```<code>   1 1 2 1
</code>```

Let's place the 2 to the right of the 1.

The board now becomes:

```<code>   1 1 2 1 2
</code>```

Note: the board wraps around, so the 1 on the far left is actually next to the 2 on the far right. This will be important later.

There are 4 types of "special" atoms, and they are:

The + atom:

This atom is played between two atoms. It has a 1 in 5 chance of spawning.

If the atoms on both sides of the + atom are the same, fusion occurs. Here's how it works:

```<code>The two atoms fuse together to create an atom one higher.
(So, two 3 atoms fuse together to form one 4 atom.)
While the atoms on both sides of the fused atom are equal:
    If the atoms on the side >= the fused atom:
        The new fused atom = the old fused atom's value + 2.
    If the atoms on the side < the fused atom:
        The new fused atom = the old fused atom's value + 1.
</code>```

Example:

```<code>   1 1 3 2 2 3  (the 1 on the left-hand side "wraps back"
                 to the 3 on the right-hand side)

Let's use the + on the two 2's in the middle.

-> 1 1 3 3 3    (the two 2's fused together to make a 3)
-> 1 1 5        (the two 3's fused with the 3, and because 3 >= 3,
                 the new fused atom = 3 + 2 = 5)
-> 6            (the two 1's fused with the 5, since the board wraps,
                 and because 1 < 5, the new fused atom = 5 + 1 = 6)

Because the atoms on the sides of the 6 don't exist, fusion stops,
and the board is now [6].
</code>```

If the atoms on both sides of the + atom are different, then the + stays on the board.

Example:

```<code>   1 3 2 3 1 1

Let's use the + on the 2 and 3 in the middle.

-> 1 3 2 + 3 1 1 (2 != 3, so the + stays on the board)
</code>```

The - atom:

This atom is played on another atom. It has a 1 in 10 chance of spawning.

The - atom removes an atom from the board, and gives you a choice to either:

play the removed atom next round, or

turn it into a + atom to play next round.

Example:

```<code>   1 3 2 3 1 1

Let's use the - on the left-hand 2.

-> 1 3 3 1 1    (the 2 is now removed from the board)

Let's turn it into a +, and place it in between the 3's.

-> 1 4 1 1      (the two 3's fused together to make a 4)
-> 5 1          (the two 1's fused with the 4, and because 1 < 4,
                 the new fused atom = 4 + 1 = 5)
</code>```

The black + atom (B):

This atom is played between 2 atoms. It has a 1 in 80 chance of spawning, and only spawns once your score > 750.

This atom is basically the same as the + atom, except that it fuses any two atoms together, even +'s. From then on, it follows the + rule (it only fuses atoms together if the atoms on both sides of the fused atom are equal).

The fused atom as a result of the black + is equal to:

the higher number atom in the fusion + 3

4 if the two fused atoms are +'s

Example:

```<code>   1 3 2 1 3 1

Let's use the black + on the 2 and 1 in the middle.

-> 1 3 5 3 1    (the 2 and 1 fused together to make a 2 + 3 = 5)
-> 1 6 1        (+ rule)
-> 7            (+ rule)
</code>```

Another example:

```<code>   2 + + 2

Let's use the black + on the two +'s.

-> 2 4 2        (the two +'s fused together to make a 4)
-> 5            (+ rule)
</code>```

The clone atom (C):

This atom is played on another atom. It has a 1 in 60 chance of spawning, and only spawns once your score > 1500.

The clone atom allows you to choose an atom, and play it next round.

Example:

```<code>   1 1 2 1

Let's use the clone on the 2, and place it to the right of the 1.

-> 1 1 2 1 2
</code>```

Here is my build of the game, in Python 2:

import random
import subprocess

logs='atoms.log'
atom_range = [1, 3]
board = []
score = 0
move_number = 0
carry_over = " "
previous_moves = []

specials = ["+", "-", "B", "C"]

def plus_process(user_input):
    global board, score, previous_moves, matches
    previous_moves = []
    matches = 0

    def score_calc(atom):
        global score, matches
        if matches == 0:
            score += int(round((1.5 * atom) + 1.25, 0))
        else:
            if atom < final_atom:
                outer = final_atom - 1
            else:
                outer = atom
            score += ((-final_atom + outer + 3) * matches) - final_atom + (3 * outer) + 3
        matches += 1

    if len(board) < 1 or user_input == "":
        board.append("+")
        return None
    board_start = board[:int(user_input) + 1]
    board_end = board[int(user_input) + 1:]
    final_atom = 0
    while len(board_start) > 0 and len(board_end) > 0:
        if board_start[-1] == board_end[0] and board_end[0] != "+":
            if final_atom == 0:
                final_atom = board_end[0] + 1
            elif board_end[0] >= final_atom:
                final_atom += 2
            else:
                final_atom += 1
            score_calc(board_end[0])
            board_start = board_start[:-1]
            board_end = board_end[1:]
        else:
            break
    if len(board_start) == 0:
        while len(board_end) > 1:
            if board_end[0] == board_end[-1] and board_end[0] != "+":
                if final_atom == 0:
                    final_atom = board_end[0]
                elif board_end[0] >= final_atom:
                    final_atom += 2
                else:
                    final_atom += 1
                score_calc(board_end[0])
                board_end = board_end[1:-1]
            else:
                break
    if len(board_end) == 0:
        while len(board_start) > 1:
            if board_start[0] == board_start[-1] and board_start[0] != "+":
                if board_start[0] >= final_atom:
                    final_atom += 2
                else:
                    final_atom += 1
                score_calc(board_start[0])
                board_start = board_start[1:-1]
            else:
                break
    if matches == 0:
        board = board_start + ["+"] + board_end
    else:
        board = board_start + [final_atom] + board_end
        for a in range(len(board) - 1):
            if board[a] == "+":
                if board[(a + 1) % len(board)] == board[a - 1]:
                    board = board[:a - 1] + board[a:]
                    plus_process(a)
                    break

def minus_process(user_input, minus_check):
    global carry_over, board
    carry_atom = board[int(user_input)]
    if user_input == len(board) - 1:
        board = board[:-1]
    else:
        board = board[:int(user_input)] + board[int(user_input) + 1:]
    if minus_check == "y":
        carry_over = "+"
    elif minus_check == "n":
        carry_over = str(carry_atom)

def black_plus_process(user_input):
    global board
    if board[int(user_input)] == "+":
        if board[int(user_input) + 1] == "+":
            inter_atom = 4
        else:
            inter_atom = board[int(user_input) + 1] + 2
    else:
        if board[int(user_input)] + 1 == "+":
            inter_atom = board[int(user_input)] + 2
        else:
            inter_list = [board[int(user_input)], board[int(user_input) + 1]]
            inter_atom = (inter_list.sort())[1] + 2
    board = board[int(user_input) - 1:] + [inter_atom] * 2 + board[int(user_input) + 1:]
    plus_process(int(user_input) - 1)

def clone_process(user_input):
    global carry_over
    carry_over = str(board[int(user_input)])

def regular_process(atom,user_input):
    global board
    if user_input == "":
        board.append(random.randint(atom_range[0], atom_range[1]))
    else:
        board = board[:int(user_input) + 1] + [int(atom)] + board[int(user_input) + 1:]

def gen_specials():
    special = random.randint(1, 240)
    if special <= 48:
        return "+"
    elif special <= 60 and len(board) > 0:
        return "-"
    elif special <= 64 and len(board) > 0 and score >= 750:
        return "B"
    elif special <= 67 and len(board) > 0 and score >= 1500:
        return "C"
    else:
        small_atoms = []
        for atom in board:
            if atom not in specials and atom < atom_range[0]:
                small_atoms.append(atom)
        small_atom_check = random.randint(1, len(board))
        if small_atom_check <= len(small_atoms):
            return str(small_atoms[small_atom_check - 1])
        else:
            return str(random.randint(atom_range[0], atom_range[1]))

def specials_call(atom, user_input):
    specials_dict = {
        "+": plus_process,
        "-": minus_process,
        "B": black_plus_process,
        "C": clone_process
    }
    if atom in specials_dict.keys():
        if atom == "-":
            minus_process(user_input[0], user_input[1])
        else:
            specials_dict[atom](user_input[0])
    else:
        regular_process(atom,user_input[0])

def init():
    global board, score, move_number, carry_over, previous_moves
    board = []
    score = 0

    for _ in range(6):
        board.append(random.randint(1, 3))

    while len(board) <= 18:
        move_number += 1
        if move_number % 40 == 0:
            atom_range[0] += 1
            atom_range[1] += 1
        if carry_over != " ":
            special_atom = carry_over
            carry_over = " "
        elif len(previous_moves) >= 5:
            special_atom = "+"
        else:
            special_atom = gen_specials()
        previous_moves.append(special_atom)
        bot_command = "python yourBot.py"
        bot = subprocess.Popen(bot_command.split(),
                               stdout = subprocess.PIPE,
                               stdin = subprocess.PIPE)
        to_send="/".join([
            # str(score),
            # str(move_number),
            str(special_atom),
            " ".join([str(x) for x in board])
        ])
        bot.stdin.write(to_send)
        with open(logs, 'a') as f:f.write(to_send+'\n')
        bot.stdin.close()
        all_user_input = bot.stdout.readline().strip("\n").split(" ")
        specials_call(special_atom, all_user_input)

    print("Game over! Your score is " + str(score))

if __name__ == "__main__":
    for a in range(20):
        with open(logs, 'a') as f:f.write('round '+str(a)+'-'*50+'\n')
        init()
```

<h2>How the bot thing works:</h2>

<h3>Input</h3>

<ul>
<li>Your bot will get 2 inputs: the atom that is currently in play, and the state of the board.</li>
<li>The atom will be like so:

<ul>
<li><code>+</code> for a <code>+</code> atom</li>
<li><code>-</code> for a <code>-</code> atom</li>
<li><code>B</code> for a Black <code>+</code> atom</li>
<li><code>C</code> for a Clone atom</li>
<li><code>{atom}</code> for a normal atom</li>
</ul></li>
<li>The state of the board will be like so:

<ul>
<li><code>atom 0 atom 1 atom 2... atom n</code>, with the atoms separated by spaces (<code>atom n</code> wraps back to <code>atom 1</code>, to simulate a "ring" gameboard)</li>
</ul></li>
<li>These two will be separated by a <code>/</code>.</li>
</ul>

<p>Example inputs:</p>

```1/1 2 2 3   (the atom in play is 1, and the board is [1 2 2 3])
+/1         (the atom in play is +, and the board is [1] on its own)
```

<h3>Output</h3>

<ul>
<li><p>You will output a string, depending on what the atom in play is.</p>

<ul>
<li><p>If the atom is meant to be played between two atoms:</p>

<ul>
<li><p>Output the gap you want to play the atom in. The gaps are like in between each atom, like so:</p>

```   1 1 2 1 2
```0

<p>(<code>gap n</code> indicates you want to place the atom between <code>atom 1</code> and atom <code>n</code>)
So output <code>2</code> if you want to play the atom on <code>gap 2</code>.</p></li>
</ul></li>
<li>If the atom is meant to be played on an atom:

<ul>
<li>Output the atom you want to play it on, so <code>2</code> if you want to play the atom on <code>atom 2</code>.</li>
</ul></li>
<li>If the atom is a <code>-</code>:

<ul>
<li>Output the atom you want to play it on, followed by a space, followed by a <code>y/n</code> choice of turning the atom into a <code>+</code> later, so <code>2, "y"</code> if you want to play the atom on <code>atom 2</code>, and you want to turn it into a <code>+</code>. <strong>Note: this requires 2 inputs, instead of 1.</strong></li>
</ul></li>
</ul></li>
</ul>

<p>Example outputs:</p>

```   1 1 2 1 2
```1

<ul>
<li>To make the bot work, you have to go to the <code>Popen</code> bit (at around the end of the code), and replace it with whatever makes your program run as a Pythonic list (so if your program is <code>derp.java</code>, replace <code>["python", "bot.py"]</code> with <code>["java", "derp.java"]</code>).</li>
</ul>

<h2>Answer-specific Specs:</h2>

<ul>
<li>Place the entire code of your bot into the answer. If it doesn't fit, it doesn't count.</li>
<li>Each user is allowed to have more than 1 bot, however, they should all be in separate answer posts.</li>
<li>Also, give your bot a name.</li>
</ul>

<h2>Scoring:</h2>

<ul>
<li>The bot with the highest score wins.

<ul>
<li>Your bot will be tested for 20 games, and the final score is the average of the 20 games.</li>
</ul></li>
<li>The tie-breaker will be the time of the upload of the answer.</li>
<li><p>So your answer will be formatted like this:</p>

```   1 1 2 1 2
```2

Good luck!

答:
Python, BadPlayer, Score = 21.45

import random

try:
    raw_input
except:
    raw_input = input

game_input = raw_input().split("/")
current_atom = game_input[0]
board = game_input[1].split(" ")

def get_chain(board, base):
    chain = []
    board = board[:]
    try:
        while board[base] == board[base + 1]:
            chain = [board[base]] + chain + [board[base + 1]]
            del board[base]
            del board[base]
            base -= 1
    except IndexError:
        pass
    return chain

def biggest_chain(board):
    chains = []
    base = 0
    i = 0
    while i < len(board) - 1:
        chains.append([i, get_chain(board, i)])
        i += 1
    return sorted(chains, key=lambda x: len(x[1]) / 2)[-1]

def not_in_chain():
    a, b = biggest_chain(board)
    if len(b) == 0:
        print(random.randint(0, len(board) - 1))
    elif random.randint(0, 1) == 0:
        print(random.randint(a + len(b)/2, len(board) - 1))
    else:
        try:
            print(random.randint(0, a - len(b)/2 - 1))
        except:
            print(random.randint(a + len(b)/2, len(board) - 1))

if current_atom in "+B":
    a, b = biggest_chain(board)
    if len(b) == 0:
        print(0)
    else:
        print(a)
elif current_atom == "C":
    not_in_chain()
elif current_atom == "-":
    a, b = biggest_chain(board)
    if len(b) == 0:
        print(str(random.randint(0, len(board) - 1)) + " n")
    elif random.randint(0, 1) == 0:
        print(str(random.randint(a + len(b)/2, len(board) - 1)) + " n")
    else:
        try:
            print(str(random.randint(0, a - len(b)/2 - 1)) + " n")
        except:
            print(str(random.randint(0, len(board) - 1)) + " n")
else:
    not_in_chain()
```

Just a very bad bot that often make the controller crash

Title: A game of atomic proportions

Body:
Python, BadPlayer, Score = 21.45

import random

try:
    raw_input
except:
    raw_input = input

game_input = raw_input().split("/")
current_atom = game_input[0]
board = game_input[1].split(" ")

def get_chain(board, base):
    chain = []
    board = board[:]
    try:
        while board[base] == board[base + 1]:
            chain = [board[base]] + chain + [board[base + 1]]
            del board[base]
            del board[base]
            base -= 1
    except IndexError:
        pass
    return chain

def biggest_chain(board):
    chains = []
    base = 0
    i = 0
    while i < len(board) - 1:
        chains.append([i, get_chain(board, i)])
        i += 1
    return sorted(chains, key=lambda x: len(x[1]) / 2)[-1]

def not_in_chain():
    a, b = biggest_chain(board)
    if len(b) == 0:
        print(random.randint(0, len(board) - 1))
    elif random.randint(0, 1) == 0:
        print(random.randint(a + len(b)/2, len(board) - 1))
    else:
        try:
            print(random.randint(0, a - len(b)/2 - 1))
        except:
            print(random.randint(a + len(b)/2, len(board) - 1))

if current_atom in "+B":
    a, b = biggest_chain(board)
    if len(b) == 0:
        print(0)
    else:
        print(a)
elif current_atom == "C":
    not_in_chain()
elif current_atom == "-":
    a, b = biggest_chain(board)
    if len(b) == 0:
        print(str(random.randint(0, len(board) - 1)) + " n")
    elif random.randint(0, 1) == 0:
        print(str(random.randint(a + len(b)/2, len(board) - 1)) + " n")
    else:
        try:
            print(str(random.randint(0, a - len(b)/2 - 1)) + " n")
        except:
            print(str(random.randint(0, len(board) - 1)) + " n")
else:
    not_in_chain()

Just a very bad bot that often make the controller crash


答:
Python 2, n = 22 [Reference]

This is the 'reference' implementation I shared with Lembik yesterday, it misses making it to n=23 by a few seconds on his machine, on my machine it does it in about 52 seconds. To achieve these speeds you need to run this through PyPy.

The first function calculates the permanent similar to how the determinant could be calculated, by going over each submatrix until you are left with a 2x2 which you can apply the basic rule to. It is incredibly slow.

The second function is the one implementing the Ryser function (the second equation listed in Wikipedia). The set S is essentially the powerset of the numbers {1,...,n} (variable s_list in the code).

from random import *
from time import time
from itertools import*

def perm(a): # naive method, recurses over submatrices, slow
    if len(a) == 1:
        return a[0][0]
    elif len(a) == 2:
        return a[0][0]*a[1][1]+a[1][0]*a[0][1]
    else:
        tsum = 0
        for i in xrange(len(a)):
            transposed = [zip(*a)[j] for j in xrange(len(a)) if j != i]
            tsum += a[0][i] * perm(zip(*transposed)[1:])
        return tsum

def perm_ryser(a): # Ryser's formula, using matrix entries
    maxn = len(a)
    n_list = range(1,maxn+1)
    s_list = chain.from_iterable(combinations(n_list,i) for i in range(maxn+1))
    total = 0
    for st in s_list:
        stotal = (-1)**len(st)
        for i in xrange(maxn):
            stotal *= sum(a[i][j-1] for j in st)
        total += stotal
    return total*((-1)**maxn)

def genmatrix(d):
    mat = []
    for x in xrange(d):
        row = []
        for y in xrange(d):
            row.append([-1,1][randrange(0,2)])
        mat.append(row)
    return mat

def main():
    for i in xrange(1,24):
        k = genmatrix(i)
        print 'Matrix: (%dx%d)'%(i,i)
        print '\n'.join('['+', '.join(`j`.rjust(2) for j in a)+']' for a in k)
        print 'Permanent:',
        t = time()
        p = perm_ryser(k)
        print p,'(took',time()-t,'seconds)'

if __name__ == '__main__':
    main()
```


答:
R, 39 bytes

Recursive function:

```<code>f=function(a,b)ifelse(b>0,a^f(a,b-1),1)
</code>```

Title: Print the tetration

Body:
R, 39 bytes

Recursive function:

f=function(a,b)ifelse(b>0,a^f(a,b-1),1)


答:
Scala, 96 bytes

```<code>def&(s:String):Any={val t=s.replaceAll(raw"\(\+\)|\[:]|\{\|}|<->","")
if(t==s)t.size<1 else&(t)}
</code>```

This is basically the same idea as the other answers, but with some scala boilerplate.

without stealing ideas from others (188 bytes):

```<code>import scala.util.parsing.combinator._
val a = new RegexParsers{def r:Parser[_]="("~r~"+"~r~")"|"["~r~":"~r~"]"|"{"~r~"|"~r~"}"|"<"~r~"-"~r~">"|""
def!(s:String)= !parseAll(r,s).isEmpty}!_
</code>```

Title: Balanced triplet brackets

Body:
Scala, 96 bytes

def&(s:String):Any={val t=s.replaceAll(raw"\(\+\)|\[:]|\{\|}|<->","")
if(t==s)t.size<1 else&(t)}

This is basically the same idea as the other answers, but with some scala boilerplate.

without stealing ideas from others (188 bytes):

import scala.util.parsing.combinator._
val a = new RegexParsers{def r:Parser[_]="("~r~"+"~r~")"|"["~r~":"~r~"]"|"{"~r~"|"~r~"}"|"<"~r~"-"~r~">"|""
def!(s:String)= !parseAll(r,s).isEmpty}!_


答:
Haskell, 47 bytes

```<code>[n|n<-[1..],2*n==sum[d|d<-[2..n],n`mod`d<1]]!!0
</code>```

Searching the first quasiperfect number, which is a number n whose sum of divisors is 2*n+1. Instead of adding 1, I exclude 1 from the list of divisors.

Title: Does the code terminate?

Body:
This is a code golf challenge I thought of with a mathematical bent. The challenge is to write the shortest code possible such that it is an open question whether or not the code terminates. An example of what I mean could be the following piece of python code, adapted from an anwser to this cs stackexchange question.

```<code>def is_perfect(n):
    return sum(i for i in range(1, n) if n % i == 0) == n

n = 3
while not is_perfect(n):
    n = n + 2
</code>```

Mathematicians conjecture that there are no odd perfect numbers, but it has never been proven, so no one knows if this piece of code will ever terminate. Can you come up with other pieces of code (perhaps relying on other open problems like the Collatz conjecture, or the twin primes conjecture) that are shorter, but for which it is unknown whether or not they terminate?

Edit: Some people have brought up a good additional rule - The solutions to the question should be deterministic. Although it might be even more interesting if you could find shorter solutions using nondeterminism. In this case, the rule would be to find a snippet for which the probability of termination is unknown.

Body:
Haskell, 47 bytes

[n|n<-[1..],2*n==sum[d|d<-[2..n],n`mod`d<1]]!!0

Searching the first quasiperfect number, which is a number n whose sum of divisors is 2*n+1. Instead of adding 1, I exclude 1 from the list of divisors.


答:
Mathematica, 55 bytes

```<code>StringDelete["(+)"|"[:]"|"{|}"|"<->"]~FixedPoint~#==""&
</code>```

Anonymous function. Takes a string as input and returns True or False as output. Uses the standard method for doing this.

Title: Balanced triplet brackets

Body:
Mathematica, 55 bytes

StringDelete["(+)"|"[:]"|"{|}"|"<->"]~FixedPoint~#==""&

Anonymous function. Takes a string as input and returns True or False as output. Uses the standard method for doing this.


答:
Japt, 25 bytes

```<code>!Ue"%(%+%)|%[:]|\{%|}|<->
</code>```

Test it online!

e on strings is a recursive-replace function. The second parameter defaults to the empty string, which means this recursively removes matches of the Japt regex "%(%+%)|%[:]|\{%|}|<->" (in regular terms, /\(\+\)|\[:]|{\|}|<->/). This returns an empty string for balanced triplet strings and a non-empty string for non-balanced, so the correct return value is the logical NOT of this.

Title: Balanced triplet brackets

Body:
Japt, 25 bytes

!Ue"%(%+%)|%[:]|\{%|}|<->

Test it online!

e on strings is a recursive-replace function. The second parameter defaults to the empty string, which means this recursively removes matches of the Japt regex "%(%+%)|%[:]|\{%|}|<->" (in regular terms, /\(\+\)|\[:]|{\|}|<->/). This returns an empty string for balanced triplet strings and a non-empty string for non-balanced, so the correct return value is the logical NOT of this.


答:
TI-Basic, 19 bytes

```<code>Prompt A,B
A
For(C,2,B
A^Ans
End
</code>```

Title: Print the tetration

Body:
TI-Basic, 19 bytes

Prompt A,B
A
For(C,2,B
A^Ans
End


答:
GameMaker Language, <s>52</s> 50 bytes

```<code>d=a=argument0;for(c=1;c<b;c++)d=power(a,d)return d
</code>```

Title: Print the tetration

Body:
GameMaker Language, <s>52</s> 50 bytes

d=a=argument0;for(c=1;c<b;c++)d=power(a,d)return d


答:
CJam, 9 bytes

```<code>q~)*{\#}*
</code>```

Try it online!

Explanation

```<code>q~          e# Take input (array) and evaluate
  )         e# Pull off last element
   *        e# Array with the first element repeated as many times as the second
    {  }*   e# Reduce array by this function
     \#     e# Swap, power
</code>```

Title: Print the tetration

Body:
CJam, 9 bytes

q~)*{\#}*

Try it online!

Explanation

q~          e# Take input (array) and evaluate
  )         e# Pull off last element
   *        e# Array with the first element repeated as many times as the second
    {  }*   e# Reduce array by this function
     \#     e# Swap, power


问:
Goldbach partitions
The Goldbach conjecture states that every even number greater than two can be expressed as the sum of two primes. For example,

```<code>4 = 2 + 2
6 = 3 + 3
8 = 5 + 3
</code>```

However, once we get to 10 something interesting happens. Not only can 10 be written as

```<code>5 + 5
</code>```

but it can also be written as

```<code>7 + 3
</code>```

Since 10 can be expressed as the sum of two primes two ways, we say that the "Goldbach partition" of 10 is 2. Or more generally,

The Goldbach partition of a number is the total number of distinct ways of writing n = p + q where p and q are primes and p >= q

Your challenge is to write a program or function that finds the Goldbach partition of a number. Now, technically the term "Goldbach partition" is used only to refer to even numbers. However, since the odd integer p + 2 can also be expressed as the sum of two primes if p > 2 is prime, we will extend this to all positive integers (A061358).

You may safely assume that your input will always be a positive integer, and you may take input and output in any of our default allowed methods, for example function arguments and return value, STDIN and STDOUT, reading and writing to a file, etc.

The Goldbach partitions of the positive integers up to 100 are:

```<code>0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 2, 1, 2, 1, 3, 0, 3, 1,
3, 0, 2, 0, 3, 1, 2, 1, 4, 0, 4, 0, 2, 1, 3, 0, 4, 1, 3, 1, 4, 0, 5, 1, 4,
0, 3, 0, 5, 1, 3, 0, 4, 0, 6, 1, 3, 1, 5, 0, 6, 0, 2, 1, 5, 0, 6, 1, 5, 1,
5, 0, 7, 0, 4, 1, 5, 0, 8, 1, 5, 0, 4, 0, 9, 1, 4, 0, 5, 0, 7, 0, 3, 1, 6
</code>```

As usual, standard loopholes apply, and the shortest answer in bytes wins!

答:
05AB1E, <s>10</s> 8 bytes

Extremely inefficient.

```<code>D!f-pO;î
</code>```

Try it online!
or Try a less efficient way of generating primes

Explanation

n = 10 used as example.

```<code>D          # duplicate
           # STACK: 10, 10
 !         # factorial
           # STACK: 10, 3628800
  f        # unique prime factors
           # STACK: 10, [2,3,5,7]
   -       # subtract
           # STACK: [8,7,5,3]
    p      # is prime
           # STACK: [0,1,1,1]
     O     # sum
           # STACK: 3
      ;    # divide by 2
           # STACK: 1.5
       î   # round up
           # STACK: 2
           # implicit output
</code>```

Title: Goldbach partitions

Body:
05AB1E, <s>10</s> 8 bytes

Extremely inefficient.

D!f-pO;î

Try it online!
or Try a less efficient way of generating primes

Explanation

n = 10 used as example.

D          # duplicate
           # STACK: 10, 10
 !         # factorial
           # STACK: 10, 3628800
  f        # unique prime factors
           # STACK: 10, [2,3,5,7]
   -       # subtract
           # STACK: [8,7,5,3]
    p      # is prime
           # STACK: [0,1,1,1]
     O     # sum
           # STACK: 3
      ;    # divide by 2
           # STACK: 1.5
       î   # round up
           # STACK: 2
           # implicit output