问:
Write a java code to detect the JVM version
The objective is to write java code that detects the JVM version relying in compatibility changes, side effects, bugs and/or undefined behavior that works in a way in one version and another way in another version. Further, the code should be at least a bit readable, without sacrificing whitespaces and legible variable names.

To ensure that objective, the exact formal rules are:

The code must be written in java and should output the JRE version in which it is running.

The code must not use any JDK or JRE API provided specifically for detecting the java version or which gives the JDK or JRE version for free.

The code must not use reflection.

The code is only required to work in Hotspot Java SE 5, 6 and 7, but may work in other JVMs.

The code must not use any third-party libraries in the classpath.

The code must not start any other process, java or not.

The code must not use environment variables.

The code must not search the file system looking for pre-existing files or folders.

The code must be contained in a single file and be called via public static void main(String[] args) or public static void main(String... args).

The code must not use any non-public API present in the JRE.

The code must not generate any NoClassDefFoundError, NoSuchMethodError, ClassNotFoundException or NoSuchMethodException during its execution.

The code should run in a system disconnected from the internet or from any local network.

You should provide an explanation of why it behaves in one way in a version and another way in another version.

Scoring

The method used for measuring the best solution is max(n/s), where n is the number of different java versions detected without violating any of these rules (at least versions 5, 6 and 7) and s is the number of lexical tokens in the solution.

答:
I'm not sure what my score is, because it depends on what precisely you consider to be a lexical token, but I'm trying to abuse that counting system as much as possible with a long string...

It also depends on whether you count this as identifying 7 different versions or 16... (It could trivially be extended up to 190).

class V extends ClassLoader
{
    public static void main(String[]args)
    {
        for(byte b=60;;)
            try {
                byte[]buf="\u00ca\u00fe\u00ba\u00be\u0000\u0000\u00002\u0000\u0005\u0007\u0000\u0003\u0007\u0000\u0004\u0001\u0000\u0001A\u0001\u0000\u0010java/lang/Object\u0006\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000".getBytes("ISO-8859-1");
                buf[7]=b--;
                new V().defineClass(buf,0,53);
                System.out.println(b-43);
                break;
            }
            catch(Throwable t){}
    }
}
```

It works by attempting to define an interface in a custom classloader with descending major version numbers of the class format. The first one which doesn't throw a java.lang.UnsupportedClassVersionError corresponds to the VM's version.

Body:
I'm not sure what my score is, because it depends on what precisely you consider to be a lexical token, but I'm trying to abuse that counting system as much as possible with a long string...

It also depends on whether you count this as identifying 7 different versions or 16... (It could trivially be extended up to 190).

class V extends ClassLoader
{
    public static void main(String[]args)
    {
        for(byte b=60;;)
            try {
                byte[]buf="\u00ca\u00fe\u00ba\u00be\u0000\u0000\u00002\u0000\u0005\u0007\u0000\u0003\u0007\u0000\u0004\u0001\u0000\u0001A\u0001\u0000\u0010java/lang/Object\u0006\u0000\u0000\u0001\u0000\u0002\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000".getBytes("ISO-8859-1");
                buf[7]=b--;
                new V().defineClass(buf,0,53);
                System.out.println(b-43);
                break;
            }
            catch(Throwable t){}
    }
}

It works by attempting to define an interface in a custom classloader with descending major version numbers of the class format. The first one which doesn't throw a java.lang.UnsupportedClassVersionError corresponds to the VM's version.


问:
Highlight the Bounding Box, Part I: Cartesian Grid
You're given a rectangular grid of the characters . and #, like this:

```<code>..........
..#.......
....#..#..
...#......
..........
</code>```

Your task is to fill the entire axis-aligned bounding box of the # with further #:

```<code>..........
..######..
..######..
..######..
..........
</code>```

The axis-aligned bounding box is the smallest rectangle which contains all the #.

Want more? Try Part II!

Rules

You may use any two distinct printable ASCII characters (0x20 to 0x7E, inclusive), in place of # and .. I'll continue referring to them as # and . for the remainder of the specification though.

Input and output may either be a single linefeed-separated string or a list of strings (one for each line), but the format has to be consistent.

You may assume that the input contains at least one # and all lines are the same length.

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

Each test case has input and output next to each other.

```<code>#    #

...    ...
#..    #..
...    ...

...    ...
#..    ###
..#    ###

.#.    ###
#..    ###
..#    ###

.....    .....
.#.#.    .###.
.....    .....

...    ...
.#.    .#.
...    .#.
.#.    .#.
...    ...

..........    ..........
..........    ..........
....#.....    ....#.....
..........    ..........

..........    ..........
..........    ..........
....#.....    ...##.....
...#......    ...##.....

..........    ..........
..#.......    ..###.....
....#.....    ..###.....
...#......    ..###.....

..........    ..........
..#.......    ..######..
....#..#..    ..######..
...#......    ..######..

.........#    ..########
..#.......    ..########
....#..#..    ..########
...#......    ..########
</code>```

答:
Retina, 87 bytes

Byte count assumes ISO 8859-1 encoding.

```<code>Tm`A` `^\GA+¶|(¶A+)+\Z|^(A+?)(?<=(?=\D*^\2Z)\A\D*)|(A+)$(?=\D*\Z(?<!(?<!\3)$\D*))
T`p`L
</code>```

Uses A for . and Z for #.

Try it online!

ContentLicense: CC BY-SA 3.0

Body:
Retina, 87 bytes

Byte count assumes ISO 8859-1 encoding.

Tm`A` `^\GA+¶|(¶A+)+\Z|^(A+?)(?<=(?=\D*^\2Z)\A\D*)|(A+)$(?=\D*\Z(?<!(?<!\3)$\D*))
T`p`L

Uses A for . and Z for #.

Try it online!


问:
My triangle needs more nodes
Consider the standard equilateral triangle, with nodes labeled using barycentric coordinates:

We can turn this 3 node triangle into a 6 node triangle by adding a new line of 3 vertices (one more than was present on a side of the original 3 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

Repeating the process to go from a 6 node triangle to a 10 node triangle, add a line of 4 vertices (again, one more than was present on a side of the original 6 node triangle), remove any internal edges (but not internal nodes) and re-normalize the coordinates:

This process can be repeated indefinitely. The goal of this challenge is given an integer N representing how many times this process has been performed, output all the nodes for the associated triangle in barycentric coordinates.

Input

Your program/function should take as input a single non-negative integer N representing how many times this process has been applied. Note that for N=0, you should output the original triangle with 3 nodes.

The input may come from any source (function parameter, stdio, etc.).

Output

Your program/function should output all the nodes in normalized barycentric coordinates. The order of the nodes does not matter.
A number can be specified as a fraction (fraction reduction not required) or a floating point number. You may also output "scaled" vectors to specify a node. For example, all 3 of the following outputs are equivalent and allowed:

```<code>0.5,0.5,0

1/2,2/4,0

[1,1,0]/2
</code>```

If using floating point output, your output should be accurate to within 1%. The output may be to any sink desired (stdio, return value, return parameter, etc.). Note that even though the barycentric coordinates are uniquely determined by only 2 numbers per node, you should output all 3 numbers per node.

Examples

Example cases are formatted as:

```<code>N
x0,y0,z0
x1,y1,z1
x2,y2,z2
...
</code>```

where the first line is the input N, and all following lines form a node x,y,z which should be in the output exactly once. All numbers are given as approximate floating point numbers.

```<code>0
1,0,0
0,1,0
0,0,1

1
1,0,0
0,1,0
0,0,1
0.5,0,0.5
0.5,0.5,0
0,0.5,0.5

2
1,0,0
0,1,0
0,0,1
0.667,0,0.333
0.667,0.333,0
0.333,0,0.667
0.333,0.333,0.333
0.333,0.667,0
0,0.333,0.667
0,0.667,0.333

3
1,0,0
0.75,0,0.25
0.75,0.25,0
0.5,0,0.5
0.5,0.25,0.25
0.5,0.5,0
0.25,0,0.75
0.25,0.25,0.5
0.25,0.5,0.25
0.25,0.75,0
0,0,1
0,0.25,0.75
0,0.5,0.5
0,0.75,0.25
0,1,0
</code>```

Scoring

This is code golf; shortest code in bytes wins. Standard loopholes apply. You may use any built-ins desired.

答:
Ruby, <s>77</s> 74 bytes

Another answer using the algorithm in TheBikingViking's Python answer. Golfing suggestions welcome.

```<code>->n{a=[*0.step(1,i=1.0/(n+1))];a.product(a,a).reject{|j|j.reduce(&:+)!=1}}
</code>```

Another 74-byte algorithm based on Not that Charles's Ruby answer.

```<code>->x{y=x+1;z=1.0/y;[*0..y].map{|a|[*0..y-a].map{|b|p [a*z,b*z,(y-a-b)*z]}}}
</code>```

Title: My triangle needs more nodes

Body:
Ruby, <s>77</s> 74 bytes

Another answer using the algorithm in TheBikingViking's Python answer. Golfing suggestions welcome.

->n{a=[*0.step(1,i=1.0/(n+1))];a.product(a,a).reject{|j|j.reduce(&:+)!=1}}

Another 74-byte algorithm based on Not that Charles's Ruby answer.

->x{y=x+1;z=1.0/y;[*0..y].map{|a|[*0..y-a].map{|b|p [a*z,b*z,(y-a-b)*z]}}}


问:
Enterprise Quality Code Prime Sieve

Enterprise Quality Code!

TL;DR

Answers will consist of a full program (of length < 30k) prints the the first N Prime numbers (as a base 10 representation without leading zeros unless the chosen language only supports unary or other based output) separated by newlines (optional trailing linefeed).

You may post cracks at any time, but you must wait one hour after posting each initial bowled submission

Leading or trailing whitespace is not acceptable (except for the trailing newline)

An answer's score is the number of bytes in the answer. A user's score is the total number of bytes of all uncracked answers.

An answer gets cracked when another user posts an answer (in the same language) which is a permutation of any subset of the characters used in the original answer.

The user with the highest score will receive an accepted tick mark on his /her highest scoring post (although it doesnt really matter which specific post gets the tick)

The Inspiration for this challenge

At Pretty Good consultants there is a focus on writing "quality" verbose code that is sufficiently engineered. Your boss has decided to test you on your skills.

Consider the set of all programming languages in existence before the posting of this challenge. For this challenge there will technically be one individual "winner" in each language, however the boss will give a <s>promotion</s> accepted tick mark to only one answer based on your score.

Detailed Spec

The goal of this challenge is to receive an integer N strictly smaller than 2^8-1 and print the first N prime numbers (in less than 24 hours) separated by your platforms choice of new line (a trailing newline is optional). OEIS sequence A000040 in as many bytes as possible in as many languages as possible. However, note that others vying for the promotion will try to "help" you by golfing down your score. (Please note that your prime generation function should theoretically work for integer N inputs strictly smaller than 2^16-1 given enough time, the bounds for N have been reduced after realizing how slow some interpreters are (namely mine) hardcoding the list of primes is strictly forbidden)

Sample output for an input 11

```
2
3
5
7
11
13
17
19
23
29
31
```

How to participate

Pick any language X, but please avoid selecting a language which is just another version or derivative of another answer.
If there is no existing answer in language X than you will write a program (which must fit into a single post I.E it must be less than 30k characters) that solves this challenge.
The length in bytes of the source (in any reasonable preexisting textual encoding) will be added to your score. You must avoid using any unnecessary characters for reasons that will soon become apparent.

If language X already has been used to answer this question, then you must answer using any permutation of any proper subset of the characters used in the shortest answer (I.E take the shortest X answer and remove some (>=1) characters and optionally rearrange the resulting code). The previous holder of the shortest X answer will lose all of the bytes provided by his answer from his score, and the number of bytes of your submission will now be added to your score. The number of bytes golfed off gets "lost" forever.

Rules for Languages

You may only crack a submission by posting an answer in the same language (and version), but you are barred from posting an answer in language X if there exists a submission in a sufficiently similar language Y. Please do not abuse this rule posting an answer in a sufficiently similar language will receive disqualification.

Below is a leader board which removes answers with "cracked" (with any case) in their header.

var QUESTION_ID=90593,OVERRIDE_USER=46918;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 a-r});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<>]+>)^(?:(?!cracked)\i.)*[^\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, 197 bytes

Another crack of one of Jonathan Allan's answers

```<code>class y{public static void main(String[]b){int n=2,l=870119,i=new java.util.Scanner(System.in).nextInt(),f,j;while(i>0){f=0;for(j=1;j<l;j++)if(n%j==0)f++;if(f==2){System.out.println(n);i--;}n++;}}}
</code>```

Saves 6 characters (namely {{}}i;) by removing extraneous curly brackets around the for loop and following if, and by moving the assignment to i into its declaration.

Test on ideone.

Title: Enterprise Quality Code Prime Sieve

Body:
Java, 197 bytes

Another crack of one of Jonathan Allan's answers

class y{public static void main(String[]b){int n=2,l=870119,i=new java.util.Scanner(System.in).nextInt(),f,j;while(i>0){f=0;for(j=1;j<l;j++)if(n%j==0)f++;if(f==2){System.out.println(n);i--;}n++;}}}

Saves 6 characters (namely {{}}i;) by removing extraneous curly brackets around the for loop and following if, and by moving the assignment to i into its declaration.

Test on ideone.


问:
Permutapalindromic numbers
Given an integer N as input, output the Nth permutapalindromic number.

A permutapalindromic number is a strictly positive integer such that there is at least one permutation of its digits that results in a palindrome (i.e. a number that is its own reverse).

For example, 117 is a permutapalindromic number since its digits can be permuted into 171, which is a palindrome.

We consider that numbers like 10 are not permutapalindromic numbers, even though 01 = 1 is a palindrome. We impose that the palindromic permutation must not have a leading zero (as such, 0 itself is not permutapalindromic).

Numbers that are already palindromes are also permutapalindromic, since permuting nothing is valid.

Inputs and outputs

N may be either 0-indexed or 1-indexed. Please indicate which of the two your answer uses.

The input can be taken through STDIN, as a function argument, or anything similar in your language of choice. The output can be written to STDOUT, returned from a function, or anything similar in your language of choice.

The input and output must be in the decimal base.

Test cases

The following test cases are 1-indexed. Your program must be able to pass any of the test cases presented here in at most 1 minute.

```<code>N      Output

1      1
2      2
3      3
4      4
5      5
6      6
7      7
8      8
9      9
10     11
42     181
100    404
128    511
256    994
270    1166
</code>```

Scoring

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

Title: Permutapalindromic numbers

Body:
C, 254 bytes

#define W while
#define R return
f(j){int c=0,a[16]={0};do++a[j%10],++c;W(j/=10);if(c>1&&a[0]>=c-1)R 0;c%=2;W(j<10)if(a[j++]%2&&(!c||++c>2))R 0;R 1;}g(n){int k=0,i=1;W(k<n)if(f(i++))++k;R i-1;}main(a){printf("N>");scanf("%d",&a);printf("%d\n",g(a));}


问:
Sylvester's sequence
Sylvester's sequence, OEIS A000058, is an integer sequence defined as follows:

Each member is the product of all previous members plus one.  The first member of the sequence is 2.

Task

Create a program to calculate the nth term of Sylvester's Sequence.  Standard input, output and loopholes apply.

Standard sequence rules apply.

This is code-golf, so the goal is to minimize the size of your source code as measured in bytes.

Test Cases

You may use either zero or one indexing. (Here I use zero indexing)

```<code>>>0
2
>>1
3
>>2
7
>>3
43
>>4
1807
</code>```

答:
Batch, 70 bytes

```<code>@set/ap=r=2
@for /l %%i in (1,1,%1)do @set/at=p,p*=r,r=t+1
@echo %r%
</code>```

Zero indexed, uses @LeakyNun's recurrence relation. Conveniently set/a works inside a for loop, because I'm not using % substitution.

ContentLicense: CC BY-SA 4.0

Title: Sylvester's sequence

Body:
Batch, 70 bytes

@set/ap=r=2
@for /l %%i in (1,1,%1)do @set/at=p,p*=r,r=t+1
@echo %r%

Zero indexed, uses @LeakyNun's recurrence relation. Conveniently set/a works inside a for loop, because I'm not using % substitution.


问:
Exploded view of a string
Don't you love those exploded-view diagrams  in which a machine or object is taken apart into its smallest pieces?

Let's do that to a string!

The challenge

Write a program or function that

inputs a string containing only printable ASCII characters;

dissects the string into groups of non-space equal characters (the "pieces" of the string);

outputs those groups in any convenient format, with some separator between groups.

For example, given the string

```<code>Ah, abracadabra!
</code>```

the output would be the following groups:

```
!
,
A
aaaaa
bb
c
d
h
rr
```

Each group in the output contains equal characters, with spaces removed. A newline has been used as separator between groups. More about allowed formats below.

Rules

The input should be a string or an array of chars. It will only contain printable ASCII chars (the inclusive range from space to tilde). If your language does not support that, you can take the input in the form of numbers representing ASCII codes.

You can assume that the input contains at least one non-space character.

The output should consist of characters (even if the input is by means of ASCII codes). There has to be an unambiguous separator between groups, different than any non-space character that may appear in the input.

If the output is via function return, it may also be an array or strings, or an array of arrays of chars, or similar structure. In that case the structure provides the necessary separation.

A separator between characters of each group is optional. If there is one, the same rule applies: it can't be a non-space character that may appear in the input. Also, it can't be the same separator as used between groups.

Other than that, the format is flexible. Here are some examples:

The groups may be strings separated by newlines, as shown above.

The groups may be separated by any non-ASCII character, such as  ¬. The output for the above input would be the string:

```<code>!¬,¬A¬aaaaa¬bb¬c¬d¬h¬rr
</code>```

The groups may be separated by n>1 spaces (even if n is variable), with chars between each group separated by a single space:

```<code>!  ,    A   a a a a a    b b  c       d   h  r r
</code>```

The output may also be an array or list of strings returned by a function:

```<code>['!', 'A', 'aaaaa', 'bb', 'c', 'd', 'h', 'rr']
</code>```

Or an array of char arrays:

```<code>[['!'], ['A'], ['a', 'a', 'a', 'a', 'a'], ['b', 'b'], ['c'], ['d'], ['h'], ['r', 'r']]
</code>```

Examples of formats that are not allowed, according to the rules:

A comma can't be used as separator (!,,,A,a,a,a,a,a,b,b,c,d,h,r,r), because the input may contain commas.

It's not accepted to drop the separator between groups (!,Aaaaaabbcdhrr) or to use the same separator between groups and within groups (! , A a a a a a b b c d h r r).

The groups may appear in any order in the output. For example: alphabetical order (as in the examples above), order of first appearance in the string, ... The order need not be consistent or even deterministic.

Note that the input cannot contain newline characters, and A and a are different characters (grouping is case-sentitive).

Shortest code in bytes wins.

Test cases

In each test case, first line is input, and the remaining lines are the output, with each group in a different line.

Test case 1:

```
Ah, abracadabra!
!
,
A
aaaaa
bb
c
d
h
rr
```

Test case 2:

```
\o/\o/\o/
///
\\\
ooo
```

Test case 3:

```
A man, a plan, a canal: Panama!
!
,,
:
A
P
aaaaaaaaa
c
ll
mm
nnnn
p
```

Test case 4:

```
"Show me how you do that trick, the one that makes me scream" she said
""
,
S
aaaaa
cc
dd
eeeeeee
hhhhhh
ii
kk
mmmm
n
ooooo
rr
ssss
tttttt
u
ww
y
```

答:
Scala, 53 bytes

```<code>def?(s:String)=s.filter(_!=' ').groupBy(identity).map{_._2.mkString}
</code>```

When run with REPL:

```<code>scala> ?("Ah, abracadabra!")
res2: scala.collection.immutable.Iterable[String] = List(!, A, aaaaa, ,, bb, c, h, rr, d)

scala> print(res2.mkString("\n"))
!
A
aaaaa
,
bb
c
h
rr
d
</code>```

EDIT:
Forgot to filter spaces

Title: Exploded view of a string

Body:
Scala, 53 bytes

def?(s:String)=s.filter(_!=' ').groupBy(identity).map{_._2.mkString}

When run with REPL:

scala> ?("Ah, abracadabra!")
res2: scala.collection.immutable.Iterable[String] = List(!, A, aaaaa, ,, bb, c, h, rr, d)

scala> print(res2.mkString("\n"))
!
A
aaaaa
,
bb
c
h
rr
d

EDIT:
Forgot to filter spaces


答:
JavaScript (ES6), 92

n=>eval("for(a=0;n-=(a++<9||(b=[...a+``].sort().join``)>9&!b.replace(/(.)\\1/g,``)[1]););a")
```
<p><em>Less golfed</em></p>
<pre class="lang-js prettyprint-override"><code>n=>{
  for( a = 0;
       n -= // decrement n (and exit when 0) if the check below is true == a is permutapalindromic
            (a ++ < 9 // single digit (meanwhile, increment a)
             || // or...
             ( b=[...a+``].sort().join`` )// build a string with the digits sorted
               > 9 // required at least 2 non zero digits
             & ! b.replace(/(.)\1/g,``)[1] // removed all digits pair, there must be just 1 or no single digits remaining
            );
     );
   return a;
}
</code>```

Test

f=n=>eval("for(a=0;n-=(a++<9||(b=[...a+``].sort().join``)>9&!b.replace(/(.)\\1/g,``)[1]););a")

function update() {
  O.textContent=f(+I.value)
}

update()```
<pre class="snippet-code-html lang-html prettyprint-override"><code><input id=I oninput=update() type=number value=100>
<pre id=O>``````

Title: Permutapalindromic numbers

Body:
Given an integer N as input, output the Nth permutapalindromic number.

A permutapalindromic number is a strictly positive integer such that there is at least one permutation of its digits that results in a palindrome (i.e. a number that is its own reverse).

For example, 117 is a permutapalindromic number since its digits can be permuted into 171, which is a palindrome.

We consider that numbers like 10 are not permutapalindromic numbers, even though 01 = 1 is a palindrome. We impose that the palindromic permutation must not have a leading zero (as such, 0 itself is not permutapalindromic).

Numbers that are already palindromes are also permutapalindromic, since permuting nothing is valid.

Inputs and outputs

N may be either 0-indexed or 1-indexed. Please indicate which of the two your answer uses.

The input can be taken through STDIN, as a function argument, or anything similar in your language of choice. The output can be written to STDOUT, returned from a function, or anything similar in your language of choice.

The input and output must be in the decimal base.

Test cases

The following test cases are 1-indexed. Your program must be able to pass any of the test cases presented here in at most 1 minute.

```<code>N      Output

1      1
2      2
3      3
4      4
5      5
6      6
7      7
8      8
9      9
10     11
42     181
100    404
128    511
256    994
270    1166
</code>```

Scoring

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

Body:
JavaScript (ES6), 92

n=>eval("for(a=0;n-=(a++<9||(b=[...a+``].sort().join``)>9&!b.replace(/(.)\\1/g,``)[1]););a")

Less golfed

n=>{
  for( a = 0;
       n -= // decrement n (and exit when 0) if the check below is true == a is permutapalindromic
            (a ++ < 9 // single digit (meanwhile, increment a)
             || // or...
             ( b=[...a+``].sort().join`` )// build a string with the digits sorted
               > 9 // required at least 2 non zero digits
             & ! b.replace(/(.)\1/g,``)[1] // removed all digits pair, there must be just 1 or no single digits remaining
            );
     );
   return a;
}

Test

f=n=>eval("for(a=0;n-=(a++<9||(b=[...a+``].sort().join``)>9&!b.replace(/(.)\\1/g,``)[1]););a")

function update() {
  O.textContent=f(+I.value)
}

update()

<input id=I oninput=update() type=number value=100>
<pre id=O></pre>


问:
This isn't rocket science
Write a program or function that takes in a single-line string. You can assume it only contains printable ASCII. Print or return a string of an ASCII art rocket such as

```<code>  |
 /_\
 |E|
 |a|
 |r|
 |t|
 |h|
 |_|
/___\
 VvV
</code>```

with the input string written from top to bottom on the fuselage. In this case the input was Earth. The height of the rocket (including flames) is always the length of the string plus five.

Each line in the output may have up to two trailing spaces and there may be a single optional trailing newline. The shortest code in bytes wins.

More Examples:

```<code>[empty string]

  |
 /_\
 |_|
/___\
 VvV

a

  |
 /_\
 |a|
 |_|
/___\
 VvV

|0

  |
 /_\
 |||
 |0|
 |_|
/___\
 VvV

\/\

  |
 /_\
 |\|
 |/|
 |\|
 |_|
/___\
 VvV

 _ _ [note trailing space]

  |
 /_\
 | |
 |_|
 | |
 |_|
 | |
 |_|
/___\
 VvV

    [4 spaces]

  |
 /_\
 | |
 | |
 | |
 | |
 |_|
/___\
 VvV

SPACEY

  |
 /_\
 |S|
 |P|
 |A|
 |C|
 |E|
 |Y|
 |_|
/___\
 VvV
</code>```

Leaderboard

var QUESTION_ID=91182,OVERRIDE_USER=26997;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

```

Title: This isn't rocket science

Body:
C, <s> 131 </s>, 121 bytes

#define P printf
main(){char s[99],*p=s;gets(s);P("  |\n /_\\\n");while(*p)P(" |%c|\n",*p++);P(" |_|\n/___\\\n VvV\n");}


答:
Retina, <s>44</s> 37 bytes

7 bytes thanks to Martin Ender.

```<code>$
_
.
¶ |$0|
$
¶/___\¶ VvV
^
  |¶ /_\
</code>```

Try it online!

Title: This isn't rocket science

Body:
Write a program or function that takes in a single-line string. You can assume it only contains printable ASCII. Print or return a string of an ASCII art rocket such as

```<code>  |
 /_\
 |E|
 |a|
 |r|
 |t|
 |h|
 |_|
/___\
 VvV
</code>```

with the input string written from top to bottom on the fuselage. In this case the input was Earth. The height of the rocket (including flames) is always the length of the string plus five.

Each line in the output may have up to two trailing spaces and there may be a single optional trailing newline. The shortest code in bytes wins.

More Examples:

```<code>[empty string]

  |
 /_\
 |_|
/___\
 VvV

a

  |
 /_\
 |a|
 |_|
/___\
 VvV

|0

  |
 /_\
 |||
 |0|
 |_|
/___\
 VvV

\/\

  |
 /_\
 |\|
 |/|
 |\|
 |_|
/___\
 VvV

 _ _ [note trailing space]

  |
 /_\
 | |
 |_|
 | |
 |_|
 | |
 |_|
/___\
 VvV

    [4 spaces]

  |
 /_\
 | |
 | |
 | |
 | |
 |_|
/___\
 VvV

SPACEY

  |
 /_\
 |S|
 |P|
 |A|
 |C|
 |E|
 |Y|
 |_|
/___\
 VvV
</code>```

Leaderboard

var QUESTION_ID=91182,OVERRIDE_USER=26997;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:
Retina, <s>44</s> 37 bytes

7 bytes thanks to Martin Ender.

$
_
.
¶ |$0|
$
¶/___\¶ VvV
^
  |¶ /_\

Try it online!


Title: Sylvester's sequence

Body:
Sylvester's sequence, OEIS A000058, is an integer sequence defined as follows:

Each member is the product of all previous members plus one.  The first member of the sequence is 2.

Task

Create a program to calculate the nth term of Sylvester's Sequence.  Standard input, output and loopholes apply.

Standard sequence rules apply.

This is code-golf, so the goal is to minimize the size of your source code as measured in bytes.

Test Cases

You may use either zero or one indexing. (Here I use zero indexing)

```<code>>>0
2
>>1
3
>>2
7
>>3
43
>>4
1807
</code>```

Body:
PHP 5.6+ (49 bytes)

$n;function f($n){return--$n?f($n)**2-f($n)+1:2;}


问:
Tips for golfing in R
I'm looking for tips for golfing in the R statistical language.  R is perhaps an unconventional choice for Golf.  However, it does certain things very compactly (sequences, randomness, vectors, and lists), many of the built-in functions have very short names, and it has an optional line terminator (;).  What tips and tricks can you give to help solve code golf problems in R?</p>

答:
You can assign a variable to the current environment while simultaneously supplying it as an argument to a function:

```<code>sum(x <- 4, y <- 5)
x
y
</code>```

If you are subseting a data.frame and your condition depends on several of its columns, you can avoid repeating the data.frame name by using with (or subset).

```<code>d <- data.frame(a=letters[1:3], b=1:3, c=4:6, e=7:9)
with(d, d[a=='b' & b==2 & c==5 & e==8,])
</code>```

instead of

```<code>d[d$a=='b' & d$b==2 & d$c==5 & d$e==8,]
</code>```

Of course, this only saves characters if the length of your references to the data.frame exceeds the length of with(,)

if...else blocks can return the value of the final statement in which ever part of the block executes. For instance, instead of

```<code>a <- 3
if (a==1) y<-1 else
if (a==2) y<-2 else y<-3
</code>```

you can write

```<code>y <- if (a==1) 1 else
     if (a==2) 2 else 3
</code>```

Title: Tips for golfing in R

Body:
You can assign a variable to the current environment while simultaneously supplying it as an argument to a function:

sum(x <- 4, y <- 5)
x
y

If you are subseting a data.frame and your condition depends on several of its columns, you can avoid repeating the data.frame name by using with (or subset).

d <- data.frame(a=letters[1:3], b=1:3, c=4:6, e=7:9)
with(d, d[a=='b' & b==2 & c==5 & e==8,])

instead of

d[d$a=='b' & d$b==2 & d$c==5 & d$e==8,]

Of course, this only saves characters if the length of your references to the data.frame exceeds the length of with(,)

if...else blocks can return the value of the final statement in which ever part of the block executes. For instance, instead of

a <- 3
if (a==1) y<-1 else
if (a==2) y<-2 else y<-3

you can write

y <- if (a==1) 1 else
     if (a==2) 2 else 3


问:
What does this button do?
Currently at my work we moved to a new building. It's supposed to be state of the art and has automatic lights, automatic roll-down shutters, and is now known as the most eco-friendly building in this town.

However, it doesn't really work all that well.. The roll-down shutters sometimes go down on cloudy days and up when the sun starts to shine, and the lights sometimes cause disco effects by alternating turning on and off every 5-10 minutes. Also, we don't have any manual way of controlling these roll-down shutters, nor the temperature, BUT we do have a remote for the lights.

These remotes however came without instruction manual and contain little over 20 buttons doing all kind of stuff except for what you seem to want..

PS: I wrote this challenge 1.5 months ago in the Sandbox. Currently we, kinda, know how the remotes work..

One big advantage about this building, it's 30+ degrees Celcius outside, but inside it stays the same 21 room temperature at all time.

So, that was the intro, and the remote control for the lights inspired this challenge.

Challenge:

Let's say we initially have a lamp turned off:

```<code>L
</code>```

Then we push all kind of buttons and output the state of the lamp afterwards.

We use the following numbers for the different functions of the remote control for the lamp. When a minus symbol is in front of that number, we do the opposite.

1 = ON; -1 = OFF.

2 = Increase strength by 25%; -2 = Decrease (dim) strength by 25%.

3 = Increase spread by 50%; -3 = Decrease spread by 50%.

4 = Toggling the type of light.

So, this is all pretty vague, so let's go a little more in depth what each thing means:

So, -1 (OFF) is pretty obvious, and 1 will go to the initial ON-state (50% for 2 and 50% for 3):

```<code>   //
  //
L ====
  \\
   \\
</code>```

2 and -2 is how far the light travels (== is appended for every 25%):

```<code>0% (equal to a light bulb that is OFF)
L

25%
L ==

50%
L ====

75%
L ======

100%
L ========
</code>```

3 and -3 is how far the light spreads:

```<code>0%:
L ====

50%:
   //
  //
L ====
  \\
   \\

100%:
|| //
||//
L ====
||\\
|| \\
</code>```

(NOTE: When 2 and 3 are both at 100%, you'll have this state:

```<code>||   //
||  //
|| //
||//
L ========
||\\
|| \\
||  \\
||   \\
</code>```

4 is to toggle the type of light.

```<code>Default:
  //
L ==
  \\

After toggling (note the single space before '/' instead of two):
 /
L --
 \
</code>```

Input:

You will receive an input containing the possible button-presses. For example:

```<code>12-34
</code>```

Output:

The state of the light lamp after all the buttons of the input are sub-sequential pressed. So with the example input above, we have the following output:

```<code>L ------
</code>```

Challenge rules:

The input only contains 1234- (and never a - before the 4).

You can never go below 0% or above 100%. If a number would increase/decrease beyond these boundaries you can ignore it.

When the lamp is turned off, you can ignore any actions and when turned back on again it resets back to the initial ON-state (50% for both 2 and 3, and default 4). For example: 12-1-341 will just print the initial ON-state mentioned above. (TIP: You can ignore everything before the final 1 of the input - excluding -1.)

Trailing spaces equal to the length of the light or a single trailing new line is uninhibited. Adding extra unnecessary new lines isn't however.

You are allowed to take the input as a list of integers instead of a single string. So instead of 12-34, you can have [1,2,-3,4] as input.

General rules:

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

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>12-34
L ------

12-1-341
   //
  //
L ====
  \\
   \\

14-3224333-2
||  //
|| //
||//
L ======
||\\
|| \\
||  \\

142-1-314-3-322
L --------

1324-2-3
  /
 /
L ----
 \
  \

134
| /
|/
L ----
|\
| \

1-2-2-214-3-3-3
L ----
</code>```

答:
Python 2, 221 bytes

for b in[-1]+input():exec["p=b>0;d=2;s=1;t=2","d+=b/2*(-2<d+b<6)","s+=b/3*(-3<s+b<5)","t=3-t"][abs(b)-1]
i=c=(s>0)*d*p
q='print" |"[s/2]*t+" "*i+t*%r;'
exec('i-=1;'+q%'/')*c
print"L "+" -="[t]*2*d*p
exec(q%'\\'+'i+=1;')*c
```

This wound up being longer than I expected. The first line calculates the state of the lamp, the rest implement the printing.

Input is given via STDIN in the array form.

See the test cases on ideone

Title: What does this button do?

Body:
Python 2, 221 bytes

for b in[-1]+input():exec["p=b>0;d=2;s=1;t=2","d+=b/2*(-2<d+b<6)","s+=b/3*(-3<s+b<5)","t=3-t"][abs(b)-1]
i=c=(s>0)*d*p
q='print" |"[s/2]*t+" "*i+t*%r;'
exec('i-=1;'+q%'/')*c
print"L "+" -="[t]*2*d*p
exec(q%'\\'+'i+=1;')*c

This wound up being longer than I expected. The first line calculates the state of the lamp, the rest implement the printing.

Input is given via STDIN in the array form.

See the test cases on ideone


答:
Clojure, 46

```<code>#(partition-by identity(sort(re-seq #"\S" %)))
</code>```

Long and descriptive function names for simplest of things, yeah.

Title: Exploded view of a string

Body:
Don't you love those exploded-view diagrams  in which a machine or object is taken apart into its smallest pieces?

Let's do that to a string!

The challenge

Write a program or function that

inputs a string containing only printable ASCII characters;

dissects the string into groups of non-space equal characters (the "pieces" of the string);

outputs those groups in any convenient format, with some separator between groups.

For example, given the string

```<code>Ah, abracadabra!
</code>```

the output would be the following groups:

```
!
,
A
aaaaa
bb
c
d
h
rr
```

Each group in the output contains equal characters, with spaces removed. A newline has been used as separator between groups. More about allowed formats below.

Rules

The input should be a string or an array of chars. It will only contain printable ASCII chars (the inclusive range from space to tilde). If your language does not support that, you can take the input in the form of numbers representing ASCII codes.

You can assume that the input contains at least one non-space character.

The output should consist of characters (even if the input is by means of ASCII codes). There has to be an unambiguous separator between groups, different than any non-space character that may appear in the input.

If the output is via function return, it may also be an array or strings, or an array of arrays of chars, or similar structure. In that case the structure provides the necessary separation.

A separator between characters of each group is optional. If there is one, the same rule applies: it can't be a non-space character that may appear in the input. Also, it can't be the same separator as used between groups.

Other than that, the format is flexible. Here are some examples:

The groups may be strings separated by newlines, as shown above.

The groups may be separated by any non-ASCII character, such as  ¬. The output for the above input would be the string:

```<code>!¬,¬A¬aaaaa¬bb¬c¬d¬h¬rr
</code>```

The groups may be separated by n>1 spaces (even if n is variable), with chars between each group separated by a single space:

```<code>!  ,    A   a a a a a    b b  c       d   h  r r
</code>```

The output may also be an array or list of strings returned by a function:

```<code>['!', 'A', 'aaaaa', 'bb', 'c', 'd', 'h', 'rr']
</code>```

Or an array of char arrays:

```<code>[['!'], ['A'], ['a', 'a', 'a', 'a', 'a'], ['b', 'b'], ['c'], ['d'], ['h'], ['r', 'r']]
</code>```

Examples of formats that are not allowed, according to the rules:

A comma can't be used as separator (!,,,A,a,a,a,a,a,b,b,c,d,h,r,r), because the input may contain commas.

It's not accepted to drop the separator between groups (!,Aaaaaabbcdhrr) or to use the same separator between groups and within groups (! , A a a a a a b b c d h r r).

The groups may appear in any order in the output. For example: alphabetical order (as in the examples above), order of first appearance in the string, ... The order need not be consistent or even deterministic.

Note that the input cannot contain newline characters, and A and a are different characters (grouping is case-sentitive).

Shortest code in bytes wins.

Test cases

In each test case, first line is input, and the remaining lines are the output, with each group in a different line.

Test case 1:

```
Ah, abracadabra!
!
,
A
aaaaa
bb
c
d
h
rr
```

Test case 2:

```
\o/\o/\o/
///
\\\
ooo
```

Test case 3:

```
A man, a plan, a canal: Panama!
!
,,
:
A
P
aaaaaaaaa
c
ll
mm
nnnn
p
```

Test case 4:

```
"Show me how you do that trick, the one that makes me scream" she said
""
,
S
aaaaa
cc
dd
eeeeeee
hhhhhh
ii
kk
mmmm
n
ooooo
rr
ssss
tttttt
u
ww
y
```

Body:
Clojure, 46

#(partition-by identity(sort(re-seq #"\S" %)))

Long and descriptive function names for simplest of things, yeah.


Title: Sylvester's sequence

Body:
C, <s>43</s>, <s>34</s>, 33 bytes

1-indexed:

F(n){return--n?n=F(n),n*n-n+1:2;}

Test main:

int main() {
  printf("%d\n", F(1));
  printf("%d\n", F(2));
  printf("%d\n", F(3));
  printf("%d\n", F(4));
  printf("%d\n", F(5));
}


答:
R, <s>323</s> 320 bytes

```<code>    z=scan();a=c=1;b=d=2;for(i in 1:sum(1|z)){s=sign(y<-z[i]);switch(y/s,b<-d<-2*(c<-a<-y),b<-b+s,c<-c+s,d<-2-d);b=min(b,4);c=min(c,2);b=b*(b>0);c=c*(c>0)}
    s="/";v=if(c>1)"|"else" ";for(i in a*b:-b){if(i)cat(v,if(d)v,rep(" ",abs(i)-1),s,if(d)s,"\n",sep="")else{cat("L ",if(d)rep("==",b)else rep("--",b),"\n",sep="");s="\\"}}
</code>```

Ungolfed:

```<code>z=scan()
</code>```

reads a line of input (integers separated with spaces)

```<code>a=c=1;b=d=2
</code>```

initialises variables a (on-ness), b (brightness), c (width), d (beam type). d is either zero or two, which means we can call if(d) later rather than a longer if(d>1) or similar and save a couple of bytes.

```<code>while(any(z|1))
</code>```

A golf-y way of writing while(length(z)) where z is an integer vector.

The rest of the first line handles the input via a switch statement.
The second line prints out.

It is possible that some of the <- can be replaced with =, but I think you get eaten alive by lexical scoping...

Also note that in R, backslashes need to be escaped.

c*(c>0) is a golf-y way of writing max(c,0) that saves a character.

If the light isn't on, then since * has lower precedence than :, the for(i in a*b:-b) loop only iterates over 0:0 .

Update; saved 3 bytes by replacing the loop in the first line with a for (rather than while). Note that 1:sum(1|z) is fewer characters than 1:length(z) or seq_along(z). seq(z) would work in most cases, but not when z is of length one. The solution given will not work for input of length zero but I hope that is outside the scope of the competition.

Title: What does this button do?

Body:
Currently at my work we moved to a new building. It's supposed to be state of the art and has automatic lights, automatic roll-down shutters, and is now known as the most eco-friendly building in this town.

However, it doesn't really work all that well.. The roll-down shutters sometimes go down on cloudy days and up when the sun starts to shine, and the lights sometimes cause disco effects by alternating turning on and off every 5-10 minutes. Also, we don't have any manual way of controlling these roll-down shutters, nor the temperature, BUT we do have a remote for the lights.

These remotes however came without instruction manual and contain little over 20 buttons doing all kind of stuff except for what you seem to want..

PS: I wrote this challenge 1.5 months ago in the Sandbox. Currently we, kinda, know how the remotes work..

One big advantage about this building, it's 30+ degrees Celcius outside, but inside it stays the same 21 room temperature at all time.

So, that was the intro, and the remote control for the lights inspired this challenge.

Challenge:

Let's say we initially have a lamp turned off:

```<code>L
</code>```

Then we push all kind of buttons and output the state of the lamp afterwards.

We use the following numbers for the different functions of the remote control for the lamp. When a minus symbol is in front of that number, we do the opposite.

1 = ON; -1 = OFF.

2 = Increase strength by 25%; -2 = Decrease (dim) strength by 25%.

3 = Increase spread by 50%; -3 = Decrease spread by 50%.

4 = Toggling the type of light.

So, this is all pretty vague, so let's go a little more in depth what each thing means:

So, -1 (OFF) is pretty obvious, and 1 will go to the initial ON-state (50% for 2 and 50% for 3):

```<code>   //
  //
L ====
  \\
   \\
</code>```

2 and -2 is how far the light travels (== is appended for every 25%):

```<code>0% (equal to a light bulb that is OFF)
L

25%
L ==

50%
L ====

75%
L ======

100%
L ========
</code>```

3 and -3 is how far the light spreads:

```<code>0%:
L ====

50%:
   //
  //
L ====
  \\
   \\

100%:
|| //
||//
L ====
||\\
|| \\
</code>```

(NOTE: When 2 and 3 are both at 100%, you'll have this state:

```<code>||   //
||  //
|| //
||//
L ========
||\\
|| \\
||  \\
||   \\
</code>```

4 is to toggle the type of light.

```<code>Default:
  //
L ==
  \\

After toggling (note the single space before '/' instead of two):
 /
L --
 \
</code>```

Input:

You will receive an input containing the possible button-presses. For example:

```<code>12-34
</code>```

Output:

The state of the light lamp after all the buttons of the input are sub-sequential pressed. So with the example input above, we have the following output:

```<code>L ------
</code>```

Challenge rules:

The input only contains 1234- (and never a - before the 4).

You can never go below 0% or above 100%. If a number would increase/decrease beyond these boundaries you can ignore it.

When the lamp is turned off, you can ignore any actions and when turned back on again it resets back to the initial ON-state (50% for both 2 and 3, and default 4). For example: 12-1-341 will just print the initial ON-state mentioned above. (TIP: You can ignore everything before the final 1 of the input - excluding -1.)

Trailing spaces equal to the length of the light or a single trailing new line is uninhibited. Adding extra unnecessary new lines isn't however.

You are allowed to take the input as a list of integers instead of a single string. So instead of 12-34, you can have [1,2,-3,4] as input.

General rules:

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

Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.

Default Loopholes are forbidden.

If possible, please add a link with a test for your code.

Also, please add an explanation if necessary.

Test cases:

```<code>12-34
L ------

12-1-341
   //
  //
L ====
  \\
   \\

14-3224333-2
||  //
|| //
||//
L ======
||\\
|| \\
||  \\

142-1-314-3-322
L --------

1324-2-3
  /
 /
L ----
 \
  \

134
| /
|/
L ----
|\
| \

1-2-2-214-3-3-3
L ----
</code>```

Body:
R, <s>323</s> 320 bytes

    z=scan();a=c=1;b=d=2;for(i in 1:sum(1|z)){s=sign(y<-z[i]);switch(y/s,b<-d<-2*(c<-a<-y),b<-b+s,c<-c+s,d<-2-d);b=min(b,4);c=min(c,2);b=b*(b>0);c=c*(c>0)}
    s="/";v=if(c>1)"|"else" ";for(i in a*b:-b){if(i)cat(v,if(d)v,rep(" ",abs(i)-1),s,if(d)s,"\n",sep="")else{cat("L ",if(d)rep("==",b)else rep("--",b),"\n",sep="");s="\\"}}

Ungolfed:

z=scan()

reads a line of input (integers separated with spaces)

a=c=1;b=d=2

initialises variables a (on-ness), b (brightness), c (width), d (beam type). d is either zero or two, which means we can call if(d) later rather than a longer if(d>1) or similar and save a couple of bytes.

while(any(z|1))

A golf-y way of writing while(length(z)) where z is an integer vector.

The rest of the first line handles the input via a switch statement.
The second line prints out.

It is possible that some of the <- can be replaced with =, but I think you get eaten alive by lexical scoping...

Also note that in R, backslashes need to be escaped.

c*(c>0) is a golf-y way of writing max(c,0) that saves a character.

If the light isn't on, then since * has lower precedence than :, the for(i in a*b:-b) loop only iterates over 0:0 .

Update; saved 3 bytes by replacing the loop in the first line with a for (rather than while). Note that 1:sum(1|z) is fewer characters than 1:length(z) or seq_along(z). seq(z) would work in most cases, but not when z is of length one. The solution given will not work for input of length zero but I hope that is outside the scope of the competition.


答:
Java 8, <s>484</s> <s>483</s> <s>452</s> <s>446</s> 440 bytes

z->{int a=1,b=2,c=1,d=0,j,k;for(int i:z){d=i==1?0:i>3?1-d:d;a=i*i==1?i:a;b+=i==1?2-b:i==2&b<4?1:i==-2&b>0?-1:0;c+=i==1?1-c:i==3&c<2?1:i==-3&c>0?-1:0;}String t=d<1?"=":"-",q=d<1?"//":"/",x=d<1?"\\\\":"\\",n="\n",y=" ",w=d<1?y+y:y,g=c>1?d<1?"||":"|":w,r="";if(c>0)for(r+=g,j=b;j-->0;r+=q+n+(j>0?c>1?g:w:""))for(k=j;k-->0;r+=y);for(r+="L ",j=b;j-->0;r+=t+t);r+=n;if(c>0)for(r+=g;++j<b;r+=x+n+(j0;r+=y);return a>0?r:"L";}
```
<p>Finally.. Ok, my own challenge is a bit harder than I expected.. ;P</p>
<p>This can without a doubt be golfed by using a completely different approach.. I now first determine what to do, and then print it. The printing is actually the hardest of this challenge, imho.</p>
<p>-6 bytes thanks to <em>@ceilingcat</em>.</p>
<p><strong>Explanation:</strong></p>
<p>Try it here.</p>
<pre class="lang-java prettyprint-override"><code>z->{                          // Method with integer-array parameter and String return-type
  int a=1,                    //  ON/OFF flag, initially ON
      b=2,                    //  Strength, initially 50%
      c=1,                    //  Spread, initially 50%
      d=0,                    //  Type of light, initially two lines
      j,k;                    //  Index-integers
  for(int i:z){               //  Loop over the input-array
    d=i==1?0:i>3?1-d:d;       //   Determine the new type of light
    a=i*i==1?i:a;             //   Determine if the light is ON/OFF
    b+=i==1?2-b:i==2&b<4?1:i==-2&b>0?-1:0;
                              //   Determine the new strength
    c+=i==1?1-c:i==3&c<2?1:i==-3&c>0?-1:0;}
                              //   Determine the new spread
  String t=d<1?"=":"-",       //  Horizontal light symbol
         q=d<1?"//":"/",      //  Upper diagonal light symbol
         x=d<1?"\\\\":"\\",   //  Bottom diagonal light symbol
         n="\n",              //  New-line
         y=" ",               //  Space
         w=d<1?y+y:y,         //  One or two spaces?
         g=c>1?d<1?"||":"|":w,//  Space(s) or vertical light symbol(s)?
         r="";                //  Result String, starting empty
  if(c>0)                     //  Do we have spread >0%?
    for(r+=g,j=b;j-->0;r+=q+n+(j>0?c>1?g:w:""))for(k=j;k-->0;r+=y);
                              //   Create upper light part
  r+="L ";                    //  Light-bulb
  for(j=b;j-->0;r+=t+t);      //  Horizontal light next to the light-bulb
  r+=n;
  if(c>0)                     //  Do we have spread >0%?
    for(r+=g;++j<b;r+=x+n+(j<b-1?g:""))for(k=j;k-->0;r+=y);
                              //   Create bottom light part
  return a>0?                 //  Is the light turned ON?
             r                //   Return the created result-String
            :                 //  Else:
             "L";}            //   Return just "L"
</code>```

Title: What does this button do?

Body:
Java 8, <s>484</s> <s>483</s> <s>452</s> <s>446</s> 440 bytes

z->{int a=1,b=2,c=1,d=0,j,k;for(int i:z){d=i==1?0:i>3?1-d:d;a=i*i==1?i:a;b+=i==1?2-b:i==2&b<4?1:i==-2&b>0?-1:0;c+=i==1?1-c:i==3&c<2?1:i==-3&c>0?-1:0;}String t=d<1?"=":"-",q=d<1?"//":"/",x=d<1?"\\\\":"\\",n="\n",y=" ",w=d<1?y+y:y,g=c>1?d<1?"||":"|":w,r="";if(c>0)for(r+=g,j=b;j-->0;r+=q+n+(j>0?c>1?g:w:""))for(k=j;k-->0;r+=y);for(r+="L ",j=b;j-->0;r+=t+t);r+=n;if(c>0)for(r+=g;++j<b;r+=x+n+(j<b-1?g:""))for(k=j;k-->0;r+=y);return a>0?r:"L";}

Finally.. Ok, my own challenge is a bit harder than I expected.. ;P

This can without a doubt be golfed by using a completely different approach.. I now first determine what to do, and then print it. The printing is actually the hardest of this challenge, imho.

-6 bytes thanks to @ceilingcat.

Explanation:

<a href="https://tio.run/##lVLNctsgEL77KRgOGakCW0g@gZBeIM2lx6YH9GMPsoMTGceRHT27uyC5nXamM5UAsct@u9/CbqveFW3r3a3aq@MRfVXaXBcIaWObbqOqBj05FaFvttNmi6oALN9/oEso4HiABfNoldUVekIGSXS70PwKIKQkI6VMSAV7LWPSkp3YHDoXAGl@Ca@11FKyIuY6TwtGa14LJfUXf6i5EmU0AhJachCShzJbF8yJFOQ8LijjsagmFKOVM6UPVZZMKJDvqGHK38o6YwWWmGOKyduorVagrjD5GNVn@OAAfsRI/Gww6SVGmJy9uY963pOtrHJWePjnJ4BhnUknMRZ6EwBr6G7aRXJLWlmKltI8FqC@RSYKWkjKeW/5mWMceuhOtmJ3R/WhmNzxI/D@EcFGNnS7@ZtIRFGblc704UmykjqKfxF0jT11BinIpeP4EYvhJhZQy9dTuYdaTiV9P@gavUBPBOP7QeVVODVEf7TNy/JwsstXMNm9CcyyCkxzRr5FrowkhKZkPYS@V/7Xg3knwua4rZ1PAmNNUj9oMs/9zjuFGqPNCZF6cupuPM9t1vO4@H7@zvMX37AYbj8B" rel="nofollow noreferrer">Try it here.

z->{                          // Method with integer-array parameter and String return-type
  int a=1,                    //  ON/OFF flag, initially ON
      b=2,                    //  Strength, initially 50%
      c=1,                    //  Spread, initially 50%
      d=0,                    //  Type of light, initially two lines
      j,k;                    //  Index-integers
  for(int i:z){               //  Loop over the input-array
    d=i==1?0:i>3?1-d:d;       //   Determine the new type of light
    a=i*i==1?i:a;             //   Determine if the light is ON/OFF
    b+=i==1?2-b:i==2&b<4?1:i==-2&b>0?-1:0;
                              //   Determine the new strength
    c+=i==1?1-c:i==3&c<2?1:i==-3&c>0?-1:0;}
                              //   Determine the new spread
  String t=d<1?"=":"-",       //  Horizontal light symbol
         q=d<1?"//":"/",      //  Upper diagonal light symbol
         x=d<1?"\\\\":"\\",   //  Bottom diagonal light symbol
         n="\n",              //  New-line
         y=" ",               //  Space
         w=d<1?y+y:y,         //  One or two spaces?
         g=c>1?d<1?"||":"|":w,//  Space(s) or vertical light symbol(s)?
         r="";                //  Result String, starting empty
  if(c>0)                     //  Do we have spread >0%?
    for(r+=g,j=b;j-->0;r+=q+n+(j>0?c>1?g:w:""))for(k=j;k-->0;r+=y);
                              //   Create upper light part
  r+="L ";                    //  Light-bulb
  for(j=b;j-->0;r+=t+t);      //  Horizontal light next to the light-bulb
  r+=n;
  if(c>0)                     //  Do we have spread >0%?
    for(r+=g;++j<b;r+=x+n+(j<b-1?g:""))for(k=j;k-->0;r+=y);
                              //   Create bottom light part
  return a>0?                 //  Is the light turned ON?
             r                //   Return the created result-String
            :                 //  Else:
             "L";}            //   Return just "L"


问:
Print numbers from 1 to 10
This might be a very simple challenge, but I am surprised it hasn't been done on code-golf yet:

Print all Integers from 1 to 10 inclusive in ascending order to standard output.

Your output format can be whatever your language supports. This includes arbitrary separators (commas, semicolons, newlines, combinations of those, etc., but no digits), and prefixes and postfixes (like [...]). However, you may not output any other numbers than 1 through 10. Your program may not take any input. Standard loopholes are disallowed.

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

Leaderboard

var QUESTION_ID=86075,OVERRIDE_USER=42570;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

```

答:
Brain-Flak, 30 bytes

```<code>((()()()()()){}){(({})[()])}{}
</code>```

Try it online!

Explanation

For a documentation of what each command does, see the GitHub page.

```<code>((()()()()()){}){(({})[()])}{}

((()()()()()){})                 push 10
                {(({})[()])}     while top != 0: pop top, push top, push top-1
                            {}   pop
</code>```

Title: Print numbers from 1 to 10

Body:
Brain-Flak, 30 bytes

((()()()()()){}){(({})[()])}{}

Try it online!

Explanation

For a documentation of what each command does, see the GitHub page.

((()()()()()){}){(({})[()])}{}

((()()()()()){})                 push 10
                {(({})[()])}     while top != 0: pop top, push top, push top-1
                            {}   pop


答:
Kotlin, 68 bytes

```<code>{"""  |
 /_\${it.replace(Regex("."),"\n |\$0|")}
 |_|
/___\
 VvV"""}
</code>```

Pretty straightforward. Uses multiline string and a regex replacement. This is a lambda with (String)->String type. Test:

```<code>fun main(args: Array<String>) {
    val function : (String)->String = {"""  |
 /_\${it.replace(Regex("."),"\n |\$0|")}
 |_|
/___\
 VvV"""}
    println(function(" _ _ "))
}
</code>```

Title: This isn't rocket science

Body:
Kotlin, 68 bytes

{"""  |
 /_\${it.replace(Regex("."),"\n |\$0|")}
 |_|
/___\
 VvV"""}

Pretty straightforward. Uses multiline string and a regex replacement. This is a lambda with (String)->String type. Test:

fun main(args: Array<String>) {
    val function : (String)->String = {"""  |
 /_\${it.replace(Regex("."),"\n |\$0|")}
 |_|
/___\
 VvV"""}
    println(function(" _ _ "))
}


答:
Hexagony, 27 bytes

```<code>1{?)=}&~".>")!@(</=+={"/>}*
</code>```

Unfolded:

```<code>    1 { ? )
   = } & ~ "
  . > " ) ! @
 ( < / = + = {
  " / > } * .
   . . . . .
    . . . .
</code>```

Try it online!

Explanation

Let's consider the sequence b(a) = a(n) - 1 and do a little rearranging:

```<code>b(a) = a(n) - 1
     = a(n-1)*(a(n-1)-1) + 1 - 1
     = (b(n-1) + 1)*(b(n-1) + 1 - 1)
     = (b(n-1) + 1)*b(n-1)
     = b(n-1)^2 + b(n-1)
</code>```

This sequence is very similar but we can defer the increment to the very end, which happens to save a byte in this program.

So here is the annotated source code:

Created with Timwi's HexagonyColorer.

And here is a memory diagram (the red triangle shows the memory pointer's initial position and orientation):

Created with Timwi's EsotericIDE.

The code begins on the grey path which wraps the left corner, so the initial linear bit is the following:

```<code>1{?)(
1      Set edge b(1) to 1.
 {     Move MP to edge N.
  ?    Read input into edge N.
   )(  Increment, decrement (no-op).
</code>```

Then the code hits the < which is a branch and indicates the start (and end) of the main loop. As long as the N edge has a positive value, the green path will be executed. That path wraps around the grid a few times, but it's actually entirely linear:

```<code>""~&}=.*}=+={....(
</code>```

The . are no-ops, so the actual code is:

```<code>""~&}=*}=+={(
""             Move the MP to edge "copy".
  ~            Negate. This is to ensure that the value is negative so that &...
   &           ...copies the left-hand neighbour, i.e. b(i).
    }=         Move the MP to edge b(i)^2 and turn it around.
      *        Multiply the two copies of b(i) to compute b(i)^2.
       }=      Move the MP back to edge b(i) and turn it around.
         +     Add the values in edges "copy" and b(i)^2 to compute
               b(i) + b(i)^2 = b(i+1).
          ={   Turn the memory pointer around and move to edge N.
            (  Decrement.
</code>```

Once this decrementing reduces N to 0, the red path is executed:

```<code>")!@
"     Move MP back to edge b(i) (which now holds b(N)).
 )    Increment to get a(N).
  !   Print as integer.
   @  Terminate the program.
</code>```

Title: Sylvester's sequence

Body:
Hexagony, 27 bytes

1{?)=}&~".>")!@(</=+={"/>}*

Unfolded:

    1 { ? )
   = } & ~ "
  . > " ) ! @
 ( < / = + = {
  " / > } * .
   . . . . .
    . . . .

Try it online!

Explanation

Let's consider the sequence b(a) = a(n) - 1 and do a little rearranging:

b(a) = a(n) - 1
     = a(n-1)*(a(n-1)-1) + 1 - 1
     = (b(n-1) + 1)*(b(n-1) + 1 - 1)
     = (b(n-1) + 1)*b(n-1)
     = b(n-1)^2 + b(n-1)

This sequence is very similar but we can defer the increment to the very end, which happens to save a byte in this program.

So here is the annotated source code:

Created with Timwi's HexagonyColorer.

And here is a memory diagram (the red triangle shows the memory pointer's initial position and orientation):

Created with Timwi's EsotericIDE.

The code begins on the grey path which wraps the left corner, so the initial linear bit is the following:

1{?)(
1      Set edge b(1) to 1.
 {     Move MP to edge N.
  ?    Read input into edge N.
   )(  Increment, decrement (no-op).

Then the code hits the < which is a branch and indicates the start (and end) of the main loop. As long as the N edge has a positive value, the green path will be executed. That path wraps around the grid a few times, but it's actually entirely linear:

""~&}=.*}=+={....(

The . are no-ops, so the actual code is:

""~&}=*}=+={(
""             Move the MP to edge "copy".
  ~            Negate. This is to ensure that the value is negative so that &...
   &           ...copies the left-hand neighbour, i.e. b(i).
    }=         Move the MP to edge b(i)^2 and turn it around.
      *        Multiply the two copies of b(i) to compute b(i)^2.
       }=      Move the MP back to edge b(i) and turn it around.
         +     Add the values in edges "copy" and b(i)^2 to compute
               b(i) + b(i)^2 = b(i+1).
          ={   Turn the memory pointer around and move to edge N.
            (  Decrement.

Once this decrementing reduces N to 0, the red path is executed:

")!@
"     Move MP back to edge b(i) (which now holds b(N)).
 )    Increment to get a(N).
  !   Print as integer.
   @  Terminate the program.


答:
Brachylog, 13 bytes

```<code>0,2|-:0&-y+*+
</code>```

Try it online!

Uses this relationship instead:

which is derived from this relationship modified from that provided in the sequence:

a(n+1) = a(n) * (a(n) - 1) + 1.

Title: Sylvester's sequence

Body:
Brachylog, 13 bytes

0,2|-:0&-y+*+

Try it online!

Uses this relationship instead:

which is derived from this relationship modified from that provided in the sequence:

a(n+1) = a(n) * (a(n) - 1) + 1.


Title: This isn't rocket science

Body:
C, <s>83</s>, 82 bytes

F(char*c){for(puts("  |\n /_\\");*c;printf(" |%c|\n",*c++));puts(" |_|\n/___\\\n VvV");}

Test main:

int main() {
  F("");
  F("a");
  F("|0");
  F("\\/\\");
  F(" _ _ ");
  F("    ");
  F("SPACEY");
}


答:
class Evil {
    public static void main(String... args) {
        String s1 = "Good";
        s1 += "morning";
        int a = 7;
        if (s1 != s1.intern())
            try {
                a--;
                javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar().equals(null);
            } catch (Throwable e) {
                a--;
            }
        System.out.println(a);
    }
}
```

The interning algorithm changed between Java 6 and 7. See https://stackoverflow.com/a/7224864/540552

XMLGregorianCalendar.equals(null) used to throw NullPointerException in java 5, but this was fixed in java 6. See http://bugs.sun.com/view_bug.do?bug_id=6285370

100 96 92 87 85 tokens here.
Thanks to Peter Taylor for reducing 7 tokens.

Title: Write a java code to detect the JVM version

Body:
The objective is to write java code that detects the JVM version relying in compatibility changes, side effects, bugs and/or undefined behavior that works in a way in one version and another way in another version. Further, the code should be at least a bit readable, without sacrificing whitespaces and legible variable names.

To ensure that objective, the exact formal rules are:

The code must be written in java and should output the JRE version in which it is running.

The code must not use any JDK or JRE API provided specifically for detecting the java version or which gives the JDK or JRE version for free.

The code must not use reflection.

The code is only required to work in Hotspot Java SE 5, 6 and 7, but may work in other JVMs.

The code must not use any third-party libraries in the classpath.

The code must not start any other process, java or not.

The code must not use environment variables.

The code must not search the file system looking for pre-existing files or folders.

The code must be contained in a single file and be called via public static void main(String[] args) or public static void main(String... args).

The code must not use any non-public API present in the JRE.

The code must not generate any NoClassDefFoundError, NoSuchMethodError, ClassNotFoundException or NoSuchMethodException during its execution.

The code should run in a system disconnected from the internet or from any local network.

You should provide an explanation of why it behaves in one way in a version and another way in another version.

Scoring

The method used for measuring the best solution is max(n/s), where n is the number of different java versions detected without violating any of these rules (at least versions 5, 6 and 7) and s is the number of lexical tokens in the solution.

Body:
class Evil {
    public static void main(String... args) {
        String s1 = "Good";
        s1 += "morning";
        int a = 7;
        if (s1 != s1.intern())
            try {
                a--;
                javax.xml.datatype.DatatypeFactory.newInstance().newXMLGregorianCalendar().equals(null);
            } catch (Throwable e) {
                a--;
            }
        System.out.println(a);
    }
}

The interning algorithm changed between Java 6 and 7. See https://stackoverflow.com/a/7224864/540552

XMLGregorianCalendar.equals(null) used to throw NullPointerException in java 5, but this was fixed in java 6. See http://bugs.sun.com/view_bug.do?bug_id=6285370

100 96 92 87 85 tokens here.
Thanks to Peter Taylor for reducing 7 tokens.


答:
Javascript (using external lib - Enumerable) (84 bytes)

```<code>n=>" |\n /_\\\n"+_.From(n).WriteLine(x=>" |"+x+"|")+(n?"\n":'')+" |_|\n/___\\\n VvV"
</code>```

Link to lib: https://github.com/mvegh1/Enumerable

Code explanation: Pretty straight forward. Just boilerplates the rocketship template (top and bottom), and concats the fuselage string in the middle. Whats eating up a lot of bytes is the check if the input is truthy, because for an empty string it's wrong to add a newline to the beginning of the bottom template

I love how the native JS answer blows this away...

Title: This isn't rocket science

Body:
Write a program or function that takes in a single-line string. You can assume it only contains printable ASCII. Print or return a string of an ASCII art rocket such as

```<code>  |
 /_\
 |E|
 |a|
 |r|
 |t|
 |h|
 |_|
/___\
 VvV
</code>```

with the input string written from top to bottom on the fuselage. In this case the input was Earth. The height of the rocket (including flames) is always the length of the string plus five.

Each line in the output may have up to two trailing spaces and there may be a single optional trailing newline. The shortest code in bytes wins.

More Examples:

```<code>[empty string]

  |
 /_\
 |_|
/___\
 VvV

a

  |
 /_\
 |a|
 |_|
/___\
 VvV

|0

  |
 /_\
 |||
 |0|
 |_|
/___\
 VvV

\/\

  |
 /_\
 |\|
 |/|
 |\|
 |_|
/___\
 VvV

 _ _ [note trailing space]

  |
 /_\
 | |
 |_|
 | |
 |_|
 | |
 |_|
/___\
 VvV

    [4 spaces]

  |
 /_\
 | |
 | |
 | |
 | |
 |_|
/___\
 VvV

SPACEY

  |
 /_\
 |S|
 |P|
 |A|
 |C|
 |E|
 |Y|
 |_|
/___\
 VvV
</code>```

Leaderboard

var QUESTION_ID=91182,OVERRIDE_USER=26997;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:
Javascript (using external lib - Enumerable) (84 bytes)

n=>" |\n /_\\\n"+_.From(n).WriteLine(x=>" |"+x+"|")+(n?"\n":'')+" |_|\n/___\\\n VvV"

Link to lib: https://github.com/mvegh1/Enumerable

Code explanation: Pretty straight forward. Just boilerplates the rocketship template (top and bottom), and concats the fuselage string in the middle. Whats eating up a lot of bytes is the check if the input is truthy, because for an empty string it's wrong to add a newline to the beginning of the bottom template

I love how the native JS answer blows this away...


Title: Sylvester's sequence

Body:
Sylvester's sequence, OEIS A000058, is an integer sequence defined as follows:

Each member is the product of all previous members plus one.  The first member of the sequence is 2.

Task

Create a program to calculate the nth term of Sylvester's Sequence.  Standard input, output and loopholes apply.

Standard sequence rules apply.

This is code-golf, so the goal is to minimize the size of your source code as measured in bytes.

Test Cases

You may use either zero or one indexing. (Here I use zero indexing)

```<code>>>0
2
>>1
3
>>2
7
>>3
43
>>4
1807
</code>```

Body:
PowerShell v2+, 56 bytes

param($n)$a=,2;0..$n|%{$a+=($a-join'*')+'+1'|iex};$a[$n]

Iterative version. Takes input, sets the first value in our array $a, loops. Each loop we take all of $a, -join them together with *, tack on a +1, and pipe to Invoke-Expression (similar to eval). That's stored as a new value on the end of $a. Then, we just index into $a for the requested number.

Calculates one index higher than necessary, which shouldn't be a problem. Output is solid until you reach the limits of round-trip precision issues and/or formatting issues where PowerShell converts to scientific notation.

PS C:\Tools\Scripts\golfing> 0..10|%{"$_ -> "+(.\sylvesters-sequence.ps1 $_)}
0 -> 2
1 -> 3
2 -> 7
3 -> 43
4 -> 1807
5 -> 3263443
6 -> 10650056950807
7 -> 1.13423713055422E+26
8 -> 1.28649386832787E+52
9 -> 1.65506647324521E+104
10 -> 2.73924503086033E+208

The recursive version is one byte longer, at 57 bytes, using PowerShell's equivalent of a lambda -- $x={param($n)if(!$n){2}else{(&$x(--$n))*((&$x($n))-1)+1}}. Call it via something like &$x(4)

You could tack on a [bigint] for the iex expression to carry forward the good precision as follows -- param($n)$a=,2;0..$n|%{$a+='[bigint]"'+($a-join'"*"')+'"+"1"'|iex};$a[$n] for 73 bytes (corrected thanks to Brad Gilbert b2gills).

PS C:\Tools\Scripts\golfing> 0..10|%{"$_ -> "+(.\sylvesters-sequence.ps1 $_)}
0 -> 2
1 -> 3
2 -> 7
3 -> 43
4 -> 1807
5 -> 3263443
6 -> 10650056950807
7 -> 113423713055421844361000443
8 -> 12864938683278671740537145998360961546653259485195807
9 -> 165506647324519964198468195444439180017513152706377497841851388766535868639572406808911988131737645185443
10 -> 273924503086030314234102342916746862811943643675809146279473679416086920262269936343321184045824386349295487372839923697584879743063177305807538834294603
44956410077034761330476016739454649828385541500213920807


答:
MATL, 12 bytes

This can definitely be golfed further

```<code>Hiq:"tpQh]0)
</code>```

This solution uses 1-based indexing.

Try it online!

Title: Sylvester's sequence

Body:
MATL, 12 bytes

This can definitely be golfed further

Hiq:"tpQh]0)

This solution uses 1-based indexing.

Try it online!


答:
Javascript (Using external library - Enumerable) (52 bytes)

```<code>n=>_.Sequence(n,(i,a)=>_.From(a).Product()+1).Last()
</code>```

Link to lib: https://github.com/mvegh1/Enumerable

Code explanation: Static method on library "Sequence" will generate a sequence of elements for a count of 'n', according to the predicate accepting params "i"teration, "a"ccumulated-array. The predicate states to cast the array to the library's Enumerable data-type, use the built in Product method on it, then add 1 to that value. After the sequence is generated, take the last value because the problem states to just find the 'N'th element of the sequence

Title: Sylvester's sequence

Body:
Javascript (Using external library - Enumerable) (52 bytes)

n=>_.Sequence(n,(i,a)=>_.From(a).Product()+1).Last()

Link to lib: https://github.com/mvegh1/Enumerable

Code explanation: Static method on library "Sequence" will generate a sequence of elements for a count of 'n', according to the predicate accepting params "i"teration, "a"ccumulated-array. The predicate states to cast the array to the library's Enumerable data-type, use the built in Product method on it, then add 1 to that value. After the sequence is generated, take the last value because the problem states to just find the 'N'th element of the sequence


Title: This isn't rocket science

Body:
Gema, 50 characters

\A=  |\n\ /_\\\n
?=\ |?|\n
\Z=\ |_|\n/___\\\n\ VvV

Sample run:

bash-4.3$ echo -n gema | gema '\A=  |\n\ /_\\\n;?=\ |?|\n;\Z=\ |_|\n/___\\\n\ VvV'
  |
 /_\
 |g|
 |e|
 |m|
 |a|
 |_|
/___\
 VvV


答:
PowerShell v2+, <s>59</s> <s>55</s> 51 bytes

"  |
 /_\"
$args|% t*y|%{" |$_|"}
" |_|
/___\
 VvV"
```

Try it online!

Abuses the default Write-Output at end of execution to stick a newline between each element, since these are all just literal strings on the pipeline. The only "tricky" bit is a loop through each element of the input $args as a char-array to get the body of the rocket.

Uses literal newlines as pointed out by ConnorLSW to save some bytes.

-4 more bytes thanks to Veskah.

Title: This isn't rocket science

Body:
PowerShell v2+, <s>59</s> <s>55</s> 51 bytes

"  |
 /_\"
$args|% t*y|%{" |$_|"}
" |_|
/___\
 VvV"

Try it online!

Abuses the default Write-Output at end of execution to stick a newline between each element, since these are all just literal strings on the pipeline. The only "tricky" bit is a loop through each element of the input $args as a char-array to get the body of the rocket.

Uses literal newlines as pointed out by ConnorLSW to save some bytes.

-4 more bytes thanks to Veskah.


答:
PARI/GP, <s>29</s> 25 bytes

```<code>a(n)=prod(i=0,n-1,a(i))+1
</code>```

Thanks to alephalpha for shaving off 4 bytes.

Title: Sylvester's sequence

Body:
PARI/GP, <s>29</s> 25 bytes

a(n)=prod(i=0,n-1,a(i))+1

Thanks to alephalpha for shaving off 4 bytes.


问:
Smallest palindrome divisible by the input
Given a positive integer N, output the smallest positive integer such that this number is a palindrome (i.e. is its own reverse) and is divisible by N.

The palindrome (i.e. the output) must not need a leading zero to be a palindrome, e.g. 080 is not the valid answer for 16.

The input will never be a multiple of 10, because of the previous reason.

Your program may take as much time as necessary, even if in practice it would be way too long to output the answer.

Inputs and outputs

You may take the input through STDIN, as a function argument, or anything similar.

You may print the output to STDOUT, return it from a function, or anything similar.

Inputs and outputs must be in the decimal base.

Test cases

```<code>N        Output
1        1
2        2
16       272
17       272
42       252
111      111
302      87278
1234     28382
</code>```

Scoring

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

答:
Python 2, 66 65 bytes

i is input and x is (eventually) output

def f(i,x):
    y=x if x%i==0&&`x`==`x`[::-1]else f(i,x+1)
    return y
```

After scrolling through other answers I found a shorter Python 2 answer but I put the effort into my solution so might as well throw it here. ¯\_(ツ)_/¯

Body:
Python 2, 66 65 bytes

i is input and x is (eventually) output

def f(i,x):
    y=x if x%i==0&&`x`==`x`[::-1]else f(i,x+1)
    return y

After scrolling through other answers I found a shorter Python 2 answer but I put the effort into my solution so might as well throw it here. ¯\_(ツ)_/¯


问:
Produce the number 2014 without any numbers in your source code

Note to challenge writers as per meta consensus:
This question was well-received when it was posted, but challenges
like this, asking answerers to Do X without using
Y
are likely to be poorly received. Try using the
sandbox
to get feedback on if you want to post a similar challenge.

It's <s>2017</s> <s>2018</s> <s>2019</s> <s>2020</s> <s>2021</s> <s>2022</s> 2023 already, folks, go home.

So, now that it's 2014, it's time for a code question involving the number 2014.

Your task is to make a program that prints the number 2014, without using any of the characters 0123456789 in your code, and independently of any external variables such as the date or time or a random seed.

The shortest code (counting in bytes) to do so in any language in which numbers are valid tokens wins.

Leaderboard:

var QUESTION_ID=17005,OVERRIDE_USER=7110;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

```

答:
Swift 2.2, 28 bytes

```<code>print("\(ENOTDIR)\(EFAULT)")
</code>```

Falling back on Darwin/glibc error codes from errno.h.

Body:
Swift 2.2, 28 bytes

print("\(ENOTDIR)\(EFAULT)")

Falling back on Darwin/glibc error codes from errno.h.


答:
BASH 84 70

Saved 14 thanks to manatwork

```<code>(cat&&echo _)|sed 's~.~ |&|\n~g;1s~^~  |\n /_\\\n~;$s~$~/___\\\n VvV~'
</code>```

Over half of the bytes are for adding the nose, and engine.

Title: This isn't rocket science

Body:
BASH 84 70

Saved 14 thanks to manatwork

(cat&&echo _)|sed 's~.~ |&|\n~g;1s~^~  |\n /_\\\n~;$s~$~/___\\\n VvV~'

Over half of the bytes are for adding the nose, and engine.


Title: Sylvester's sequence

Body:
Prolog, 49 bytes

a(0,2).
a(N,R):-N>0,M is N-1,a(M,T),R is T*T-T+1.


答:
Mathematica, 16 bytes

```<code>FromDigits@"JAE"
</code>```

Title: Produce the number 2014 without any numbers in your source code

Body:
Note to challenge writers as per meta consensus:
This question was well-received when it was posted, but challenges
like this, asking answerers to Do X without using
Y
are likely to be poorly received. Try using the
sandbox
to get feedback on if you want to post a similar challenge.

It's <s>2017</s> <s>2018</s> <s>2019</s> <s>2020</s> <s>2021</s> <s>2022</s> 2023 already, folks, go home.

So, now that it's 2014, it's time for a code question involving the number 2014.

Your task is to make a program that prints the number 2014, without using any of the characters 0123456789 in your code, and independently of any external variables such as the date or time or a random seed.

The shortest code (counting in bytes) to do so in any language in which numbers are valid tokens wins.

Leaderboard:

var QUESTION_ID=17005,OVERRIDE_USER=7110;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:
Mathematica, 16 bytes

FromDigits@"JAE"