答:
Python 2, 59 bytes

a=i=1
exec"print'%9d x 8 +'%a,i,'=',a*8+i;i+=1;a=a*10+i;"*9
```

The numbers a and i the equation a * 8 + i are generated arithmetically. Each line, i is incremented, and a has the next digit appended via a=a*10+i. For example, if a=12345, i=5, then i becomes 6, so the new a is 12345*10 + 6 which is 123456.

Storing these as numbers rather than strings lets us compute the RHS as given by the equation a*8+i, which is shorter than string reversing.

Title: Output a Magical 8 Trapezium

Body:
Python 2, 59 bytes

a=i=1
exec"print'%9d x 8 +'%a,i,'=',a*8+i;i+=1;a=a*10+i;"*9

The numbers a and i the equation a * 8 + i are generated arithmetically. Each line, i is incremented, and a has the next digit appended via a=a*10+i. For example, if a=12345, i=5, then i becomes 6, so the new a is 12345*10 + 6 which is 123456.

Storing these as numbers rather than strings lets us compute the RHS as given by the equation a*8+i, which is shorter than string reversing.


问:
Detriplicate a string
A lot of languages have built-in ways to get rid of duplicates, or "deduplicate" or "uniquify" a list or string. A less common task is to "detriplicate" a string. That is, for every character that appears, the first two occurrences are kept.

Here is an example where the characters that should be deleted are labelled with ^:

```<code>aaabcbccdbabdcd
  ^    ^ ^^^ ^^
aabcbcdd
</code>```

Your task is to implement exactly this operation.

Rules

Input is a single, possibly empty, string. You may assume that it only contains lowercase letters in the ASCII range.

Output should be a single string with all characters removed which have already appeared at least twice in the string (so the left-most two occurrences are kept).

Instead of strings you may work with lists of characters (or singleton strings), but the format has to be consistent between input and output.

You may write a program or a function and use any of the our standard methods of receiving input and providing output.

You may use any programming language, but note that these loopholes are forbidden by default.

This is code-golf, so the shortest valid answer – measured in bytes – wins.

Test Cases

Every pair of lines is one test case, input followed by output.

```<code>

xxxxx
xx
abcabc
abcabc
abcdabcaba
abcdabc
abacbadcba
abacbdc
aaabcbccdbabdcd
aabcbcdd
</code>```

Leaderboard

The Stack Snippet at the bottom of this post generates a leaderboard from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

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 + 3 (-p flag) = 45 bytes
</code>```

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

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

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Perl 6, 27 bytes

```<code>{.comb.grep({++%.{$_} <3})}
</code>```

Explanation:

```<code>{.comb.grep({++%.{$_} <3})}
{                         } # a function
 .comb                      # get all the characters in the argument
      .grep({           })  # filter
               %.           # an anonymous hash (shared between calls to grep)
             ++  {$_}       # increment the value at the current key (current letter).
                            # if the key doesn't exist, it defaults to 0 (then gets incremented)
                      <3    # return True if it wasn't seen 3 times
</code>```

(Note: Perl 6 isn't as "golf-oriented" as its sister Perl 5 ... So yes, that space before the < is necessary. The %.{} is an anonymous hash).

ContentLicense: CC BY-SA 3.0

Title: Detriplicate a string

Body:
Perl 6, 27 bytes

{.comb.grep({++%.{$_} <3})}

Explanation:

{.comb.grep({++%.{$_} <3})}
{                         } # a function
 .comb                      # get all the characters in the argument
      .grep({           })  # filter
               %.           # an anonymous hash (shared between calls to grep)
             ++  {$_}       # increment the value at the current key (current letter).
                            # if the key doesn't exist, it defaults to 0 (then gets incremented)
                      <3    # return True if it wasn't seen 3 times

(Note: Perl 6 isn't as "golf-oriented" as its sister Perl 5 ... So yes, that space before the < is necessary. The %.{} is an anonymous hash).


问:
The kitten command
A kitten is much like a cat. Some of the main differences are cuteness, lack of intelligence, and size. Similarly, the cat command is different from the kitten command. Fortunately, there is only one difference in this case. In the kitten command, all uppercase letters are replaced with lowercase letters.

Objective

To implement a program that behaves similarly to cat. All characters [A-Z] are outputted lowercase.

Input

A list of files as command line arguments. If no files are listed, then read from standard input. The input may contain unprintable characters and characters outside the ASCII range.

Output

If input is a bunch of files, concatenate the contents and output all characters as lowercase. If reading from STDIN, output the contents of STDIN with all uppercase letters as lowercase.

Note: Only make the characters [A-Z] lowercase. It is unacceptable if any other characters are made lowercase.

Examples

```<code>$ echo "HelLo" > file.txt
$ kitten file.txt
hello
$ echo "Good Bye" | kitten
good bye
$ echo "Ä" | kitten
Ä
</code>```

As usual with code-golf, least bytes wins.

Leaderboards

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

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

```<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>```

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

```

答:
Java, 198 bytes

```<code>b->B->{B="";for(java.io.File c:b)B+=new java.util.Scanner(c).useDelimiter("\\Z").next();for(int c=0;c++<B.length;)if(B.charAt(c)>64&B.charAt(c)<91)B=B.replace(B.charAt(c),B.charAt(c)|32);return B;};
</code>```

You are forced to use the above lambda with files, so there's no need to take input from STDIN! Also, it's a Function<File[], UnaryOperator<String>>. It's used like foo.apply(anArrayOfFiles).apply(anything).

As something that makes more sense to those who are new to Java, it takes 223 bytes:

```<code>String A(java.io.File[]b){String B="";for(java.io.File c:b)B+=new java.util.Scanner(c).useDelimiter("\\Z").next();for(int c=0;c++<B.length;)if(B.charAt(c)>64&B.charAt(c)<91)B=B.replace(B.charAt(c),B.charAt(c)|32);return B;}
</code>```

As something that compiles, it takes up 232 bytes:

```<code>class a{String A(java.io.File[]b){String B="";for(java.io.File c:b)B+=new java.util.Scanner(c).useDelimiter("\\Z").next();for(int c=0;c++<B.length;)if(B.charAt(c)>64&B.charAt(c)<91)B=B.replace(B.charAt(c),B.charAt(c)|32);return B;}}
</code>```

Title: The kitten command

Body:
Java, 198 bytes

b->B->{B="";for(java.io.File c:b)B+=new java.util.Scanner(c).useDelimiter("\\Z").next();for(int c=0;c++<B.length;)if(B.charAt(c)>64&B.charAt(c)<91)B=B.replace(B.charAt(c),B.charAt(c)|32);return B;};

You are forced to use the above lambda with files, so there's no need to take input from STDIN! Also, it's a Function<File[], UnaryOperator<String>>. It's used like foo.apply(anArrayOfFiles).apply(anything).

As something that makes more sense to those who are new to Java, it takes 223 bytes:

String A(java.io.File[]b){String B="";for(java.io.File c:b)B+=new java.util.Scanner(c).useDelimiter("\\Z").next();for(int c=0;c++<B.length;)if(B.charAt(c)>64&B.charAt(c)<91)B=B.replace(B.charAt(c),B.charAt(c)|32);return B;}

As something that compiles, it takes up 232 bytes:

class a{String A(java.io.File[]b){String B="";for(java.io.File c:b)B+=new java.util.Scanner(c).useDelimiter("\\Z").next();for(int c=0;c++<B.length;)if(B.charAt(c)>64&B.charAt(c)<91)B=B.replace(B.charAt(c),B.charAt(c)|32);return B;}}


问:
Array Escape - get out of there
One day you awake only to find yourself caught in an array. You try to just walk out of there, taking one index at the time, but it seems there are other rules:

The array is completely filled with natural numbers.

If you find yourself on an index n, you go to the index array[n], except:

If you find yourself on an index n which is a prime number, you take array[n] steps back

Example:
You start on index 4, in this array (start index is 0):

```<code>array = [1,4,5,6,8,10,14,15,2,2,4,5,7];
-----------------^ you are here
</code>```

As the value of the field you are on is 8, you go to the index 8 as the first step. The field you land on contains the value 2. You then go to index 2 as your second step. As2is a prime number, you take 5 steps back, which is your third step. As there is no index -3, you successfully escaped the array in a total of 3 steps.

Your task is:

To write a program or function, which accepts an array and a start index as parameter, and outputs the amount of steps to escape the array. If you can't escape the array (e.g. [2,0,2] with start-index 2 => you constantly go from index 2 to 0), output a falsy value. You may use one-based indexing or zero-based indexing, but please specify which you use.

Test cases

Input: [2,5,6,8,1,2,3], 3

Output: 1

Input: [2, 0, 2], 2

Output: false

Input: [14,1,2,5,1,3,51,5,12,3,4,41,15,4,12,243,51,2,14,51,12,11], 5;

Output: 6

The shortest answer wins.

答:
Pyth, 31 Bytes

```<code>KlQ%tl-.u?}NUK?P_N-N@QN@QNKQEKK
</code>```

The test cases

It uses zero to indicate a false value, the number of hops otherwise.

Title: Array Escape - get out of there

Body:
Pyth, 31 Bytes

KlQ%tl-.u?}NUK?P_N-N@QN@QNKQEKK

The test cases

It uses zero to indicate a false value, the number of hops otherwise.


问:
Product over a range
Your task is simple: given two integers \$a\$ and \$b\$, output \$\Pi[a,b]\$; that is, the product of the range between \$a\$ and \$b\$. You may take \$a\$ and \$b\$ in any reasonable format, whether that be arguments to a function, a list input, STDIN, et cetera. You may output in any reasonable format, such as a return value (for functions) or STDOUT. \$a\$ will always be less than \$b\$.

Note that the end may be exclusive or inclusive of \$b\$. I'm not picky. ^_^

Test cases

```<code>[a,b) => result
[2,5) => 24
[5,10) => 15120
[-4,3) => 0
[0,3) => 0
[-4,0) => 24

[a,b] => result
[2,5] => 120
[5,10] => 151200
[-4,3] => 0
[0,3] => 0
[-4,-1] => 24
</code>```

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

Leaderboard

The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

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 snippet:

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

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

```

答:
C#, 56 Bytes

```<code>int f(int a,int b){var r=1;for(;a<b;a++)r*=a;return r;}
</code>```

ContentLicense: CC BY-SA 4.0

Title: Product over a range

Body:
C#, 56 Bytes

int f(int a,int b){var r=1;for(;a<b;a++)r*=a;return r;}


答:
Excel, 37 bytes

```<code>=PRODUCT(A2-ROW(OFFSET(A1,,,A2-A1)))
</code>```

Data will be a in A1 and b in A2.

The above should be entered as an array formula (ctrl_shift_enter) in any other cell. The result is exclusive of b.

Title: Product over a range

Body:
Your task is simple: given two integers \$a\$ and \$b\$, output \$\Pi[a,b]\$; that is, the product of the range between \$a\$ and \$b\$. You may take \$a\$ and \$b\$ in any reasonable format, whether that be arguments to a function, a list input, STDIN, et cetera. You may output in any reasonable format, such as a return value (for functions) or STDOUT. \$a\$ will always be less than \$b\$.

Note that the end may be exclusive or inclusive of \$b\$. I'm not picky. ^_^

Test cases

```<code>[a,b) => result
[2,5) => 24
[5,10) => 15120
[-4,3) => 0
[0,3) => 0
[-4,0) => 24

[a,b] => result
[2,5] => 120
[5,10] => 151200
[-4,3] => 0
[0,3] => 0
[-4,-1] => 24
</code>```

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

Leaderboard

The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

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 snippet:

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

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

=PRODUCT(A2-ROW(OFFSET(A1,,,A2-A1)))

Data will be a in A1 and b in A2.

The above should be entered as an array formula (ctrl_shift_enter) in any other cell. The result is exclusive of b.


问:
Can Mario go to the end of this map
Create a program that determines, given an input of the path, whether Mario can reach the end, denoted by E, from the start, denoted by S.

A path will look something like this:

```<code>S = E
=====
</code>```

In a path, the various symbols and what they represent are:

=: wall/floor/ceiling. Mario cannot walk through wall , and cannot fall past a floor, or jump past a ceiling (he would hit his head)

  (space): air. Mario can walk through this, and jump through it, and fall through it

S: air, except showing where Mario starts. This will always appear in the left-most column of the input, at ground level.

E: air, except showing where Mario wants to get. This will always appear in the right-most column of the input, at ground level.

The input will have spaces at every place where Mario could walk.

Mario can only move forward; in this example Mario cannot get to the goal

```<code>S
===

 ===
   E
====
</code>```

nor can he in this one

```<code>    E
   ==
==
  #==
==
   ==
==
S  ==
======
</code>```

However, he can reach the space denoted by # (which will not appear in input), because he can jump up to four cells high; Mario is superhuman. As another example of his superhumanity:

```<code>S
=
=
=
=
=
= #
= =
=
=
=
=     E
=======
</code>```

Mario can get to the E by falling the great distance, surviving, and walking calmly to E. Note that he cannot reach the #, because Mario falls straight down.

Mario can jump really high, but not very far forward by comparison.

```<code>S   E
== ==
 = =
</code>```

Mario may attempt to jump the gap, but he will fail, and fall straight in. he cannot reach the end.

Mario can reach the goal in all of these examples:

```<code> E
 =
 =
 =
S=
==
</code>```

```<code> =
 =   E
S=   =
==   =
 =   =
 =====
</code>```

```<code>S
=

=  E
====
</code>```

This is code golf, so fewest bytes wins!

答:
Ruby, <s>153</s> 147 bytes

Sorry, Java... your spot as best non-golf lang for the job is being taken over!

Input is a list of column strings, prepended with a single space in the style of how the Slip and Snails solutions require their inputs to be padded with a rectangle of empty space.

Try it online!

```<code>f=->m,j=0,s=p{c,n=m[j,2]
s||=c=~/S/
e=c=~/E/
s+=1 while(k=c[s+1])&&k!=?=
s==e||(0..4).any?{|i|k&&s>=i&&c[s-i,i]!~/=/&&n&&n[s-i]!=?=&&f[m,j+1,s-i]}}
</code>```

Title: Can Mario go to the end of this map

Body:
Ruby, <s>153</s> 147 bytes

Sorry, Java... your spot as best non-golf lang for the job is being taken over!

Input is a list of column strings, prepended with a single space in the style of how the Slip and Snails solutions require their inputs to be padded with a rectangle of empty space.

Try it online!

f=->m,j=0,s=p{c,n=m[j,2]
s||=c=~/S/
e=c=~/E/
s+=1 while(k=c[s+1])&&k!=?=
s==e||(0..4).any?{|i|k&&s>=i&&c[s-i,i]!~/=/&&n&&n[s-i]!=?=&&f[m,j+1,s-i]}}


问:
Transposed, primes, oh my!
The task is simple: your program reads an integer as an input, and prints whether it is a prime or not. You can print "yes/no", "true/false" or anything what unambiguously identifies the result.

The challenge is, the code has to work with its rows and columns transposed.

To exclude the obvious solution (shortest "simple" solution repeated vertically char-by-char with the use of comments), the metric is a little bit different from the usual code-golf:

Because formatting is very important in this challenge, the code size is measured in the area of the smallest rectangle the code fits in. In other words, whitespace does count, and the lines should be filled to be of equal length (you don't have to actually do it when you post the solution, for simplicity's sake). For example

```<code>int main()
{
    return 0;
}
</code>```

would have a size of 4*13 = 52, (and obviously it does not fit either of the two criteria: prime detection and transposable.)

Smallest size wins.

You can use any language, and any library function except if the sole purpose of that function is to find, generate, or detect primes.

Edit:

While the winner would probably be the Golfscript solution, I'll award a 50 point bounty for the best C or C++ solution!

答:
C, 12x12 chars

A two-dimensional solution, unlike my other answer, based on the same code (and like it, prints y for prime, nothing for composite).

The structure is similar to Quasimodo's answer, but my code is shorter, and I think my usage of comemnts is a bit more efficient, so I can fit 12x12.

```<code>////m()s";np
////am{c%n>u
////i,fad%1t
////nnon"+;s
main//rf,+)(
(m,n//((&m;"
){for(//n&ny
scanf(//)&-"
"%d",&n)//m)
;n%++m&&//|;
n>1;);n-m||
puts("y"); }
</code>```

Title: Transposed, primes, oh my!

Body:
C, 12x12 chars

A two-dimensional solution, unlike my other answer, based on the same code (and like it, prints y for prime, nothing for composite).

The structure is similar to Quasimodo's answer, but my code is shorter, and I think my usage of comemnts is a bit more efficient, so I can fit 12x12.

////m()s";np
////am{c%n>u
////i,fad%1t
////nnon"+;s
main//rf,+)(
(m,n//((&m;"
){for(//n&ny
scanf(//)&-"
"%d",&n)//m)
;n%++m&&//|;
n>1;);n-m||
puts("y"); }


问:
Missing Integer Sequence Detection -- Filesystem
The challenge is to detect missing integer sequences of files or directories. You have a directory filled with files/directories that are named as integers.

The files/directories are generated from multiple threads yet the job did not complete - there are therefore gaps in the sequence.

The input is two integers a start and an end, and your task is detect the starting integer of the next missing sequences. You may presume that all files and directories in the directory where run have only integer named files or directories.

Acceptable answer forms: functions, code snippets - they must run on the command line.

Acceptable start/end input: included on the command line, env variables/argv are okay, parameters to functions, user input is okay.

Shortest code wins.

Update -- Although I managed to squeeze out this one, there were many interesting answers. The idea in apricotboy's Bash answer was used in part to help me design my 35 Byte Bash answer. Best of luck on the next one.

```<code>E.g. Presume files 1,2,3,4,7,8,9,10,18 are present, start is 1, end is 20:

The output should be:
5
11
19
</code>```

答:
Ruby, <s>74</s> <s>60</s> 45 bytes

Input is in command line, run it like ruby f.rb 0 20. Only works in current directory.

-1 byte from unpacking the ARGV into variables, and -13 bytes from replacing the select and grep with a set subtraction.

V3: -5 bytes from using a substitution for Dir.glob in an old Ruby answer to another filesystems challenge, as suggested by @PatrickOscity. -10 from remembering some quirks in Ruby's String#next function.

```<code>a,b=$*
f=[*a..b]-Dir[?*]
puts f-f.map(&:next)
</code>```

Body:
Ruby, <s>74</s> <s>60</s> 45 bytes

Input is in command line, run it like ruby f.rb 0 20. Only works in current directory.

-1 byte from unpacking the ARGV into variables, and -13 bytes from replacing the select and grep with a set subtraction.

V3: -5 bytes from using a substitution for Dir.glob in an old Ruby answer to another filesystems challenge, as suggested by @PatrickOscity. -10 from remembering some quirks in Ruby's String#next function.

a,b=$*
f=[*a..b]-Dir[?*]
puts f-f.map(&:next)


问:
Count sum of all digits
This challenge is to write a program or script which counts the sum of all digits within the integers from 1 up to and including a given number.

Input, one positive integer.
Output, the sum of digits in that number and all smaller numbers.

Examples:

```<code>Input: 5
Integer Sequence: 1, 2, 3, 4, 5
Sum of Digits: 1 + 2 + 3 + 4 + 5 = 15

Input: 12
Integer Sequence: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Sum of Digits: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 = 51
</code>```

To be clear, this is to count a sum of the digits - not the integers. For single-digit inputs, this will be the same. However, inputs larger than 10 will have different responses. This would be an incorrect response:

```<code>Input: 12
Output: 78
</code>```

Another example, to show the difference:

```<code>Input: 10

Integer Sequence: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Sum of Integers (INCORRECT RESPONSE): 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55

Digit Sequence: 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0
Sum of Digits (CORRECT RESPONSE): 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 = 46
</code>```

A larger test case (CORRECT RESPONSE):

```<code>Input: 1000000
Output: 27000001
</code>```

Rules & Guidelines:

Submitted code must be a complete program or script - not just a function. If the code requires includes, imports, etc., they must be included in the posted code.

The number must be input by the user - not hard-coded. Input may be received as a command-line argument, file, stdin, or any other means by which your language can take user input.

The code must be able to properly handle inputs at least up to (2^64)-1.

The code should only output the sum.

Submitted programs & scripts should be user-friendly and not wasteful of computer resources (e.g.: they should not declare insanely-large arrays to hold every character). There is no strict bonus or penalty for this, but please be good programmers.

Scoring:

Primary scoring mechanism is by code length. Lower scores are better. The following bonuses and penalties also apply:

-25 Bonus if your code can handle all positive numbers, for example: 1234567891234567891234564789087414984894900000000

-50 Bonus if your code can handle simple expressions, for example 55*96-12. To qualify for this bonus, the code should handle + - / * (addition, subtraction, division, multiplication) operators and enforce order of operations. Division is regular integer division.

The given example (55*96-12) evaluates to 5268. Your code should return the same for either of those inputs - correct answer is 81393.

-10 Bonus if your code qualifies for the -50 bonus and can handle the ^ (exponent) operator.

-100 Bonus if your code qualifies for the -50 bonus and does not use eval or similar to handle expressions.

+300 Penalty if your code relies upon any web resources.

答:
PHP 4.1, 88-25-50=13 bytes

call in a web browser or with php-cgi; n as argument

```<code><?for(eval('$i=$n;');$i;$i=bcsub($i,1))foreach(str_split($i)as$d)$s=bcadd($s,$d);echo$s;
</code>```

Use PHP 4.1 to get off -6 of any of the current PHP versions by using $n instead of $argv[1].

current PHP: call from cli with number or calculation string as argument 1

PHP, 94-25-50=19 bytes

```<code><?for(eval('$i=$argv[1];');$i;$i=bcsub($i,1))foreach(str_split($i)as$d)$s=bcadd($s,$d);echo$s;
</code>```

69-50=19

```<code><?for(eval('$i=$argv[1];');$i;)$s+=array_sum(str_split($i--));echo$s;
</code>```

92-50-10=32 bytes

```<code><?for(eval(str_replace('^','**',"\$i=$argv[1];"));$i;)$s+=array_sum(str_split($i--));echo$s;
</code>```

201-50-10-100=41 bytes *

```<code><?for($i=$argv[1];$p='^*/+-'[$k++];)while(preg_match("#(\d+)\\$p(\d+)#",$s,$m)){list(,$a,$b)=$m;$i=[42=>$a*$b,$a+$b,0,$a-$b,0,$a/$b,94=>$a**$b][ord($p)];}for(;$i;)$s+=array_sum(str_split($i--));echo$s;
</code>```

60-0 bytes

```<code><?for($i=$argv[1];$i;)$s+=array_sum(str_split($i--));echo$s;
</code>```

260-25-50-10-100=75 bytes *

```<code><?for($i=$argv[1];$p='^*/+-'[$k++];)while(preg_match("#(\d+)\\$p(\d+)#",$s,$m)){list(,$a,$b)=$m;$i=[42=>bcmul($a,$b),bcadd($a+$b),0,bcsub($a-$b),0,bcdiv($a,$b),94=>bcpow($a,$b)][ord($p)];}for(;$i;$i=bcsub($i,1))foreach(str_split($i)as$d)$s=bcadd($s,$d);echo$s;
</code>```

x-25-50-10: yet to come ... find a golfable way to translate concatenated apbs to nested p(a,b)s. Or ... does preg_replace_callback qualify as eval?

* with PHP<5.3, you can use ereg("([0-9]+)\\$p([0-9]+)",$s,$m) instead of preg_match("#(\d+)\\$p(\d+)#",$s,$m) (-2 bytes)

breakdown for the last version

```<code>for($i=$argv[1];        # take string from argument 1
    $p='^*/+-'[$k++];)  # loop $p through operators in descending precedence
    # while operator (with two operands) is found in string ...
    while(preg_match("#(\d+)\\$p(\d+)#",$s,$m))
    {
        # get operators to $a and $b
        list(,$a,$b)=$m;
        # create an array of all operation results (key=ascii code of operator)
        # (may throw division by zero warnings)
        $i=[42=>bcmul($a,$b),bcadd($a+$b),0,bcsub($a-$b),0,bcdiv($a,$b),94=>bcpow($a,$b)]
        # and take the one matching the current operation
        [ord($p)];
    }
for(;$i;$i=bcsub($i,1))         # loop $i down to 1
    foreach(str_split($i)as$d)  # loop $d through digits
        $s=bcadd($s,$d);        # sum up
echo$s;                         # and print sum
</code>```

Title: Count sum of all digits

Body:
PHP 4.1, 88-25-50=13 bytes

call in a web browser or with php-cgi; n as argument

<?for(eval('$i=$n;');$i;$i=bcsub($i,1))foreach(str_split($i)as$d)$s=bcadd($s,$d);echo$s;

Use PHP 4.1 to get off -6 of any of the current PHP versions by using $n instead of $argv[1].

current PHP: call from cli with number or calculation string as argument 1

PHP, 94-25-50=19 bytes

<?for(eval('$i=$argv[1];');$i;$i=bcsub($i,1))foreach(str_split($i)as$d)$s=bcadd($s,$d);echo$s;

69-50=19

<?for(eval('$i=$argv[1];');$i;)$s+=array_sum(str_split($i--));echo$s;

92-50-10=32 bytes

<?for(eval(str_replace('^','**',"\$i=$argv[1];"));$i;)$s+=array_sum(str_split($i--));echo$s;

201-50-10-100=41 bytes *

<?for($i=$argv[1];$p='^*/+-'[$k++];)while(preg_match("#(\d+)\\$p(\d+)#",$s,$m)){list(,$a,$b)=$m;$i=[42=>$a*$b,$a+$b,0,$a-$b,0,$a/$b,94=>$a**$b][ord($p)];}for(;$i;)$s+=array_sum(str_split($i--));echo$s;

60-0 bytes

<?for($i=$argv[1];$i;)$s+=array_sum(str_split($i--));echo$s;

260-25-50-10-100=75 bytes *

<?for($i=$argv[1];$p='^*/+-'[$k++];)while(preg_match("#(\d+)\\$p(\d+)#",$s,$m)){list(,$a,$b)=$m;$i=[42=>bcmul($a,$b),bcadd($a+$b),0,bcsub($a-$b),0,bcdiv($a,$b),94=>bcpow($a,$b)][ord($p)];}for(;$i;$i=bcsub($i,1))foreach(str_split($i)as$d)$s=bcadd($s,$d);echo$s;

x-25-50-10: yet to come ... find a golfable way to translate concatenated apbs to nested p(a,b)s. Or ... does preg_replace_callback qualify as eval?

* with PHP<5.3, you can use ereg("([0-9]+)\\$p([0-9]+)",$s,$m) instead of preg_match("#(\d+)\\$p(\d+)#",$s,$m) (-2 bytes)

breakdown for the last version

for($i=$argv[1];        # take string from argument 1
    $p='^*/+-'[$k++];)  # loop $p through operators in descending precedence
    # while operator (with two operands) is found in string ...
    while(preg_match("#(\d+)\\$p(\d+)#",$s,$m))
    {
        # get operators to $a and $b
        list(,$a,$b)=$m;
        # create an array of all operation results (key=ascii code of operator)
        # (may throw division by zero warnings)
        $i=[42=>bcmul($a,$b),bcadd($a+$b),0,bcsub($a-$b),0,bcdiv($a,$b),94=>bcpow($a,$b)]
        # and take the one matching the current operation
        [ord($p)];
    }
for(;$i;$i=bcsub($i,1))         # loop $i down to 1
    foreach(str_split($i)as$d)  # loop $d through digits
        $s=bcadd($s,$d);        # sum up
echo$s;                         # and print sum


问:
Is this number a prime?
Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in many languages.

Rosetta code features lists by language of idiomatic approaches to primality testing, one using the Miller-Rabin test specifically and another using trial division. However, "most idiomatic" often does not coincide with "shortest." In an effort to make Programming Puzzles and Code Golf the go-to site for code golf, this challenge seeks to compile a catalog of the shortest approach in every language, similar to "Hello, World!" and Golf you a quine for great good!.

Furthermore, the capability of implementing a primality test is part of our definition of programming language, so this challenge will also serve as a directory of proven programming languages.

Task

Write a full program that, given a strictly positive integer n as input, determines whether n is prime and prints a truthy or falsy value accordingly.

For the purpose of this challenge, an integer is prime if it has exactly two strictly positive divisors. Note that this excludes 1, who is its only strictly positive divisor.

Your algorithm must be deterministic (i.e., produce the correct output with probability 1) and should, in theory, work for arbitrarily large integers. In practice, you may assume that the input can be stored in your data type, as long as the program works for integers from 1 to 255.

Input

If your language is able to read from STDIN, accept command-line arguments or any other alternative form of user input, you can read the integer as its decimal representation, unary representation (using a character of your choice), byte array (big or little endian) or single byte (if this is your languages largest data type).

If (and only if) your language is unable to accept any kind of user input, you may hardcode the input in your program.

In this case, the hardcoded integer must be easily exchangeable. In particular, it may appear only in a single place in the entire program.

For scoring purposes, submit the program that corresponds to the input 1.

Output

Output has to be written to STDOUT or closest alternative.

If possible, output should consist solely of a truthy or falsy value (or a string representation thereof), optionally followed by a single newline.

The only exception to this rule is constant output of your language's interpreter that cannot be suppressed, such as a greeting, ANSI color codes or indentation.

Additional rules

This is not about finding the language with the shortest approach for prime testing, this is about finding the shortest approach in every language. Therefore, no answer will be marked as accepted.

Submissions in most languages will be scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8.

The language Piet, for example, will be scored in codels, which is the natural choice for this language.

Some languages, like Folders, are a bit tricky to score. If in doubt, please ask on Meta.

Unlike our usual rules, feel free to use a language (or language version) even if it's newer than this challenge. If anyone wants to abuse this by creating a language where the empty program performs a primality test, then congrats for paving the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck derivatives like Headsecks or Unary), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

Built-in functions for testing primality are allowed. This challenge is meant to catalog the shortest possible solution in each language, so if it's shorter to use a built-in in your language, go for it.

Unless they have been overruled earlier, all standard code-golf rules apply, including the http://meta.codegolf.stackexchange.com/q/1061.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf; these are still useful to this question as it tries to compile a catalog as complete as possible. However, do primarily upvote answers in languages where the author actually had to put effort into golfing the code.

Catalog

The Stack Snippet at the bottom of this post generates the catalog from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

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 snippet:

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

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
brainfuck, 62 bytes

```<code>,-[+[<+>>+<-]>[-<[>+<-]<[>+>->+<[>]>[<+>-]<<[<]>-]>>>]<-[<]]<.
</code>```

This is a port of my Sesos answer. Input and output are character-based. For a character whose code point is prime, the program will print the character itself; otherwise, it will print NUL.

Try it online!

Title: Is this number a prime?

Body:
brainfuck, 62 bytes

,-[+[<+>>+<-]>[-<[>+<-]<[>+>->+<[>]>[<+>-]<<[<]>-]>>>]<-[<]]<.

This is a port of my Sesos answer. Input and output are character-based. For a character whose code point is prime, the program will print the character itself; otherwise, it will print NUL.

Try it online!


答:
Python 2, 101 bytes

2 bytes thanks to @xnor.

import os
t=-1
for n in range(input(),input()+1):
 if~-os.path.isfile(str(n)):
  if~t+n:print n
  t=n
```

Title: Missing Integer Sequence Detection -- Filesystem

Body:
The challenge is to detect missing integer sequences of files or directories. You have a directory filled with files/directories that are named as integers.

The files/directories are generated from multiple threads yet the job did not complete - there are therefore gaps in the sequence.

The input is two integers a start and an end, and your task is detect the starting integer of the next missing sequences. You may presume that all files and directories in the directory where run have only integer named files or directories.

Acceptable answer forms: functions, code snippets - they must run on the command line.

Acceptable start/end input: included on the command line, env variables/argv are okay, parameters to functions, user input is okay.

Shortest code wins.

Update -- Although I managed to squeeze out this one, there were many interesting answers. The idea in apricotboy's Bash answer was used in part to help me design my 35 Byte Bash answer. Best of luck on the next one.

```<code>E.g. Presume files 1,2,3,4,7,8,9,10,18 are present, start is 1, end is 20:

The output should be:
5
11
19
</code>```


答:
Dyalog APL, <s>25</s> 24 or 36 bytes

Prompts for lower bound, then upper bound.

It seems from comments to other answers  that the OP wanted as short sequences as possible.

```<code>{⍵/⍨~⍵∊⍨⍵-1}((⍳⎕)~⍳⎕-1)~⍎¨⎕SH'dir/b'
</code>```

{

    ⍵/⍨ those where it is

    ~ not true

    ⍵∊⍨ that the set contains

    ⍵-1 their predecessor

} of

(

    (⍳⎕) of the integers until n

    ~ except

    ⍳⎕-1 integers until n-1

)~ except

⍎¨ the evaluation of each of

⎕SH'dir/b' the bare list of names in the current directory

Old answer which returns length-1 sequences:

```<code>(⍕¨(⍳⎕)~⍳⎕-1)~⎕SH'dir/b'
</code>```

(

    ⍕ string representation

    ¨ of each

    (⍳⎕) of the integers until n

    ~ except

    ⍳⎕-1 integers until n-1

)~ except

⎕SH'dir/b' the bare list of files in current directory

Only works on Windows. A cross platform solution:

```<code>(⍕¨(⍳⎕)~⍳⎕-1)~0⎕NINFO⍠1⊢'*'
</code>```

0 just the filename(s)

⎕NINFO of the Native file(s) INFOrmation

⍠1 using wildcards

⊢'*' on all files

Body:
Dyalog APL, <s>25</s> 24 or 36 bytes

Prompts for lower bound, then upper bound.

It seems from comments to other answers  that the OP wanted as short sequences as possible.

{⍵/⍨~⍵∊⍨⍵-1}((⍳⎕)~⍳⎕-1)~⍎¨⎕SH'dir/b'

{

    ⍵/⍨ those where it is

    ~ not true

    ⍵∊⍨ that the set contains

    ⍵-1 their predecessor

} of

(

    (⍳⎕) of the integers until n

    ~ except

    ⍳⎕-1 integers until n-1

)~ except

⍎¨ the evaluation of each of

⎕SH'dir/b' the bare list of names in the current directory

Old answer which returns length-1 sequences:

(⍕¨(⍳⎕)~⍳⎕-1)~⎕SH'dir/b'

(

    ⍕ string representation

    ¨ of each

    (⍳⎕) of the integers until n

    ~ except

    ⍳⎕-1 integers until n-1

)~ except

⎕SH'dir/b' the bare list of files in current directory

Only works on Windows. A cross platform solution:

(⍕¨(⍳⎕)~⍳⎕-1)~0⎕NINFO⍠1⊢'*'

0 just the filename(s)

⎕NINFO of the Native file(s) INFOrmation

⍠1 using wildcards

⊢'*' on all files


问:
Golf the Subset-Sum Problem

Task

Given a list of space-delimited integers as input, output all unique non-empty subsets of these numbers that each subset sums to 0.

Test Case

Input:  8 −7 5 −3 −2

Output: -3 -2 5

Winning Criterion

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

Title: Golf the Subset-Sum Problem

Body:
GolfScript, 41 characters

~][[]]\{`{1$+$}+%}%;(;.&{{+}*!},{" "*}%n*

If you do not care about the specific output format you can shorten the code to 33 characters.

~][[]]\{`{1$+$}+%}%;(;.&{{+}*!},`

Example (see online):

> 8 -7 5 -3 -2 4
-3 -2 5
-7 -2 4 5
-7 -3 -2 4 8


答:
JavaScript (ES6), 35 bytes

```<code>s=>s.filter(c=>(s[c]=(s[c]|0)+1)<3)
</code>```

Takes an array of characters as input and returns the detriplicated array.

Title: Detriplicate a string

Body:
A lot of languages have built-in ways to get rid of duplicates, or "deduplicate" or "uniquify" a list or string. A less common task is to "detriplicate" a string. That is, for every character that appears, the first two occurrences are kept.

Here is an example where the characters that should be deleted are labelled with ^:

```<code>aaabcbccdbabdcd
  ^    ^ ^^^ ^^
aabcbcdd
</code>```

Your task is to implement exactly this operation.

Rules

Input is a single, possibly empty, string. You may assume that it only contains lowercase letters in the ASCII range.

Output should be a single string with all characters removed which have already appeared at least twice in the string (so the left-most two occurrences are kept).

Instead of strings you may work with lists of characters (or singleton strings), but the format has to be consistent between input and output.

You may write a program or a function and use any of the our standard methods of receiving input and providing output.

You may use any programming language, but note that these loopholes are forbidden by default.

This is code-golf, so the shortest valid answer – measured in bytes – wins.

Test Cases

Every pair of lines is one test case, input followed by output.

```<code>

xxxxx
xx
abcabc
abcabc
abcdabcaba
abcdabc
abacbadcba
abacbdc
aaabcbccdbabdcd
aabcbcdd
</code>```

Leaderboard

The Stack Snippet at the bottom of this post generates a leaderboard from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

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 + 3 (-p flag) = 45 bytes
</code>```

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

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

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

Body:
JavaScript (ES6), 35 bytes

s=>s.filter(c=>(s[c]=(s[c]|0)+1)<3)

Takes an array of characters as input and returns the detriplicated array.


答:
PHP, 64 bytes

```<code><?=implode("\n",array_diff(range($argv[1],$argv[2]),glob("*")));
</code>```

Run like this:

```<code>php -f golf.php 1 20
</code>```

Note:

Only does the current directory.

No trailing newline on the output.

This requires the <?= to be allowed in php.ini. Which I think is default but I'm not sure.

Bash, 31 bytes

```<code>a(){(seq $@;ls)|sort|uniq -u;}
</code>```

Run as a 1 20. Again, only does the current dir.

Can I submit two? Hope so. This is my first post to Code Golf so I'm not too sure of the etiquette. Hope I'm counting my bytes correctly, too.

Body:
PHP, 64 bytes

<?=implode("\n",array_diff(range($argv[1],$argv[2]),glob("*")));

Run like this:

php -f golf.php 1 20

Note:

Only does the current directory.

No trailing newline on the output.

This requires the <?= to be allowed in php.ini. Which I think is default but I'm not sure.

Bash, 31 bytes

a(){(seq $@;ls)|sort|uniq -u;}

Run as a 1 20. Again, only does the current dir.

Can I submit two? Hope so. This is my first post to Code Golf so I'm not too sure of the etiquette. Hope I'm counting my bytes correctly, too.


答:
Common Lisp, 127

```<code>(lambda(s)(map()(lambda(x)(flet((p(b)(1+(position x s :start b))))(setf s(remove x s :start(p(p 0))))))(remove-duplicates s))s)
</code>```

Pretty-printed

```<code>(lambda (s)
  (map nil
       (lambda (x)
         (flet ((p (b)
                  (1+ (position x s :start b))))
           (setf s (remove x s :start (p (p 0))))))
       (remove-duplicates s))
  s)
</code>```

Title: Detriplicate a string

Body:
Common Lisp, 127

(lambda(s)(map()(lambda(x)(flet((p(b)(1+(position x s :start b))))(setf s(remove x s :start(p(p 0))))))(remove-duplicates s))s)

Pretty-printed

(lambda (s)
  (map nil
       (lambda (x)
         (flet ((p (b)
                  (1+ (position x s :start b))))
           (setf s (remove x s :start (p (p 0))))))
       (remove-duplicates s))
  s)


Title: Print this Multiplication Table

Body:
Write shortest code to print the following Multiplication Table:</p>

```<code>1×1=1
1×2=2  2×2=4
1×3=3  2×3=6  3×3=9
1×4=4  2×4=8  3×4=12 4×4=16
1×5=5  2×5=10 3×5=15 4×5=20 5×5=25
1×6=6  2×6=12 3×6=18 4×6=24 5×6=30 6×6=36
1×7=7  2×7=14 3×7=21 4×7=28 5×7=35 6×7=42 7×7=49
1×8=8  2×8=16 3×8=24 4×8=32 5×8=40 6×8=48 7×8=56 8×8=64
1×9=9  2×9=18 3×9=27 4×9=36 5×9=45 6×9=54 7×9=63 8×9=72 9×9=81
</code>```

Body:
x86_64 machine code (linux), <s>175</s> <s>99</s> 76 bytes

0000000000400080 <_start>:
  400080:   66 bf 09 00             mov    $0x9,%di

0000000000400084 <_table.L2>:
  400084:   6a 0a                   pushq  $0xa
  400086:   89 fe                   mov    %edi,%esi

0000000000400088 <_table.L3>:
  400088:   89 f0                   mov    %esi,%eax
  40008a:   f7 e7                   mul    %edi

000000000040008c <_printInteger>:
  40008c:   6a 20                   pushq  $0x20
  40008e:   3c 0a                   cmp    $0xa,%al
  400090:   7d 02                   jge    400094 <_printInteger.L1>
  400092:   6a 20                   pushq  $0x20

0000000000400094 <_printInteger.L1>:
  400094:   66 31 d2                xor    %dx,%dx
  400097:   b3 0a                   mov    $0xa,%bl
  400099:   66 f7 f3                div    %bx
  40009c:   83 c2 30                add    $0x30,%edx
  40009f:   52                      push   %rdx
  4000a0:   66 85 c0                test   %ax,%ax
  4000a3:   75 ef                   jne    400094 <_printInteger.L1>
  4000a5:   6a 3d                   pushq  $0x3d
  4000a7:   66 57                   push   %di
  4000a9:   80 04 24 30             addb   $0x30,(%rsp)
  4000ad:   6a 78                   pushq  $0x78
  4000af:   66 56                   push   %si
  4000b1:   80 04 24 30             addb   $0x30,(%rsp)
  4000b5:   ff ce                   dec    %esi
  4000b7:   75 cf                   jne    400088 <_table.L3>
  4000b9:   ff cf                   dec    %edi
  4000bb:   75 c7                   jne    400084 <_table.L2>

00000000004000bd <_printChars>:
  4000bd:   66 ba 00 08             mov    $0x800,%dx
  4000c1:   b0 01                   mov    $0x1,%al
  4000c3:   66 bf 01 00             mov    $0x1,%di
  4000c7:   48 89 e6                mov    %rsp,%rsi
  4000ca:   0f 05                   syscall

<s>This is a dump of the binary file, and all of this is 175 bytes. It basically does the same two loops that all the answers do, but printing to the console is a bit harder and basically requires pushing the characters to print onto the stack in reverse, and then making a (linux specific) syscall to actually put those chars into stdout.</s>

I've now optimized this so that only 1 write operation is performed (faster!) and has magic numbers (wow!) and by pushing the entire result onto the stack backwards before making the syscall. I also took out the exit routine because who needs proper exit code?

Here's a link to my first and second attempts, in their original nasm syntax.

I welcome anyone who has any other suggestions on how it can be improved. I can also explain the logic in more detail if anyone is curious.

<s>(Also, it doesn't print the extra spaces to make all the columns aligned, but if that's required I can put the logic in at the cost of a few more bytes).</s>

EDIT: Now prints extra spaces and is golfed down even more! It's doing some pretty crazy stuff with the registers, and is probably unstable if this program were to be expanded.


问:
Output a Magical 8 Trapezium
Your task is to output a Magical 8 Trapezium:

```<code>        1 × 8 + 1 = 9
       12 × 8 + 2 = 98
      123 × 8 + 3 = 987
     1234 × 8 + 4 = 9876
    12345 × 8 + 5 = 98765
   123456 × 8 + 6 = 987654
  1234567 × 8 + 7 = 9876543
 12345678 × 8 + 8 = 98765432
123456789 × 8 + 9 = 987654321
</code>```

Output in your chosen language in the fewest bytes possible.

Note the number of spaces at the start of each line to maintain the trapezium shape.

Trailing spaces are allowed.

You can use × or the letter x - whichever you prefer.

答:
Java 10, <s>151</s> <s>133</s> <s>130</s> <s>129</s> <s>126</s> 110 bytes

v->{String p="\n",r="";for(int n=123456789,i=9;i>0;n/=10,p+=" ")r=p+n+" x 8 + "+i+" = "+(n*8+i--)+r;return r;}
```
<p>Try it online.</p>
<p><strong>Explanation:</strong></p>
<pre class="lang-java prettyprint-override"><code>v->{                   // Method with empty unused parameter and String return-type
  String p="\n",       //  Prefix-String, starting at a newline
         r="";         //  Result-String, starting empty
  for(int n=123456789, //  Multiply-number, starting at 123456789
      i=9;i>0          //  Loop `i` in the range [9, 0):
      ;                //    After every iteration:
       n/=10,          //     Remove the last digit from the integer
       p+=" ")         //     Append a space after the prefix
    r=...+r;           //   Prepend the following to the result-String:
      p                //    The prefix-String
      +n               //    Followed by the integer
      +" x 8 + "       //    Followed by the literal String " x 8 + "
      +i               //    Followed by the loop-index `i`
      +" = "           //    Followed by the literal String " = "
      +(n*8+i--)       //    Followed by the result of that equation
  return r;}           //  Return the result-String
</code>```

Title: Output a Magical 8 Trapezium

Body:
Java 10, <s>151</s> <s>133</s> <s>130</s> <s>129</s> <s>126</s> 110 bytes

v->{String p="\n",r="";for(int n=123456789,i=9;i>0;n/=10,p+=" ")r=p+n+" x 8 + "+i+" = "+(n*8+i--)+r;return r;}

Try it online.

Explanation:

v->{                   // Method with empty unused parameter and String return-type
  String p="\n",       //  Prefix-String, starting at a newline
         r="";         //  Result-String, starting empty
  for(int n=123456789, //  Multiply-number, starting at 123456789
      i=9;i>0          //  Loop `i` in the range [9, 0):
      ;                //    After every iteration:
       n/=10,          //     Remove the last digit from the integer
       p+=" ")         //     Append a space after the prefix
    r=...+r;           //   Prepend the following to the result-String:
      p                //    The prefix-String
      +n               //    Followed by the integer
      +" x 8 + "       //    Followed by the literal String " x 8 + "
      +i               //    Followed by the loop-index `i`
      +" = "           //    Followed by the literal String " = "
      +(n*8+i--)       //    Followed by the result of that equation
  return r;}           //  Return the result-String


答:
Perl 6, 47 bytes

```<code>{my \c;.say if .IO.e??(c=0)!!!c++ for $^a..$^b}
</code>```

Explanation:

```<code>{my \c;.say if .IO.e??(c=0)!!!c++ for $^a..$^b}
{                                               } # A function. Arguments: $^a and $^b (implicitly)
 my \c;                                           # A variable without prefix (\ is needed only here)
                                  for $^a..$^b    # For each number between $^a and $^b
       .say if                                    # Print the number if the result is truthy:
               .IO.e??(c=0)!!!c++                 # If the file exists, reset the sequence (don't print this one), otherwise, return the `!(c++)` result (is it the first time we're incrementing)
</code>```

Tried to use flipflops. Didn't manage to :P.

Body:
Perl 6, 47 bytes

{my \c;.say if .IO.e??(c=0)!!!c++ for $^a..$^b}

Explanation:

{my \c;.say if .IO.e??(c=0)!!!c++ for $^a..$^b}
{                                               } # A function. Arguments: $^a and $^b (implicitly)
 my \c;                                           # A variable without prefix (\ is needed only here)
                                  for $^a..$^b    # For each number between $^a and $^b
       .say if                                    # Print the number if the result is truthy:
               .IO.e??(c=0)!!!c++                 # If the file exists, reset the sequence (don't print this one), otherwise, return the `!(c++)` result (is it the first time we're incrementing)

Tried to use flipflops. Didn't manage to :P.


Title: Output a Magical 8 Trapezium

Body:
Your task is to output a Magical 8 Trapezium:

```<code>        1 × 8 + 1 = 9
       12 × 8 + 2 = 98
      123 × 8 + 3 = 987
     1234 × 8 + 4 = 9876
    12345 × 8 + 5 = 98765
   123456 × 8 + 6 = 987654
  1234567 × 8 + 7 = 9876543
 12345678 × 8 + 8 = 98765432
123456789 × 8 + 9 = 987654321
</code>```

Output in your chosen language in the fewest bytes possible.

Note the number of spaces at the start of each line to maintain the trapezium shape.

Trailing spaces are allowed.

You can use × or the letter x - whichever you prefer.

Body:
C, 74 bytes

d(i,n){for(i=n=1;i<10;n=++i+n*10)printf("%9d x 8 + %d = %d\n",n,i,n*8+i);}


问:
"Hello, World!"
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of <s>Wikipedia</s> (the Wikipedia entry has been deleted but there is a copy at archive.org
), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

The Rules

Each submission must be a full program.

The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.

The program must not write anything to STDERR.

If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

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 snippet:

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

/* Configuration */

var QUESTION_ID = 55422; // 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 = 8478; // 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,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\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,
      });
    else console.log(body);
  });

  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;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) 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;
  display: block !important;
}

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

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

table thead {
  font-weight: bold;
}

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

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
PAWN, 29 bytes

```<code>main()
print"Hello, World!\n"
</code>```

(no trailing newline)

Originally I was looking how to get QuadPawn (video) installed on my handheld scope but it turned out that my scope's hardware version (V2.72/8MB) isn't supported... :-(

Someone else wants to try this?

Luckily getting Pawn compiler 4.0.5504M from https://github.com/compuphase/pawn compiled on Debian-8.5/AMD64 was not a big deal.

That way I could run/verify these two lines.

Title: "Hello, World!"

Body:
PAWN, 29 bytes

main()
print"Hello, World!\n"

(no trailing newline)

Originally I was looking how to get QuadPawn (video) installed on my handheld scope but it turned out that my scope's hardware version (V2.72/8MB) isn't supported... :-(

Someone else wants to try this?

Luckily getting Pawn compiler 4.0.5504M from https://github.com/compuphase/pawn compiled on Debian-8.5/AMD64 was not a big deal.

That way I could run/verify these two lines.


答:
JavaScript (ES6), 100

Index base 0. Note: this function modifies the input array

(a,p)=>eval("for(s=0;1/(q=a[p]);++s,p=p>1&&p%i||p==2?p-q:q)for(a[p]=NaN,i=1;p%++i&&i*i<p;);q==q&&s")
```
<p><em>Less golfed</em></p>
<pre class="lang-js prettyprint-override"><code>(a,p)=>
{
  for(s = 0;
      1/ (q = a[p]);
      ++s)
  {
    a[p] = NaN; // mark visited position with NaN to detect loops
    for(i = 1; p % ++i && i*i < p;); // prime check
    p = p > 1 && p % i || p == 2 ? p-q : q;
  }
  return q==q && s // return false if landed on NaN as NaN != NaN
}
</code>```

Test

F=
(a,p)=>eval("for(s=0;1/(q=a[p]);++s,p=p>1&&p%i||p==2?p-q:q)for(a[p]=NaN,i=1;p%++i&&i*i
{
  var [a,b,k]=t, i=a+' '+b,r=F(a,b)
  console.log(r==k?'OK':'KO',i+' -> '+r)

})  ```

Title: Array Escape - get out of there

Body:
One day you awake only to find yourself caught in an array. You try to just walk out of there, taking one index at the time, but it seems there are other rules:

The array is completely filled with natural numbers.

If you find yourself on an index n, you go to the index array[n], except:

If you find yourself on an index n which is a prime number, you take array[n] steps back

Example:
You start on index 4, in this array (start index is 0):

```<code>array = [1,4,5,6,8,10,14,15,2,2,4,5,7];
-----------------^ you are here
</code>```

As the value of the field you are on is 8, you go to the index 8 as the first step. The field you land on contains the value 2. You then go to index 2 as your second step. As2is a prime number, you take 5 steps back, which is your third step. As there is no index -3, you successfully escaped the array in a total of 3 steps.

Your task is:

To write a program or function, which accepts an array and a start index as parameter, and outputs the amount of steps to escape the array. If you can't escape the array (e.g. [2,0,2] with start-index 2 => you constantly go from index 2 to 0), output a falsy value. You may use one-based indexing or zero-based indexing, but please specify which you use.

Test cases

Input: [2,5,6,8,1,2,3], 3

Output: 1

Input: [2, 0, 2], 2

Output: false

Input: [14,1,2,5,1,3,51,5,12,3,4,41,15,4,12,243,51,2,14,51,12,11], 5;

Output: 6

The shortest answer wins.

Body:
JavaScript (ES6), 100

Index base 0. Note: this function modifies the input array

(a,p)=>eval("for(s=0;1/(q=a[p]);++s,p=p>1&&p%i||p==2?p-q:q)for(a[p]=NaN,i=1;p%++i&&i*i<p;);q==q&&s")

Less golfed

(a,p)=>
{
  for(s = 0;
      1/ (q = a[p]);
      ++s)
  {
    a[p] = NaN; // mark visited position with NaN to detect loops
    for(i = 1; p % ++i && i*i < p;); // prime check
    p = p > 1 && p % i || p == 2 ? p-q : q;
  }
  return q==q && s // return false if landed on NaN as NaN != NaN
}

Test

F=
(a,p)=>eval("for(s=0;1/(q=a[p]);++s,p=p>1&&p%i||p==2?p-q:q)for(a[p]=NaN,i=1;p%++i&&i*i<p;);q==q&&s")

;[
 [[2,5,6,8,1,2,3], 3, 1]
,[[2, 0, 2], 2, false]
,[[14,1,2,5,1,3,51,5,12,3,4,41,15,4,12,243,51,2,14,51,12,11], 5, 6]
].forEach(t=>{
  var [a,b,k]=t, i=a+' '+b,r=F(a,b)
  console.log(r==k?'OK':'KO',i+' -> '+r)

})


答:
C#, 75 bytes

```<code>Console.Write(i.Select(j =>j.ToString().ToCharArray().Sum(k=>k-48)).Sum());
</code>```

where i is the integer input sequence. Also, limited to integers.

Title: Count sum of all digits

Body:
This challenge is to write a program or script which counts the sum of all digits within the integers from 1 up to and including a given number.

Input, one positive integer.
Output, the sum of digits in that number and all smaller numbers.

Examples:

```<code>Input: 5
Integer Sequence: 1, 2, 3, 4, 5
Sum of Digits: 1 + 2 + 3 + 4 + 5 = 15

Input: 12
Integer Sequence: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
Sum of Digits: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 = 51
</code>```

To be clear, this is to count a sum of the digits - not the integers. For single-digit inputs, this will be the same. However, inputs larger than 10 will have different responses. This would be an incorrect response:

```<code>Input: 12
Output: 78
</code>```

Another example, to show the difference:

```<code>Input: 10

Integer Sequence: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Sum of Integers (INCORRECT RESPONSE): 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55

Digit Sequence: 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 0
Sum of Digits (CORRECT RESPONSE): 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 = 46
</code>```

A larger test case (CORRECT RESPONSE):

```<code>Input: 1000000
Output: 27000001
</code>```

Rules & Guidelines:

Submitted code must be a complete program or script - not just a function. If the code requires includes, imports, etc., they must be included in the posted code.

The number must be input by the user - not hard-coded. Input may be received as a command-line argument, file, stdin, or any other means by which your language can take user input.

The code must be able to properly handle inputs at least up to (2^64)-1.

The code should only output the sum.

Submitted programs & scripts should be user-friendly and not wasteful of computer resources (e.g.: they should not declare insanely-large arrays to hold every character). There is no strict bonus or penalty for this, but please be good programmers.

Scoring:

Primary scoring mechanism is by code length. Lower scores are better. The following bonuses and penalties also apply:

-25 Bonus if your code can handle all positive numbers, for example: 1234567891234567891234564789087414984894900000000

-50 Bonus if your code can handle simple expressions, for example 55*96-12. To qualify for this bonus, the code should handle + - / * (addition, subtraction, division, multiplication) operators and enforce order of operations. Division is regular integer division.

The given example (55*96-12) evaluates to 5268. Your code should return the same for either of those inputs - correct answer is 81393.

-10 Bonus if your code qualifies for the -50 bonus and can handle the ^ (exponent) operator.

-100 Bonus if your code qualifies for the -50 bonus and does not use eval or similar to handle expressions.

+300 Penalty if your code relies upon any web resources.

Body:
C#, 75 bytes

Console.Write(i.Select(j =>j.ToString().ToCharArray().Sum(k=>k-48)).Sum());

where i is the integer input sequence. Also, limited to integers.


答:
JAVA, <s>103 94 92</s> 90 bytes

Using JShell from Java 9 SDK allows me to save large amount of space

```<code>for(int i=0,j;i++<9;)for(j=1;j<=i;)System.out.print(i+"*"+j+"="+i*j+"\t"+(j++<i?"":"\n"))
</code>```

Following  Kevin's suggestion I reduced solution by 2 bytes.

Thanks to cliffroot, I was able to reduce it by another 1 byte

Title: Print this Multiplication Table

Body:
JAVA, <s>103 94 92</s> 90 bytes

Using JShell from Java 9 SDK allows me to save large amount of space

for(int i=0,j;i++<9;)for(j=1;j<=i;)System.out.print(i+"*"+j+"="+i*j+"\t"+(j++<i?"":"\n"))

Following  Kevin's suggestion I reduced solution by 2 bytes.

Thanks to cliffroot, I was able to reduce it by another 1 byte


答:
JAVA, <s>229</s> 218 Bytes

```<code>Object e(int[]a,int b){Stack i=new Stack();int s=0;for(;!(a.length<b|b<0);s++){if(i.contains(b))return 1>2;i.add(b);b=p(b)>0?b-a[b]:a[b];}return s;}int p(int i){for(int j=2;j<i/2;j++)if(i%j<1)return 0;return i<2?0:1;}
</code>```

Thanks to Kevin, 11 bytes bites the dust.

Title: Array Escape - get out of there

Body:
JAVA, <s>229</s> 218 Bytes

Object e(int[]a,int b){Stack i=new Stack();int s=0;for(;!(a.length<b|b<0);s++){if(i.contains(b))return 1>2;i.add(b);b=p(b)>0?b-a[b]:a[b];}return s;}int p(int i){for(int j=2;j<i/2;j++)if(i%j<1)return 0;return i<2?0:1;}

Thanks to Kevin, 11 bytes bites the dust.


问:
Calculate Phi (not Pi)
No, I don't mean \$\phi = 1.618...\$ and \$π = 3.14159...\$. I mean the functions.

\$\phi(x)\$ is the number of integers less than or equal to \$x\$ that are relatively prime to \$x\$.

\$π(x)\$ is the number of primes less than or equal to \$x\$.

Let's say that "not pi" is then \$\bar{\pi}(x)\$ and define it to be the number of composites less than or equal to \$x\$.

Task

Given a strictly positive integer \$x\$, calculate \$\phi(\bar{\pi}(x))\$. Scoring is in bytes.

Examples

Each line consists of the input (from 1 to 100, inclusive) and the corresponding output separated by a space.

```<code>1 0
2 0
3 0
4 1
5 1
6 1
7 1
8 2
9 2
10 4
11 4
12 2
13 2
14 6
15 4
16 6
17 6
18 4
19 4
20 10
21 4
22 12
23 12
24 6
25 8
26 8
27 16
28 6
29 6
30 18
31 18
32 8
33 12
34 10
35 22
36 8
37 8
38 20
39 12
40 18
41 18
42 12
43 12
44 28
45 8
46 30
47 30
48 16
49 20
50 16
51 24
52 12
53 12
54 36
55 18
56 24
57 16
58 40
59 40
60 12
61 12
62 42
63 20
64 24
65 22
66 46
67 46
68 16
69 42
70 20
71 20
72 32
73 32
74 24
75 52
76 18
77 40
78 24
79 24
80 36
81 28
82 58
83 58
84 16
85 60
86 30
87 36
88 32
89 32
90 48
91 20
92 66
93 32
94 44
95 24
96 70
97 70
98 24
99 72
100 36
</code>```

Use this link to calculate the expected output for any input. Also, a list of inputs and outputs for \$x \le 1000\$ is provided here on pastebin. (Generated with this Minkolang program.)

Leaderboards

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

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

```<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>```

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

```

答:
GAP, 33 Bytes

```<code>n->Phi(n-Number([-2..n],IsPrime))
</code>```

Number(l,p) counts how many elements from l satisfy p. To compensate for the fact that 1 is neither prime nor composite, I have to subtract from n one more than the number of primes up to n. Instead of doing -1 for two bytes, I start the list by -2 instead of 1 or 2, thus adding one more number that is considered prime by IsPrime for only one extra byte.

Title: Calculate Phi (not Pi)

Body:
GAP, 33 Bytes

n->Phi(n-Number([-2..n],IsPrime))

Number(l,p) counts how many elements from l satisfy p. To compensate for the fact that 1 is neither prime nor composite, I have to subtract from n one more than the number of primes up to n. Instead of doing -1 for two bytes, I start the list by -2 instead of 1 or 2, thus adding one more number that is considered prime by IsPrime for only one extra byte.


答:
c#, 142 bytes

```<code>Enumerable.Range(1,9).ToList().ForEach(i =>Enumerable.Range(1,i).ToList().ForEach(j=>Console.Write("{0}x{1}={2}{3}",j,i,j*i,j==i?"\n":"\t")));
</code>```

And not a for in sight...

Title: Print this Multiplication Table

Body:
c#, 142 bytes

Enumerable.Range(1,9).ToList().ForEach(i =>Enumerable.Range(1,i).ToList().ForEach(j=>Console.Write("{0}x{1}={2}{3}",j,i,j*i,j==i?"\n":"\t")));

And not a for in sight...


Title: Output a Magical 8 Trapezium

Body:
Perl, 49 bytes

printf"%9s x 8 + $_ = %s
",$@.=$_,$_+8*$@for 1..9

Usage

perl -e 'printf"%9s x 8 + $_ = %s
",$@.=$_,$_+8*$@for 1..9'


问:
Print the Nth non-palindromic number
A palindromic number (in case you don't know) is a number which reads the same backwards and forwards (example, 11). The first 15 non-palindromic numbers are: 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26. This is A029742. I constantly need these numbers, but my sticky note pad is very small, so your code must be as short as possible.

Rules

Each submission must be a full program or function (e.g. in C, you can't just define a function without headers, but you can define a function WITH necessary headers
).

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

You can take input as an argument or from STDIN (or the closest alternative in your language).

Programs are scored according to bytes. The usual character set is UTF-8, if you are using another please specify.

Standard loopholes are forbidden.

Test Cases

```<code>1
==> 10

-----

5
==> 15

-----

12
==> 23
</code>```

Scoring

This is code-golf, so least bytes wins.

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 = 79251; // 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

```

答:
JavaScript (ES6), 54 bytes

Uses 1-based indexing. Only works up until the 7624th number.

d=(i,a=0)=>i?d(i-=++a!=[...''+a].reverse().join``,a):a
```

<h3>Usage</h3>

<pre class="lang-js prettyprint-override"><code>d=(i,a=0)=>i?d(i-=++a!=[...''+a].reverse().join``,a):a
d(1)
10
d(123)
146
d(7624)
7800
d(7625)
// Uncaught RangeError: Maximum call stack size exceeded
</code>```

JavaScript (ES6), 59 bytes

Doesn't use recursion and so can handle much larger inputs.

i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a")
```

<h3>Usage</h3>

<pre class="lang-js prettyprint-override"><code>(i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a"))(1)
10
(i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a"))(7625)
7801
(i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a"))(123456)
124579
</code>```

Title: Print the Nth non-palindromic number

Body:
JavaScript (ES6), 54 bytes

Uses 1-based indexing. Only works up until the 7624th number.

d=(i,a=0)=>i?d(i-=++a!=[...''+a].reverse().join``,a):a

Usage

d=(i,a=0)=>i?d(i-=++a!=[...''+a].reverse().join``,a):a
d(1)
10
d(123)
146
d(7624)
7800
d(7625)
// Uncaught RangeError: Maximum call stack size exceeded

JavaScript (ES6), 59 bytes

Doesn't use recursion and so can handle much larger inputs.

i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a")

Usage

(i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a"))(1)
10
(i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a"))(7625)
7801
(i=>eval("for(a=9;i-=++a!=[...`${a}`].reverse().join``;);a"))(123456)
124579