问:
Can you outgolf me? (Cops section)

Cops section

The robbers section can be found here.

Thanks to FryAmTheEggman, Peter Taylor, Nathan Merrill, xnor, Dennis, Laikoni and Mego for their contributions.

Challenge

Your task is to write 2 different programs (full programs/functions/etc.) in the same language and the same version (e.g. Python 3.5 ≠ Python 3.4, so that is not allowed), and when given n (using STDIN/function arguments/etc.), compute a(n) where a is an OEIS sequence of your choice. One of those programs is shorter than the other. You only need to submit the longer program of the two. The other one needs to be saved in case of not being cracked after 7 days. Your submission is cracked when your program has been outgolfed (whether it is by 1 byte or more).

For example, if the task you chose was to perform 2 × n, this could be a valid submission (in Python 2):

Python 2, 16 bytes, score = 15 / 16 = 0.9375

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

If your submission has been cracked, then you need to state that in your header like so:

Python 2, 16 bytes, score = 15 / 16 = 0.9375, [cracked] + link

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

Offset

This can be found on every OEIS page. For example, for A005843, the offset is 0,2. We only need to use the first one, which is 0. This means that the function is defined for all numbers ≥ 0.

In other words, the function OEIS(n) starts with n = 0. Your program needs to work for all cases given by OEIS.

More information can be found here.

Scoring

The score you get for your submission is equal to the following formula:

Score = Length (in bytes) of secret code ÷ Length (in bytes) of public code

The example above has the score 15 ÷ 16 = 0.9375.

The submission with the lowest score wins. Only submissions that have posted their solution will be eligible for winning.

Rules

The task you need to do is an OEIS sequence of your choice.

Given n, output OEIS(n). Deviation is not allowed, so you need to produce the exact same sequence (when given n, you need to output OEIS(n)).

Submissions that are not cracked within a period of 7 days are considered safe after the solution has been posted (submissions older than 7 days that do not have their solution posted are still vulnerable in being cracked).

In your submission, you need to post the following things: language name, byte count, full code, so no pastebin links etc. (to prevent answers like Unary), OEIS sequence, score with lengths of both programs and additionally, the encoding that is used.

Note: the same sequence cannot be posted twice in the same language. (For example, if the sequence A005843 has been done in Pyth, you cannot use Pyth again for that same sequence.)

Input and output are both in decimal (base 10)

Leaderboard

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

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Note

This challenge is finished. The final winner is feersum with his Seed answer. Congratulations! :).

You can still submit new cops, but be aware that they are no longer competing.

Title: Can you outgolf me? (Cops section)

Body:
Woefully, (noncompeting, but you still get points for cracking it), <s>520/776= ~0.67</s> Cracked by Feersum.

Computes A000042 (would compute repunits, but that one has 0 as first member)

Offset 1, zero indexed (0 outputs 1, 1 outputs 11, 2 outputs 111, etc.)

| |||||||| | |
|| |||||| |
||| |||| |
|||| || |
||||| || |
|||| |||| |
||| |||||| |
|| |||||||| |
| |||||||||| |
|| ||||||||| |
||| |||||||| |
|||||||||||| |
|||||||||||| |
|||||||||||| |
||||||||||| |
|||||||||| |
|||||||||| |
|||||||||| |
|||||||||| |
||||||||||| |
|||||||||||| |
||||||||||||| |
|||||||||||| |
||||||||||| |
|||||||||| |
||||||||| |
|||||||| |
||||||| |
|||||| |
||||| |
|||| |
||| |
|| |
|| |
|| |
| |
| |
| |
| |
| |
|| |
|| |
|| |
||| |
|||| |
||||| |
|||||| |
||||||| |
|||||||| |
||||||| |
|||||||| |
||||||||| |
|||||||||| |
||||||||||| |
|||||||||||| |
||||||||||||| |
|||||||||||| |
||||||||||| |
|||||||||| |
||||||||| |
|||||||| |
||||||| |
|||||| |
||||| |
|||| |
||| |
|| |
|| |
|| |
|| |
||| |
|||| |
||| |
|| |
| |
| |
| |
|| |
|| |
|| |
|| |

<a href="http://woefully.tryitonline.net/#code=fCB8fHx8fHx8fCB8IHwKfHwgfHx8fHx8IHwKfHx8IHx8fHwgfAp8fHx8IHx8IHwKfHx8fHwgfHwgfAp8fHx8IHx8fHwgfAp8fHwgfHx8fHx8IHwKfHwgfHx8fHx8fHwgfAp8IHx8fHx8fHx8fHwgfAp8fCB8fHx8fHx8fHwgfAp8fHwgfHx8fHx8fHwgfAp8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8IHwKfHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHwgfAp8fHx8fHx8fHwgfAp8fHx8fHx8fCB8Cnx8fHx8fHwgfAp8fHx8fHwgfAp8fHx8fCB8Cnx8fHwgfAp8fHwgfAp8fCB8Cnx8IHwKfHwgfAp8IHwKfCB8CnwgfAp8IHwKfCB8Cnx8IHwKfHwgfAp8fCB8Cnx8fCB8Cnx8fHwgfAp8fHx8fCB8Cnx8fHx8fCB8Cnx8fHx8fHwgfAp8fHx8fHx8fCB8Cnx8fHx8fHwgfAp8fHx8fHx8fCB8Cnx8fHx8fHx8fCB8Cnx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fHwgfAp8fHx8fHx8fHx8fCB8Cnx8fHx8fHx8fHwgfAp8fHx8fHx8fHwgfAp8fHx8fHx8fCB8Cnx8fHx8fHwgfAp8fHx8fHwgfAp8fHx8fCB8Cnx8fHwgfAp8fHwgfAp8fCB8Cnx8IHwKfHwgfAp8fCB8Cnx8fCB8Cnx8fHwgfAp8fHwgfAp8fCB8CnwgfAp8IHwKfCB8Cnx8IHwKfHwgfAp8fCB8Cnx8IHw&input=Mw" rel="nofollow">Try it online!

I like to think that my shorter solution was a pretty nice one.

| || || |
|| || |
||| || |
|||| || |
||||| || |
|||| |||| |
||| ||||| |
|| |||||| |
| ||||||| |
|| |||||| |
||| ||||| |
||| |||| |
|||| || |
||| ||| |
|| |||| |
| ||||| |
|||||||| |
||||||||| |
|||||||||| |
|||||||||| |
||||||||| |
|||||||| |
||||||| |
|||||| |
||||| |
||||| |
||||| |
|||| |
|||| |
|||| |
|||| |
|||| |
||| |
||| |
||| |
|||| |
|||| |
||||| |
||||| |
|||||| |
||||| |
|||| |
||| |
|| |
| |
| |
| |
| |
|| |
||| |
||| |
|||| |
||| |
|| |
| |
| |
| |
|| |
|| |
|| |
|| |
||| |
||| |
|||| |
||| |
|| |
| |

What I did was remove the push one command from the top, replace it at the bottom and at the end of the first command, which was free because I just had to replace some pipes, which then allowed me to shorten the push nine commands some more, because it didn't need to move that much anymore


问:
Greater than less than greater than something fishy
Given a length N string of less-than and greater-than signs (<, >), insert the integers 0 through N at the start and end and in between each pair of signs such that all the inequalities are satisfied. Output the resulting string. If there are multiple valid outputs, output any one (and just one) of them.

For example

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

has 7 characters so all the numbers from 0 to 7 inclusive must be inserted. A valid output is

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

because all the inequalities taken one at a time

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

are true.

If desired, the output may have spaces surrounding the signs, e.g. 2 < 3 < 4 > 1 < 5 > 0 < 6 < 7.

The shortest code in bytes wins.

Test Cases

The first line after an empty line is the input and the next line(s) are each valid output examples.

```<code>[empty string]
0

<
0<1

>
1>0

<<
0<1<2

<>
1<2>0

><
1>0<2
2>0<1

>>
2>1>0

<<<
0<1<2<3

><>
1>0<3>2

>><
3>2>0<1
3>1>0<2
2>1>0<3

>>>
3>2>1>0

>>><<<
3>2>1>0<4<5<6
6>3>1>0<2<4<5
4>2>1>0<3<5<6
4>3>1>0<2<5<6

<<><><<
2<3<4>1<5>0<6<7

>><><>>
7>6>0<5>1<4>3>2

<<<<<<<<<<<<<<
0<1<2<3<4<5<6<7<8<9<10<11<12<13<14

>><<<<><>><><<
6>5>4<7<8<9<10>3<11>2>1<12>0<13<14
14>5>4<7<8<9<10>3<11>2>1<12>0<13<6
</code>```

答:
Perl, 29 bytes

Includes +2 for -lp

Run with input on STDIN, e.g.

```<code>order.pl <<< "<<><><<"
</code>```

Output:

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

order.pl:

```<code>#!/usr/bin/perl -lp
s%%/\G</?$a++:y///c-$b++%eg
</code>```

Explanation

Have two counters, max starting with the string length, min starting with 0. Then at each boundary (including start and end of string) if it is just before a < put the minimum there and increase by 1, otherwise put the maximum there and decrease by 1 (at the end of the string it doesn't matter which counter you take since they are both the same)

ContentLicense: CC BY-SA 3.0

Body:
Perl, 29 bytes

Includes +2 for -lp

Run with input on STDIN, e.g.

order.pl <<< "<<><><<"

Output:

0<1<7>2<6>3<4<5

order.pl:

#!/usr/bin/perl -lp
s%%/\G</?$a++:y///c-$b++%eg

Explanation

Have two counters, max starting with the string length, min starting with 0. Then at each boundary (including start and end of string) if it is just before a < put the minimum there and increase by 1, otherwise put the maximum there and decrease by 1 (at the end of the string it doesn't matter which counter you take since they are both the same)


Title: Can you outgolf me? (Cops section)

Body:
Cops section

The robbers section can be found here.

Thanks to FryAmTheEggman, Peter Taylor, Nathan Merrill, xnor, Dennis, Laikoni and Mego for their contributions.

Challenge

Your task is to write 2 different programs (full programs/functions/etc.) in the same language and the same version (e.g. Python 3.5 ≠ Python 3.4, so that is not allowed), and when given n (using STDIN/function arguments/etc.), compute a(n) where a is an OEIS sequence of your choice. One of those programs is shorter than the other. You only need to submit the longer program of the two. The other one needs to be saved in case of not being cracked after 7 days. Your submission is cracked when your program has been outgolfed (whether it is by 1 byte or more).

For example, if the task you chose was to perform 2 × n, this could be a valid submission (in Python 2):

Python 2, 16 bytes, score = 15 / 16 = 0.9375

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

If your submission has been cracked, then you need to state that in your header like so:

Python 2, 16 bytes, score = 15 / 16 = 0.9375, [cracked] + link

```<code>print(2*input())
</code>```

Computes A005843, (offset = 0).

Offset

This can be found on every OEIS page. For example, for A005843, the offset is 0,2. We only need to use the first one, which is 0. This means that the function is defined for all numbers ≥ 0.

In other words, the function OEIS(n) starts with n = 0. Your program needs to work for all cases given by OEIS.

More information can be found here.

Scoring

The score you get for your submission is equal to the following formula:

Score = Length (in bytes) of secret code ÷ Length (in bytes) of public code

The example above has the score 15 ÷ 16 = 0.9375.

The submission with the lowest score wins. Only submissions that have posted their solution will be eligible for winning.

Rules

The task you need to do is an OEIS sequence of your choice.

Given n, output OEIS(n). Deviation is not allowed, so you need to produce the exact same sequence (when given n, you need to output OEIS(n)).

Submissions that are not cracked within a period of 7 days are considered safe after the solution has been posted (submissions older than 7 days that do not have their solution posted are still vulnerable in being cracked).

In your submission, you need to post the following things: language name, byte count, full code, so no pastebin links etc. (to prevent answers like Unary), OEIS sequence, score with lengths of both programs and additionally, the encoding that is used.

Note: the same sequence cannot be posted twice in the same language. (For example, if the sequence A005843 has been done in Pyth, you cannot use Pyth again for that same sequence.)

Input and output are both in decimal (base 10)

Leaderboard

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

Uncracked submissions

 Language	 Score	 User

Sort by: score creation

Safe submissions

 Language	 Score	 User

```

Note

This challenge is finished. The final winner is feersum with his Seed answer. Congratulations! :).

You can still submit new cops, but be aware that they are no longer competing.

Body:
Haskell, 15 bytes, score = 13/15 (0.866) (cracked)

f x=1+2*div x 2

A109613 with offset 0. Repeats each odd number twice.

1, 1, 3, 3, 5, 5, 7, 7, 9, 9, 11, 11, 13, 13, ...


问:
All Binary Combinations to Decimal
Disclaimer

This question is not a duplicate of this question. I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal numbers that can be constructed from the binary strings based on the digits provided.

Challenge

Given two integers X and Y, representing the number of zeroes (0) and ones (1) respectively, calculate all the possible decimal equivalents that can be determined from creating binary strings using only the zeroes and ones provided, and display them as output.

Example 1:

Input: 0 1

Output: 1

Explanation: Only one 1 to account for, which can only be converted one way.

Example 2:

Input: 1 1

Output: 1,2

Explanation: 01 converts to 1, 10 converts to 2.

Example 3:

Input: 3 2

Output: 3,5,6,9,10,12,17,18,20,24

Explanation: Three 0s and two 1s make 00011 (3), 00101 (5), 00110 (6), 01001 (9), 01010 (10), 01100 (12), 10001 (17), 10010 (18), 10100 (20), 11000 (24)

Limitations and Rules

I will only expect your code to work where 0 < X + Y <= 16 so the maximum number in the output could only occur from 16 1s, i.e. parameters 0 and 16.

As a result of the above limitation, the range of numbers we'd expect in the output are from 0 and 65535.

I will accept functions or code, so long as the resulting output is provided, whether this be a comma separated list, an array, list outputted to STDOUT, etc. The only criteria I must stress about the output is that it must be sorted.

This is code golf, minimum bytes will receive maximum glory.

We will not tolerate silly loopholes

答:
Mathematica, 47 bytes

```<code>Cases[Range[2^+##]-1,x_/;DigitCount[x,2,1]==#]&
</code>```

An unnamed function taking two arguments: number of 1s, number of 0s.

Essentially a port of Dennis's Python solution. We create a range from 0 to 2x+y-1 and then keep only those numbers whose amount of 1-bits equals the first input. The most interesting bit is probably the 2^+## which uses some sequence magic to avoid the parentheses around the addition of the two arguments.

Title: All Binary Combinations to Decimal

Body:
Mathematica, 47 bytes

Cases[Range[2^+##]-1,x_/;DigitCount[x,2,1]==#]&

An unnamed function taking two arguments: number of 1s, number of 0s.

Essentially a port of Dennis's Python solution. We create a range from 0 to 2x+y-1 and then keep only those numbers whose amount of 1-bits equals the first input. The most interesting bit is probably the 2^+## which uses some sequence magic to avoid the parentheses around the addition of the two arguments.


问:
Naming ionic compounds
An ionic compound is named like so: (metal name) (non-metal suffixed with -ide). Here is a list of all the suffixes that need to be replaced with -ide:

```<code>-on -ogen -ygen -ine -orus -ur -ic -ium
</code>```

The number of atoms of each element in the compound is not used in naming ionic compounds. Ignore the multivalent metal naming rules.

```<code>NaCl -> sodium + chlorine -> sodium chloride.
K2S -> potassium + sulphur -> potassium sulphide (or sulfide).
Yb2P3 -> ytterbium + phosphorus -> ytterbium phosphide.
PbTe2 -> lead + tellurium -> lead telluride.
</code>```

A string containing an ionic compound (NaCl, K2S, Yb2P3) will be given as input. No polyatomic ions will be given. The program has to output the name of this compound.

Since nobody wants to compile the periodic table data themselves, here is a paste that has the names, symbols, and whether or not it is a metal of each element, in this order: (name) (symbol) (is metal?). You can save this to an external file (the length of the file will not be counted), or you can store the data within your program (just discount the length of that string from there.) You may not need all the information provided. Every element is seperated by a newline.

As always with code golf challenges, shortest code wins.

答:
APL <s>142</s> 150

If I am allowed to store the element names and symbols in a pair of nested arrays within the APL workspace then the following code should do it:

```<code>(e[s⍳c[1]]),((∊¯1×((+/¨⍳¨i)=+/¨(¯1×i)↑¨t⍳¨⊂n)/i←⍴¨t←'ic' 'on' 'ur' 'ine' 'ium' 'ogen' 'ygen' 'orus')↓n←∊e[s⍳(c←(98>⎕av⍳c)⎕penclose c←⍞~⍕⍳9)[2]]),'ide'
</code>```

It works roughly as follows:

```<code>c←(98>⎕av⍳c)⎕penclose c←⍞~⍕⍳9
</code>```

Takes the input from the screen via ⍞ and splits the chemical name into symbols and discards any numbers

e[s⍳c[1]]

Looks up the first element name from its symbol. Similarly for c[2]

```<code>(∊¯1×((+/¨⍳¨i)=+/¨(¯1×i)↑¨t⍳¨⊂n)/i←⍴¨t←'ic' 'on' 'ur' 'ine' 'ium' 'ogen' 'ygen' 'orus')↓n
</code>```

Identifies which of the eight possible endings the non-metal has and drops it and then replaces it with ide via:

```<code>,'ide'
</code>```

There is no error trapping so only works for valid compounds dictated via the one or zero identifier in the list of elements provided.

Title: Naming ionic compounds

Body:
APL <s>142</s> 150

If I am allowed to store the element names and symbols in a pair of nested arrays within the APL workspace then the following code should do it:

(e[s⍳c[1]]),((∊¯1×((+/¨⍳¨i)=+/¨(¯1×i)↑¨t⍳¨⊂n)/i←⍴¨t←'ic' 'on' 'ur' 'ine' 'ium' 'ogen' 'ygen' 'orus')↓n←∊e[s⍳(c←(98>⎕av⍳c)⎕penclose c←⍞~⍕⍳9)[2]]),'ide'

It works roughly as follows:

c←(98>⎕av⍳c)⎕penclose c←⍞~⍕⍳9

Takes the input from the screen via ⍞ and splits the chemical name into symbols and discards any numbers

e[s⍳c[1]]

Looks up the first element name from its symbol. Similarly for c[2]

(∊¯1×((+/¨⍳¨i)=+/¨(¯1×i)↑¨t⍳¨⊂n)/i←⍴¨t←'ic' 'on' 'ur' 'ine' 'ium' 'ogen' 'ygen' 'orus')↓n

Identifies which of the eight possible endings the non-metal has and drops it and then replaces it with ide via:

,'ide'

There is no error trapping so only works for valid compounds dictated via the one or zero identifier in the list of elements provided.


答:
2sable, 20 bytes

```<code>gUvy'<Qi¾¼ëXD<U}y}XJ
</code>```

Explanation

```<code>gU                     # store input length in variable X
  v              }     # for each char in input
   y'<Qi               # if current char is "<"
        ¾¼             # push counter (initialized as 0), increase counter
          ëXD<U}       # else, push X and decrease value in variable X
                y      # push current char
                  XJ   # push the final number and join the stack
</code>```

Try it online!

For N<10 this could have been 14 bytes:

```<code>ÎvyN>}J'<¡í'<ý
</code>```

Title: Greater than less than greater than something fishy

Body:
Given a length N string of less-than and greater-than signs (<, >), insert the integers 0 through N at the start and end and in between each pair of signs such that all the inequalities are satisfied. Output the resulting string. If there are multiple valid outputs, output any one (and just one) of them.

For example

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

has 7 characters so all the numbers from 0 to 7 inclusive must be inserted. A valid output is

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

because all the inequalities taken one at a time

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

are true.

If desired, the output may have spaces surrounding the signs, e.g. 2 < 3 < 4 > 1 < 5 > 0 < 6 < 7.

The shortest code in bytes wins.

Test Cases

The first line after an empty line is the input and the next line(s) are each valid output examples.

```<code>[empty string]
0

<
0<1

>
1>0

<<
0<1<2

<>
1<2>0

><
1>0<2
2>0<1

>>
2>1>0

<<<
0<1<2<3

><>
1>0<3>2

>><
3>2>0<1
3>1>0<2
2>1>0<3

>>>
3>2>1>0

>>><<<
3>2>1>0<4<5<6
6>3>1>0<2<4<5
4>2>1>0<3<5<6
4>3>1>0<2<5<6

<<><><<
2<3<4>1<5>0<6<7

>><><>>
7>6>0<5>1<4>3>2

<<<<<<<<<<<<<<
0<1<2<3<4<5<6<7<8<9<10<11<12<13<14

>><<<<><>><><<
6>5>4<7<8<9<10>3<11>2>1<12>0<13<14
14>5>4<7<8<9<10>3<11>2>1<12>0<13<6
</code>```

Body:
2sable, 20 bytes

gUvy'<Qi¾¼ëXD<U}y}XJ

Explanation

gU                     # store input length in variable X
  v              }     # for each char in input
   y'<Qi               # if current char is "<"
        ¾¼             # push counter (initialized as 0), increase counter
          ëXD<U}       # else, push X and decrease value in variable X
                y      # push current char
                  XJ   # push the final number and join the stack

Try it online!

For N<10 this could have been 14 bytes:

ÎvyN>}J'<¡í'<ý


问:
Convert to Bubble Letters
So I was playing around with my compose key, and found some cool things, one of them being that by pressing compose + ( + alphanumeric + ), you get that character inside a bubble, like so: ⓐ.

Your task in this challenge is simple, to convert ordinary text to bubble letter text.

Here are the ascii chars, the bubble characters and their Unicode code points:

```<code>0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
⓪①②③④⑤⑥⑦⑧⑨ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏ
9450 9312 9313 9314 9315 9316 9317 9318 9319 9320 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423
</code>```

Your input will contain only printable ascii characters, and if a character cannot be bubbleified, leave it as is.

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

Note: This is not isomorphic to my earlier challenge about small-caps conversion since unlike small-caps, bubble letters are in a mostly contiguous segment of code-points, allowing for more interesting approaches.

答:
Perl, 27 bytes

Includes +1 for -p

Give input on STDIN, uses the Dennis transliteration order. The only thing interesting about this solution is the lack of the final ; (needs a recent enough perl)

```<code>#!/usr/bin/perl -p
y;A-Za-z0-9;Ⓐ-⓪①-⑨
</code>```

Title: Convert to Bubble Letters

Body:
Perl, 27 bytes

Includes +1 for -p

Give input on STDIN, uses the Dennis transliteration order. The only thing interesting about this solution is the lack of the final ; (needs a recent enough perl)

#!/usr/bin/perl -p
y;A-Za-z0-9;Ⓐ-⓪①-⑨


问:
Shortest code to produce infinite output
Write the shortest code you can that produces an infinite output.

That's all. You code will only be disqualified if it stops producing output at some point. As always in code golf, the shortest code wins.

Here's a list of answers that I think are really clever, so they can get credit:

The comma is both code and data

Infinite errors (that counts)

Infinite warnings (that also counts)

What's Marbelous?

Leaderboard

var QUESTION_ID=13152,OVERRIDE_USER=8611;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

```

答:
Cubix, 2 bytes

```<code>.O
</code>```

Test it online!

Cubix is a stack-based 2D language, created by me in March 2016. Cubix differs from ordinary 2D languages in that it's not strictly 2D: the code is wrapped around a cube. This program wraps to this cube net:

```<code>   .
>O . . .
   .
</code>```

where the IP (instruction pointer) starts at the arrow. O outputs the item on top of the stack as a number; if the stack is empty, it outputs 0. . is a no-op.

When the IP reaches the right side of the cube net, it simply wraps back around to the left and runs O again. Thus, this code outputs 0 forever.

ContentLicense: CC BY-SA 4.0

Body:
Cubix, 2 bytes

.O

Test it online!

Cubix is a stack-based 2D language, created by me in March 2016. Cubix differs from ordinary 2D languages in that it's not strictly 2D: the code is wrapped around a cube. This program wraps to this cube net:

   .
>O . . .
   .

where the IP (instruction pointer) starts at the arrow. O outputs the item on top of the stack as a number; if the stack is empty, it outputs 0. . is a no-op.

When the IP reaches the right side of the cube net, it simply wraps back around to the left and runs O again. Thus, this code outputs 0 forever.


问:
Shortest infinite loop producing no output
Your task is to create the shortest infinite loop!

The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given.

Rules

Each submission must be a full program.

You must create the shortest infinite loop.

Even if your program runs out of memory eventually, it is still accepted as long as it is running the whole time from the start to when it runs out of memory. Also when it runs out of memory, it should still not print anything to STDERR.

The program must take no input (however, reading from a file is allowed), and should not print anything to STDOUT. Output to a file is also forbidden.

The program must not write anything to STDERR.

Feel free to use a language (or language version) even if it's newer than this challenge.
-Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language. :D

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

This is not about finding the language with the shortest infinite loop program. This is about finding the shortest infinite loop program in every language. Therefore, I will not accept an answer.

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

There should be a website such as Wikipedia, Esolangs, or GitHub for the language. For example, if the language is CJam, then one could link to the site in the header like #[CJam](http://sourceforge.net/p/cjam/wiki/Home/), X bytes.

Standard loopholes are not allowed.

(I have taken some of these rules from Martin Büttner's "Hello World" challenge)

Please feel free to post in the comments to tell me how this challenge could be  improved.

Catalogue

This is a Stack Snippet which generates both an alphabetical catalogue of the used languages, and an overall leaderboard. To make sure your answer shows up, please start it with this Markdown header:

```<code># Language name, X bytes
</code>```

Obviously replacing Language name and X bytes with the proper items. If you want to link to the languages' website, use this template, as posted above:

```<code>#[Language name](http://link.to/the/language), X bytes
</code>```

Now, finally, here's the snippet: (Try pressing "Full page" for a better view.)

var QUESTION_ID=59347;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk";var OVERRIDE_USER=41805;var answers=[],answers_hash,answer_ids,answer_page=1,more_answers=true,comment_page;function answersUrl(index){return"//api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(index,answers){return"//api.stackexchange.com/2.2/answers/"+answers.join(';')+"/comments?page="+index+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){answers.push.apply(answers,data.items);answers_hash=[];answer_ids=[];data.items.forEach(function(a){a.comments=[];var id=+a.share_link.match(/\d+/);answer_ids.push(id);answers_hash[id]=a});if(!data.has_more)more_answers=false;comment_page=1;getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:true,success:function(data){data.items.forEach(function(c){if(c.owner.user_id===OVERRIDE_USER)answers_hash[c.post_id].comments.push(c)});if(data.has_more)getComments();else if(more_answers)getAnswers();else process()}})}getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;var OVERRIDE_REG=/^Override\s*header:\s*/i;function getAuthorName(a){return a.owner.display_name}function process(){var valid=[];answers.forEach(function(a){var body=a.body;a.comments.forEach(function(c){if(OVERRIDE_REG.test(c.body))body='
'+c.body.replace(OVERRIDE_REG,'')+'
'});var match=body.match(SCORE_REG);if(match)valid.push({user:getAuthorName(a),size:+match[2],language:match[1],link:a.share_link,});else console.log(body)});valid.sort(function(a,b){var aB=a.size,bB=b.size;return aB-bB});var languages={};var place=1;var lastSize=null;var lastPlace=1;valid.forEach(function(a){if(a.size!=lastSize)lastPlace=place;lastSize=a.size;++place;var answer=jQuery("#answer-template").html();answer=answer.replace("{{PLACE}}",lastPlace+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link);answer=jQuery(answer);jQuery("#answers").append(answer);var lang=a.language;lang=jQuery(''+lang+'').text();languages[lang]=languages[lang]||{lang:a.language,lang_raw:lang,user:a.user,size:a.size,link:a.link}});var langs=[];for(var lang in languages)if(languages.hasOwnProperty(lang))langs.push(languages[lang]);langs.sort(function(a,b){if(a.lang_raw.toLowerCase()>b.lang_raw.toLowerCase())return 1;if(a.lang_raw.toLowerCase()<b.lang_raw.toLowerCase())return-1;return 0});for(var i=0;i<langs.length;++i){var language=jQuery("#language-template").html();var lang=langs[i];language=language.replace("{{LANGUAGE}}",lang.lang).replace("{{NAME}}",lang.user).replace("{{SIZE}}",lang.size).replace("{{LINK}}",lang.link);language=jQuery(language);jQuery("#languages").append(language)}}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list{padding:10px;width:500px;float:left}#language-list{padding:10px;padding-right:40px;width:500px;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">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

答:
Cubix, 0 bytes

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

Alternatively, any single character does exactly the same.

Test it online!

Cubix is a stack-based 2D language, created by me in March 2016. Cubix differs from ordinary 2D languages in that it's not strictly 2D: the code is wrapped around a cube. Any one-byte program wraps to this cube net:

```<code>   ?
>. . . .
   .
</code>```

where ? represents the character, and the IP (instruction pointer) starts at the arrow. . is simply a no-op, and when the IP reaches the right side of the cube net, it simply wraps back around to the left. Thus, any 1-byte program does nothing forever, no matter what the character is (as long as it's not whitespace).

Thanks to @ErikGolferエリックゴルファー for reminding me that the empty program does the same. When Cubix was originally created, this didn't work, because the interpreter created a cube of size 0 and threw an error when it tried to run. This was fixed a while ago, and it is now impossible to cause an error in Cubix.

Body:
Cubix, 0 bytes

Alternatively, any single character does exactly the same.

Test it online!

Cubix is a stack-based 2D language, created by me in March 2016. Cubix differs from ordinary 2D languages in that it's not strictly 2D: the code is wrapped around a cube. Any one-byte program wraps to this cube net:

   ?
>. . . .
   .

where ? represents the character, and the IP (instruction pointer) starts at the arrow. . is simply a no-op, and when the IP reaches the right side of the cube net, it simply wraps back around to the left. Thus, any 1-byte program does nothing forever, no matter what the character is (as long as it's not whitespace).

Thanks to @ErikGolferエリックゴルファー for reminding me that the empty program does the same. When Cubix was originally created, this didn't work, because the interpreter created a cube of size 0 and threw an error when it tried to run. This was fixed a while ago, and it is now impossible to cause an error in Cubix.


问:
Greatest Common Divisor
Your task is to compute the greatest common divisor (GCD) of two given integers in as few bytes of code as possible.

You may write a program or function, taking input and returning output via any of our accepted standard methods (including STDIN/STDOUT, function parameters/return values, command-line arguments, etc.).

Input will be two non-negative integers. You should be able to handle either the full range supported by your language's default integer type, or the range [0,255], whichever is greater. You are guaranteed that at least one of the inputs will be non-zero.

You are not allowed to use built-ins that compute either the GCD or the LCM (least common multiple).

Standard code-golf rules apply.

Test Cases

```<code>0 2     => 2
6 0     => 6
30 42   => 6
15 14   => 1
7 7     => 7
69 25   => 1
21 12   => 3
169 123 => 1
20 142  => 2
101 202 => 101
</code>```

答:
Java 7, 42 bytes

```<code>int c(int a,int b){return b>0?c(b,a%b):a;}
</code>```

Ungolfed & test cases:

Try it here.

```<code>class M{
  static int c(int a, int b){
    return b > 0
            ? c(b, a%b)
            : a;
  }

  public static void main(String[] a){
    System.out.println(c(0, 2));
    System.out.println(c(6, 0));
    System.out.println(c(30, 42));
    System.out.println(c(15, 14));
    System.out.println(c(7, 7));
    System.out.println(c(69, 25));
    System.out.println(c(21, 12));
    System.out.println(c(169, 123));
    System.out.println(c(20, 142));
    System.out.println(c(101, 202));
  }
}
</code>```

Output:

```<code>2
6
6
1
7
1
3
1
2
101
</code>```

Title: Greatest Common Divisor

Body:
Java 7, 42 bytes

int c(int a,int b){return b>0?c(b,a%b):a;}

Ungolfed & test cases:

Try it here.

class M{
  static int c(int a, int b){
    return b > 0
            ? c(b, a%b)
            : a;
  }

  public static void main(String[] a){
    System.out.println(c(0, 2));
    System.out.println(c(6, 0));
    System.out.println(c(30, 42));
    System.out.println(c(15, 14));
    System.out.println(c(7, 7));
    System.out.println(c(69, 25));
    System.out.println(c(21, 12));
    System.out.println(c(169, 123));
    System.out.println(c(20, 142));
    System.out.println(c(101, 202));
  }
}

Output:

2
6
6
1
7
1
3
1
2
101


Body:
PHP , 190 Bytes

random shuffle till a valid solution exists

$x=range(0,$l=strlen($q=$argv[1]));while(!$b){$b=1;$t="";shuffle($x);for($i=0;$i<$l;){$t.=$x[$i].$q[$i];if(($q[$i]==">"&$x[$i]<$x[$i+1])|($q[$i]=="<"&$x[$i]>$x[1+$i++]))$b=0;}}echo$t.$x[$i];

381 Bytes get all solutions and pick one

<?php $d=range(0,strlen($q=$argv[1]));echo $q."\n";$e=[];function f($t=""){global$e,$d,$q;foreach($d as$z){preg_match_all("#\d+#",$t,$y);if(in_array($z,$y[0]))continue;$p=preg_match_all("#[<>]#",$t);$g="";if(preg_match("#\d+$#",$t,$x)){if(($q[$p]==">"&$x[0]<$z)|($q[$p]=="<"&$x[0]>$z))continue;$g=$q[$p];}strlen($q)==$p+1|!$q?$e[]=$t.$g.$z:f($t.$g.$z);}}f();echo$e[array_rand($e)];


问:
Constructible n-gons
A constructible \$n\$-gon is a regular polygon with n sides that you can construct with only a compass and an unmarked ruler.

As stated by Gauss, the only \$n\$ for which a \$n\$-gon is constructible is a product of any number of distinct Fermat primes and a power of \$2\$ (ie. \$n = 2^k \times p_1 \times p_2 \times ...\$ with \$k\$ being an integer and every \$p_i\$ some distinct Fermat prime).

A Fermat prime is a prime which can be expressed as \$2^{2^n}+1\$ with \$n\$ a positive integer. The only known Fermat primes are for \$n = 0, 1, 2, 3 \text{ and } 4\$

The challenge

Given an integer \$n>2\$, say if the \$n\$-gon is constructible or not.

Specification

Your program or function should take an integer or a string representing said integer (either in unary, binary, decimal or any other base) and return or print a truthy or falsy value.

This is code-golf, so shortest answer wins, standard loopholes apply.

Relevant OEIS

Examples

```<code>3 -> True
9 -> False
17 -> True
1024 -> True
65537 -> True
67109888 -> True
67109889 -> False
</code>```

答:
Actually, 6 bytes

This answer is based on xnor's algorithm in Martin Ender's Jelly answer. Golfing suggestions welcome. Try it online!

```<code>▒D├♂≈π
</code>```

How it works

```<code>         Implicit input n.
▒        totient(n)
 D       Decrement.
  ├      Convert to binary (as string).
   ♂≈    Convert each char into an int.
     π   Take the product of those binary digits.
         If the result is 1,
           then bin(totient(n) - 1) is a string of 1s, and totient(n) is power of two.
</code>```

Title: Constructible n-gons

Body:
Actually, 6 bytes

This answer is based on xnor's algorithm in Martin Ender's Jelly answer. Golfing suggestions welcome. Try it online!

▒D├♂≈π

How it works

         Implicit input n.
▒        totient(n)
 D       Decrement.
  ├      Convert to binary (as string).
   ♂≈    Convert each char into an int.
     π   Take the product of those binary digits.
         If the result is 1,
           then bin(totient(n) - 1) is a string of 1s, and totient(n) is power of two.


答:
Actually, 21 bytes

A port of my Ruby answer. Golfing suggestions welcome. Try it online!

```<code>│+)'1*@'0*+╨`εj2@¿`M╔
</code>```

How it works

```<code>          Implicit input of a and b.
│+)       Duplicate a and b, add, and rotate to bottom of stack. Stack: [b a a+b]
'1*@      "1" times b and swap with a.
'0*+      "0" times a and add to get "0"*a+"1"*b.
╨`...`M   Take all the (a+b)-length permutations of "0"*a+"1"*b
          and map the following function over them.
  εj        Join the permutation into one string
  2@¿       Convert from binary to decimal
╔         Uniquify the resulting list and implicit return.
</code>```

Title: All Binary Combinations to Decimal

Body:
Disclaimer

This question is not a duplicate of this question. I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal numbers that can be constructed from the binary strings based on the digits provided.

Challenge

Given two integers X and Y, representing the number of zeroes (0) and ones (1) respectively, calculate all the possible decimal equivalents that can be determined from creating binary strings using only the zeroes and ones provided, and display them as output.

Example 1:

Input: 0 1

Output: 1

Explanation: Only one 1 to account for, which can only be converted one way.

Example 2:

Input: 1 1

Output: 1,2

Explanation: 01 converts to 1, 10 converts to 2.

Example 3:

Input: 3 2

Output: 3,5,6,9,10,12,17,18,20,24

Explanation: Three 0s and two 1s make 00011 (3), 00101 (5), 00110 (6), 01001 (9), 01010 (10), 01100 (12), 10001 (17), 10010 (18), 10100 (20), 11000 (24)

Limitations and Rules

I will only expect your code to work where 0 < X + Y <= 16 so the maximum number in the output could only occur from 16 1s, i.e. parameters 0 and 16.

As a result of the above limitation, the range of numbers we'd expect in the output are from 0 and 65535.

I will accept functions or code, so long as the resulting output is provided, whether this be a comma separated list, an array, list outputted to STDOUT, etc. The only criteria I must stress about the output is that it must be sorted.

This is code golf, minimum bytes will receive maximum glory.

We will not tolerate silly loopholes

Body:
Actually, 21 bytes

A port of my Ruby answer. Golfing suggestions welcome. Try it online!

│+)'1*@'0*+╨`εj2@¿`M╔

How it works

          Implicit input of a and b.
│+)       Duplicate a and b, add, and rotate to bottom of stack. Stack: [b a a+b]
'1*@      "1" times b and swap with a.
'0*+      "0" times a and add to get "0"*a+"1"*b.
╨`...`M   Take all the (a+b)-length permutations of "0"*a+"1"*b
          and map the following function over them.
  εj        Join the permutation into one string
  2@¿       Convert from binary to decimal
╔         Uniquify the resulting list and implicit return.


答:
C#, <s>102</s> 99 bytes

```<code>string f(string s){int i=0,j=s.Length;var r="";foreach(var c in s)r=r+(c<61?i++:j--)+c;return r+i;}
</code>```

Ungolfed:

```<code>string f(string s)
{
    int i = 0, j = s.Length;    // Used to track the lowest and highest unused number.
    var r = "";                 // Start with the empty string.

    foreach (var c in s)        // For each character in the input string:
        r = r +                 // Append to the result:
            (c < 61             // If the current character is '<':
                ? i++           // Insert the lowest unused number,
                : j--)          // otherwise, insert the highest unused number.
            + c;                // And append the current character.

    return r + i;               // Return the result with the last unused number appended.
}
</code>```

Body:
C#, <s>102</s> 99 bytes

string f(string s){int i=0,j=s.Length;var r="";foreach(var c in s)r=r+(c<61?i++:j--)+c;return r+i;}

Ungolfed:

string f(string s)
{
    int i = 0, j = s.Length;    // Used to track the lowest and highest unused number.
    var r = "";                 // Start with the empty string.

    foreach (var c in s)        // For each character in the input string:
        r = r +                 // Append to the result:
            (c < 61             // If the current character is '<':
                ? i++           // Insert the lowest unused number,
                : j--)          // otherwise, insert the highest unused number.
            + c;                // And append the current character.

    return r + i;               // Return the result with the last unused number appended.
}


问:
Square free Numbers
Given a number N, write the shortest complete program to find the number of square-free integers below N.

```<code>Sample Input
100000
Sample Output
60794
</code>```

Constraints:

Should work for all positive N below 1,000,000

Should not take more than 10 secs.

Please do not use built in functions, please.

答:
C
 144 Chars

```<code>#define m 1000001
x[m];
main(s,o,f){
for(o=2;o*o<m;o++)
for(f=s=o*o;f<m;f+=s)x[f]=1;
scanf("%d",&f);
for(s=0,o=1;o<f;o++)if(!x[o])s++;
printf("%d",s);
}
</code>```

Instantaneous Solution on my crummy PC! :)

ContentLicense: CC BY-SA 2.5

Title: Square free Numbers

Body:
C
 144 Chars

#define m 1000001
x[m];
main(s,o,f){
for(o=2;o*o<m;o++)
for(f=s=o*o;f<m;f+=s)x[f]=1;
scanf("%d",&f);
for(s=0,o=1;o<f;o++)if(!x[o])s++;
printf("%d",s);
}

Instantaneous Solution on my crummy PC! :)


答:
Ruby, 114

```<code>f,s=$*[0].split /\d*(?=[A-Z]|\Z)/
puts (n=Hash[*<<X.split-%w[0 1]].invert)[f]+" "+n[s].sub(/(i..|.gen|..)\Z/,"ide")
Hydrogen H 0
Helium He 0
Lithium Li 1
Beryllium Be 1
Boron B 0
Carbon C 0
Nitrogen N 0
Oxygen O 0
Fluorine F 0
Neon Ne 0
Sodium Na 1
Magnesium Mg 1
Aluminium Al 1
Silicon Si 0
Phosphorus P 0
Sulfur S 0
Chlorine Cl 0
Argon Ar 0
Potassium K 1
Calcium Ca 1
Scandium Sc 1
Titanium Ti 1
Vanadium V 1
Chromium Cr 1
Manganese Mn 1
Iron Fe 1
Cobalt Co 1
Nickel Ni 1
Copper Cu 1
Zinc Zn 1
Gallium Ga 1
Germanium Ge 1
Arsenic As 0
Selenium Se 0
Bromine Br 0
Krypton Kr 0
Rubidium Rb 1
X
</code>```

Uses a paste of the element text that I haven't counted in the score. I remove the metal tag (since I'm assuming the compounds are always given with the metal first, so I don't actually need it) and build a dictionary with it. I identify the part to replace with "ide" by checking the end of the string for three letters starting with i, four letters ending with gen, or otherwise just the last two characters.

Title: Naming ionic compounds

Body:
An ionic compound is named like so: (metal name) (non-metal suffixed with -ide). Here is a list of all the suffixes that need to be replaced with -ide:

```<code>-on -ogen -ygen -ine -orus -ur -ic -ium
</code>```

The number of atoms of each element in the compound is not used in naming ionic compounds. Ignore the multivalent metal naming rules.

```<code>NaCl -> sodium + chlorine -> sodium chloride.
K2S -> potassium + sulphur -> potassium sulphide (or sulfide).
Yb2P3 -> ytterbium + phosphorus -> ytterbium phosphide.
PbTe2 -> lead + tellurium -> lead telluride.
</code>```

A string containing an ionic compound (NaCl, K2S, Yb2P3) will be given as input. No polyatomic ions will be given. The program has to output the name of this compound.

Since nobody wants to compile the periodic table data themselves, here is a paste that has the names, symbols, and whether or not it is a metal of each element, in this order: (name) (symbol) (is metal?). You can save this to an external file (the length of the file will not be counted), or you can store the data within your program (just discount the length of that string from there.) You may not need all the information provided. Every element is seperated by a newline.

As always with code golf challenges, shortest code wins.

Body:
Ruby, 114

f,s=$*[0].split /\d*(?=[A-Z]|\Z)/
puts (n=Hash[*<<X.split-%w[0 1]].invert)[f]+" "+n[s].sub(/(i..|.gen|..)\Z/,"ide")
Hydrogen H 0
Helium He 0
Lithium Li 1
Beryllium Be 1
Boron B 0
Carbon C 0
Nitrogen N 0
Oxygen O 0
Fluorine F 0
Neon Ne 0
Sodium Na 1
Magnesium Mg 1
Aluminium Al 1
Silicon Si 0
Phosphorus P 0
Sulfur S 0
Chlorine Cl 0
Argon Ar 0
Potassium K 1
Calcium Ca 1
Scandium Sc 1
Titanium Ti 1
Vanadium V 1
Chromium Cr 1
Manganese Mn 1
Iron Fe 1
Cobalt Co 1
Nickel Ni 1
Copper Cu 1
Zinc Zn 1
Gallium Ga 1
Germanium Ge 1
Arsenic As 0
Selenium Se 0
Bromine Br 0
Krypton Kr 0
Rubidium Rb 1
X

Uses a paste of the element text that I haven't counted in the score. I remove the metal tag (since I'm assuming the compounds are always given with the metal first, so I don't actually need it) and build a dictionary with it. I identify the part to replace with "ide" by checking the end of the string for three letters starting with i, four letters ending with gen, or otherwise just the last two characters.


问:
Outputting x to y

Challenge

You must choose one number x (y = x + 9) and create ten unique programs which each print out one of the numbers in the range x to y inclusive. However, there are three twists:

Each program's score is the difference between length of your program in bytes and n (where n is the number that the program outputs). i.e. If a program is 12 bytes long and it outputs the number 15, its score is 3 (|15-12| = 3).

You must not use comments to achieve this byte count.

Your program must not contain any number which is contained within the number which the program outputs. i.e. If a program outputs 1659, the program cannot contain 1, 6, 5 or 9

Your program must not contain any of the characters which are the first letters of the number which the program outpts. i.e. If the program outputs 1659, the program cannot contain o, s, f or n (one, six, five and nine)

Rules

If any number is impossible, this is counted as a DNP. You should declare all DNPs in your range.

The following is a list of numbers and their spellings. The disallowed characters for each are highlighted in bold:

0: Zero

1: One

2: Two

3: Three

4: Four

5: Five

6: Six

7: Seven

8: Eight

9: Nine

Scoring

Your overall score is the sum of all your programs' scores.

Winning

The person with the lowest score with the fewest DNPs wins.

In the event of a tie, the person whose last edit was earliest wins.

Title: Outputting x to y

Body:
Python 2, score 0

x = 14

print +2*3+3+5
print 6+2*3+3+0
print 7+2*3+3+00
print 6+2*3+5+0+0
print-~6+2*3+5+0+0
exec"pri\x6et 22-3"
exec"prin\164 9+8+3"
exec"prin\x74 9+9+03"
exec"prin\164-~9+8+04"
exec"prin\164-~9-~8+04"


答:
Jelly, <s>27 14</s> 12 bytes

Port of @Martin Enders CJam solution

-2 bytes thanks to @Dennis

```<code>żJ0;µFṣ”<Uj”<
</code>```

Test it at TryItOnline

How?

```<code>żJ0;Fṣ”<Uj”< - main link takes an argument, the string, e.g. ><>
 J           - range(length(input)), e.g. [1,2,3]
  0          - literal 0
   ;         - concatenate, e.g. [0,1,2,3]
ż            - zip with input, e.g. [[0],">1","<2",">3"]
    F        - flatten, list, e.g. "0>1<2>3"
      ”<  ”< - the character '<'
     ṣ       - split, e.g. ["0>1","2>3"]
        U    - upend (reverse) (implicit vectorization), e.g. ["1>0","3>2"]
         j   - join, e.g. "1>0<3>2"
</code>```

Previous method was interesting mathematically, but not so golfy...

```<code>=”>U
LR!×ÇĖP€S‘
L‘ḶŒ!ị@ÇðżF
</code>```

This uses the factorial base system to find an index of the permutations of [0,N] that will satisfy the equation.

Body:
Jelly, <s>27 14</s> 12 bytes

Port of @Martin Enders CJam solution

-2 bytes thanks to @Dennis

żJ0;µFṣ”<Uj”<

Test it at TryItOnline

How?

żJ0;Fṣ”<Uj”< - main link takes an argument, the string, e.g. ><>
 J           - range(length(input)), e.g. [1,2,3]
  0          - literal 0
   ;         - concatenate, e.g. [0,1,2,3]
ż            - zip with input, e.g. [[0],">1","<2",">3"]
    F        - flatten, list, e.g. "0>1<2>3"
      ”<  ”< - the character '<'
     ṣ       - split, e.g. ["0>1","2>3"]
        U    - upend (reverse) (implicit vectorization), e.g. ["1>0","3>2"]
         j   - join, e.g. "1>0<3>2"

Previous method was interesting mathematically, but not so golfy...

=”>U
LR!×ÇĖP€S‘
L‘ḶŒ!ị@ÇðżF

This uses the factorial base system to find an index of the permutations of [0,N] that will satisfy the equation.


问:
Print multiplication tables by input
In this challenge you've to print multiplication tables by input, Here are some examples:

```<code>Input: 2

Output:
0 2  4 6 8  10  12  14  16  18  20

Input: 20

Output: 20 40 60 80 100 120 140 160 180 200
</code>```

Rules

The shortest code in bytes wins.

This challenge is a code-golf, It follows code-golf general rules (code-golf)

If, just if, your code can't print number, you can use letters, Here is an example:

Input: B

Output: B D F H J L N P R T

You can choose to start from 0 or your number (like 20). You can choose if put spaces or don't. The challenge is free, just take an input and print multiplication tables.

Your output must list the first 10 members of the times table for the given number. You may leave out 0*n.

答:
Fourier, 15 bytes

```<code>I~N11(i*Noi^~i)
</code>```

Output for input 20:

```<code>020406080100120140160180200
</code>```

Since unseparated output is allowed.

Try it online!

Title: Print multiplication tables by input

Body:
Fourier, 15 bytes

I~N11(i*Noi^~i)

Output for input 20:

020406080100120140160180200

Since unseparated output is allowed.

Try it online!


问:
Digital River (Shortest And Fastest Solution)
This is my first question, so I hope it goes well.

Background:

It's not the rivers that you might be thinking about. The question revolves around the concept of digital rivers. A digital river is a sequence of numbers where the number following n is n plus the sum of its digits.

Explanation:

12345 is followed by 12360 since 1+2+3+4+5=15 and so 12345 + 15 gives
12360. similarly 145 is followed by 155. If the first number of a digital river is M we will call it river M.

For e.g: River 480 is the sequence beginning {480,492,507,519....}, and river 483 is the sequence beginning {483,498,519,....}. Normal streams and rivers can meet, and the same is true for digital rivers. This happens when two digital rivers share some of the same values.

Example:

River 480 meets river 483 at 519. River 480 meets river 507 at 507 and never meets river 481. Every digital river will eventually meet river 1, river 3 or river 9.

Write a program that can determine for a given integer n the value where river n first meets one of these three rivers.

Input

The input may contain multiple test cases. Each test case occupies a separate line and contains an integer n (1 <= n <= 16384). A test case with value of 0 for n terminates the input and this test case must not be processed.

Output

For each test case in the input first output the test case number (starting from 1) as shown in the sample output. Then on a separate line output the line "first meets river x at y". Here y is the lowest value where river n first meets river x (x = 1 or 3 or 9). If river n meets river x at y for more than one value of x, output the lowest value. Print a blank line between two consecutive test cases.

Test case

Input:

```<code>86
12345
0
</code>```

Output:

```<code>Case #1

first meets river 1 at 101

Case #2

first meets river 3 at 12423
</code>```

Scoring:

The fastest algorithm wins. In case of tie. The one with shorter code will win.

Thanks to mbomb007 for pointing out my error.

p.s: I want to have the fastest solution rather than the smallest one.
I also have a solution of mine which is slow. For that look here.

Note:

I will be using this for code testing. And performance checking.

答:
Scala, 774 bytes

Fiddle: http://scalafiddle.net/console/4ec96ef90786e0f2d9f7b61b5ab0209b

I don't feel like golfing it. It finds a solution to the posed problem within 50ms

Usage may not be exactly what you want:

scala river.scala

Now you can continuously input numbers followed by an enter. And terminate the program with 0. The result will be printed as soon as you hit enter.

```<code>io.Source.stdin.getLines.map(_.toInt)
  .takeWhile(_ != 0)
  .map(stream(_).takeWhile(_ < 16383))
  .zipWithIndex
  .map { cur =>
    Seq(1, 3, 9).map { i =>
      val s = stream(i).takeWhile(_ < 16383)
      (cur._2+1, i, s.intersect(cur._1).headOption)
    }
  }.foreach { opts =>
    val options = opts.filterNot(_._3.isEmpty)

    if(options.isEmpty) {
      println("No result")
    } else {
      val opt = options(0)
      println(s"Case #${opt._1}\n\nfirst meets ${opt._2} at ${opt._3.get}\n\n")
    }
  }

def stream(i:Int): Stream[Int] = {
  def sub: Int => Stream[Int] = {
    i => i #:: sub(a(i))
  }
  sub(i)
}

def a(i:Int): Int = i + i.toString.map{_.asDigit}.sum
</code>```

Body:
Scala, 774 bytes

Fiddle: http://scalafiddle.net/console/4ec96ef90786e0f2d9f7b61b5ab0209b

I don't feel like golfing it. It finds a solution to the posed problem within 50ms

Usage may not be exactly what you want:

scala river.scala

Now you can continuously input numbers followed by an enter. And terminate the program with 0. The result will be printed as soon as you hit enter.

io.Source.stdin.getLines.map(_.toInt)
  .takeWhile(_ != 0)
  .map(stream(_).takeWhile(_ < 16383))
  .zipWithIndex
  .map { cur =>
    Seq(1, 3, 9).map { i =>
      val s = stream(i).takeWhile(_ < 16383)
      (cur._2+1, i, s.intersect(cur._1).headOption)
    }
  }.foreach { opts =>
    val options = opts.filterNot(_._3.isEmpty)

    if(options.isEmpty) {
      println("No result")
    } else {
      val opt = options(0)
      println(s"Case #${opt._1}\n\nfirst meets ${opt._2} at ${opt._3.get}\n\n")
    }
  }

def stream(i:Int): Stream[Int] = {
  def sub: Int => Stream[Int] = {
    i => i #:: sub(a(i))
  }
  sub(i)
}

def a(i:Int): Int = i + i.toString.map{_.asDigit}.sum


答:
Python 3, <s>52</s> <s>33</s> 30 bytes

```<code>lambda n:list(range(0,11*n,n))
</code>```

3 bytes saved thanks to @manatwork

Formatting the output is visibly not necessary

Title: Print multiplication tables by input

Body:
In this challenge you've to print multiplication tables by input, Here are some examples:

```<code>Input: 2

Output:
0 2  4 6 8  10  12  14  16  18  20

Input: 20

Output: 20 40 60 80 100 120 140 160 180 200
</code>```

Rules

The shortest code in bytes wins.

This challenge is a code-golf, It follows code-golf general rules (code-golf)

If, just if, your code can't print number, you can use letters, Here is an example:

Input: B

Output: B D F H J L N P R T

You can choose to start from 0 or your number (like 20). You can choose if put spaces or don't. The challenge is free, just take an input and print multiplication tables.

Your output must list the first 10 members of the times table for the given number. You may leave out 0*n.

Body:
Python 3, <s>52</s> <s>33</s> 30 bytes

lambda n:list(range(0,11*n,n))

3 bytes saved thanks to @manatwork

Formatting the output is visibly not necessary


答:
MATLAB, 12 bytes

```<code>@(x)x*[1:10]
</code>```

Not really much to it. An anonymous function that takes x as input and multiplies it by the vector [1:10]. Displays as ans = 2  4  6 ... Also works in Octave.

Try it online.

Title: Print multiplication tables by input

Body:
MATLAB, 12 bytes

@(x)x*[1:10]

Not really much to it. An anonymous function that takes x as input and multiplies it by the vector [1:10]. Displays as ans = 2  4  6 ... Also works in Octave.

Try it online.


答:
Pyke, 5 bytes

```<code>TSQm*
</code>```

Try it here!

Or TQm* if allowed to do numbers 0-9 rather than 1-10

Or TL* if we're going non-competitive.

Title: Print multiplication tables by input

Body:
Pyke, 5 bytes

TSQm*

Try it here!

Or TQm* if allowed to do numbers 0-9 rather than 1-10

Or TL* if we're going non-competitive.


答:
Pyth, 7 bytes

```<code>m*dQU11

Input: 2
Output: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
</code>```

Prints as a list, but can print as seen in the question with a simple modification, making it 9 bytes.

```<code>jdm*dQU11

Input: 20
Output: 0 20 40 60 80 100 120 140 160 180 200
</code>```

Title: Print multiplication tables by input

Body:
Pyth, 7 bytes

m*dQU11

Input: 2
Output: [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

Prints as a list, but can print as seen in the question with a simple modification, making it 9 bytes.

jdm*dQU11

Input: 20
Output: 0 20 40 60 80 100 120 140 160 180 200


答:
Zsh, 19 characters

echo {0..${1}0..$1}
```

<p>Sample run:<br>
(This is the interactive way to run it, equivalent with <code>zsh scriptfile.sh 20</code>.)</p>

```~ % set -- 20

~ % echo {0..${1}0..$1}
0 20 40 60 80 100 120 140 160 180 200
```

Title: Print multiplication tables by input

Body:
Zsh, 19 characters

echo {0..${1}0..$1}

Sample run:

(This is the interactive way to run it, equivalent with zsh scriptfile.sh 20.)

~ % set -- 20

~ % echo {0..${1}0..$1}
0 20 40 60 80 100 120 140 160 180 200


问:
Print the alphabet without using each vowel
Inspiration: in 1939, a man named Ernest Vincent Wright wrote a novel called Gadsby without using the letter 'e'.

Your task is to write a set of (up to 5) programs in any language (which has a text-based syntax*) to output all 26 letters of the alphabet in order.  However for each vowel aeiou, at least one of the programs must not include any occurrence of the vowel.

So there must be

a program that does not use 'a' or 'A' anywhere in the syntax of the program.

a program that does not use 'e' or 'E' anywhere in the syntax of the program.

a program that does not use 'i'  or 'I' anywhere in the syntax of the program.

a program that does not use 'o' or 'O' anywhere in the syntax of the program.

a program that does not use 'u' or 'U' anywhere in the syntax of the program.

All of them must output abcdefghijklmnopqrstuvwxyz.

The winner shall be the solution where the length of all programs is the shortest.

* since the constraint wouldn't be much of a challenge in Piet or Whitespace

答:
Perl (25 24 ) (18?) (no wowels, little cheating)

script.pl contains:

```<code>$"="";s//@{["\x61"..z]}/
</code>```

it has to be executed this way:

```<code>echo | perl -p script.pl
</code>```

or

```<code>echo | perl -pe '$"="";s//@{["\x61"..z]}/'
</code>```

If you don't mind spaces between letters in the alphabet, it can be shortened to 18 characters:

```<code>s//@{["\x61"..z]}/
</code>```

($" variable defines separator to be used for printing arrays, space is default)

UPDATES:

s/^/ -> s//

Body:
Perl (25 24 ) (18?) (no wowels, little cheating)

script.pl contains:

$"="";s//@{["\x61"..z]}/

it has to be executed this way:

echo | perl -p script.pl

or

echo | perl -pe '$"="";s//@{["\x61"..z]}/'

If you don't mind spaces between letters in the alphabet, it can be shortened to 18 characters:

s//@{["\x61"..z]}/

($" variable defines separator to be used for printing arrays, space is default)

UPDATES:

s/^/ -> s//


答:
MATL, 4 bytes

```<code>10:*
</code>```

Breakdown:

```<code>        % Implicit input
10:     % Create a list from 1 2 ... 10
   *    % Multiply list by input
        % Implicit output
</code>```

Try it online

Title: Print multiplication tables by input

Body:
MATL, 4 bytes

10:*

Breakdown:

        % Implicit input
10:     % Create a list from 1 2 ... 10
   *    % Multiply list by input
        % Implicit output

Try it online


答:
Pyth, 5 bytes

```<code>*RQST
</code>```

If we're allowed to print the table from 0-9, *RQT would work as well.  Outputs in list [2, 4, 6, 8,...] form.

Title: Print multiplication tables by input

Body:
Pyth, 5 bytes

*RQST

If we're allowed to print the table from 0-9, *RQT would work as well.  Outputs in list [2, 4, 6, 8,...] form.


答:
Jelly, 3 bytes

```<code>⁵R×
</code>```

Test it at TryItOnline

Or first 256 cases, nicely aligned, also at TryItOnline

How?

```<code>⁵R× - main link takes one argument, n
⁵   - literal 10
 R  - range [1,2,...,10]
  × - multiply by input (implicit vectorization)
</code>```

Title: Print multiplication tables by input

Body:
Jelly, 3 bytes

⁵R×

Test it at TryItOnline

Or first 256 cases, nicely aligned, also at TryItOnline

How?

⁵R× - main link takes one argument, n
⁵   - literal 10
 R  - range [1,2,...,10]
  × - multiply by input (implicit vectorization)


答:
Jellyfish, 8 bytes

```<code>p*r11
 i
</code>```

Try it online!

Quite simple: r11 gives the list [0, 1, ..., 9, 10], i reads the input, * multiplies them and p prints the resulting list.

Title: Print multiplication tables by input

Body:
Jellyfish, 8 bytes

p*r11
 i

Try it online!

Quite simple: r11 gives the list [0, 1, ..., 9, 10], i reads the input, * multiplies them and p prints the resulting list.


答:
Java 7, <s>61</s> 57 bytes

```<code>void c(int n){for(int i=0;i++<10;)System.out.print(i*n);}
</code>```

Ungolfed & test cases:

Try it here.

```<code>class M{
  static void c(int n){
    for(int i = 0; i++ < 10; ){
      System.out.print(i*n);
    }
  }

  public static void main(String[] a){
    c(2);
    System.out.println();
    c(20);
  }
}
</code>```

Output:

```<code>2468101214161820
20406080100120140160180200
</code>```

Title: Print multiplication tables by input

Body:
Java 7, <s>61</s> 57 bytes

void c(int n){for(int i=0;i++<10;)System.out.print(i*n);}

Ungolfed & test cases:

Try it here.

class M{
  static void c(int n){
    for(int i = 0; i++ < 10; ){
      System.out.print(i*n);
    }
  }

  public static void main(String[] a){
    c(2);
    System.out.println();
    c(20);
  }
}

Output:

2468101214161820
20406080100120140160180200


答:
05AB1E, 3 bytes

```<code>TL*
</code>```

Explanation

```<code>T    # literal predefined  as 10
 L   # 1-based range: [1,2,3,4,5,6,7,8,9,10]
  *  # multiply with input
</code>```

Try it online!

Title: Print multiplication tables by input

Body:
05AB1E, 3 bytes

TL*

Explanation

T    # literal predefined  as 10
 L   # 1-based range: [1,2,3,4,5,6,7,8,9,10]
  *  # multiply with input

Try it online!


答:
Brachylog, 12 bytes

```<code>,10y:[?]z:*a
</code>```

Try it online!

I need to implement that I * [A, B, C] = [I*A, I*B, I*C]…

Explanation

```<code>,10y            The range [0, 1, …, 10]
    :[?]z       The list [[0, Input], [1, Input], …, [10, Input]]
         :*a    The list [0*Input, 1*Input, …, 10*Input]
</code>```

Title: Print multiplication tables by input

Body:
Brachylog, 12 bytes

,10y:[?]z:*a

Try it online!

I need to implement that I * [A, B, C] = [I*A, I*B, I*C]…

Explanation

,10y            The range [0, 1, …, 10]
    :[?]z       The list [[0, Input], [1, Input], …, [10, Input]]
         :*a    The list [0*Input, 1*Input, …, 10*Input]


答:
JavaScript, 42 bytes

```<code>function f(a){for(i=0;i<11;i++)alert(i*a)}
</code>```

Title: Print multiplication tables by input

Body:
JavaScript, 42 bytes

function f(a){for(i=0;i<11;i++)alert(i*a)}


答:
Neoscript, 16 bytes

```<code>{n|0:[n]:(10*n)}
</code>```

Inspired by @manatwork answer

Title: Print multiplication tables by input

Body:
Neoscript, 16 bytes

{n|0:[n]:(10*n)}

Inspired by @manatwork answer


答:
brainf***, 84 bytes

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

Expects input as a single byte (as BF can only operate on numbers up to 255) and returns results as single bytes.  Some values may look like ASCII, but they should not be treated as such; look at the decimal representation of the returned bytes.

Try it online!

Title: Print multiplication tables by input

Body:
brainf***, 84 bytes

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

Expects input as a single byte (as BF can only operate on numbers up to 255) and returns results as single bytes.  Some values may look like ASCII, but they should not be treated as such; look at the decimal representation of the returned bytes.

Try it online!


答:
Haskell, 12

```<code>['\97'..'z']
</code>```

Or is this cheating? :)

Title: Print the alphabet without using each vowel

Body:
Inspiration: in 1939, a man named Ernest Vincent Wright wrote a novel called Gadsby without using the letter 'e'.

Your task is to write a set of (up to 5) programs in any language (which has a text-based syntax*) to output all 26 letters of the alphabet in order.  However for each vowel aeiou, at least one of the programs must not include any occurrence of the vowel.

So there must be

a program that does not use 'a' or 'A' anywhere in the syntax of the program.

a program that does not use 'e' or 'E' anywhere in the syntax of the program.

a program that does not use 'i'  or 'I' anywhere in the syntax of the program.

a program that does not use 'o' or 'O' anywhere in the syntax of the program.

a program that does not use 'u' or 'U' anywhere in the syntax of the program.

All of them must output abcdefghijklmnopqrstuvwxyz.

The winner shall be the solution where the length of all programs is the shortest.

* since the constraint wouldn't be much of a challenge in Piet or Whitespace

Body:
Haskell, 12

['\97'..'z']

Or is this cheating? :)


答:
LI, 30 bytes

```<code>M1iM2iM3iM4iM5iM6iM7iM8iM9iMY9
</code>```

The lack of a working list implementation does not win me any awards today.

Title: Print multiplication tables by input

Body:
In this challenge you've to print multiplication tables by input, Here are some examples:

```<code>Input: 2

Output:
0 2  4 6 8  10  12  14  16  18  20

Input: 20

Output: 20 40 60 80 100 120 140 160 180 200
</code>```

Rules

The shortest code in bytes wins.

This challenge is a code-golf, It follows code-golf general rules (code-golf)

If, just if, your code can't print number, you can use letters, Here is an example:

Input: B

Output: B D F H J L N P R T

You can choose to start from 0 or your number (like 20). You can choose if put spaces or don't. The challenge is free, just take an input and print multiplication tables.

Your output must list the first 10 members of the times table for the given number. You may leave out 0*n.

Body:
LI, 30 bytes

M1iM2iM3iM4iM5iM6iM7iM8iM9iMY9

The lack of a working list implementation does not win me any awards today.


答:
C#, <s>105</s> <s>96</s> <s>67</s> 56 bytes

Now that I know how lambda's work in C#, here is an update to my first answer:

```<code>n=>{for(int i=0;i++<10;)System.Console.Write(i*n+" ");};
</code>```

Saves 11 bytes.

First post, please forgive me for anything I've done wrong.  Also, feel free to give me golfing tips, as I haven't really tried it before!

```<code>void c(int n){for(int i=0;i++<10;){System.Console.Write(i*n+" ");}}
</code>```

Ungolfed:

```<code>void c(int n)
{
    for (int i = 0; i++ < 10 ; )
    {
        System.Console.Write(i*n+" ");
    }
}
</code>```

Thank you Jonathan Allan, can't add comments yet.
And thank you Kevin Cruijssen.  I assumed I had to always include the entire program unless the question specified that snippets were allowed.  Would I also be able to leave out the System. call to print to console in this case, or are using/imports required then?

Title: Print multiplication tables by input

Body:
C#, <s>105</s> <s>96</s> <s>67</s> 56 bytes

Now that I know how lambda's work in C#, here is an update to my first answer:

n=>{for(int i=0;i++<10;)System.Console.Write(i*n+" ");};

Saves 11 bytes.

First post, please forgive me for anything I've done wrong.  Also, feel free to give me golfing tips, as I haven't really tried it before!

void c(int n){for(int i=0;i++<10;){System.Console.Write(i*n+" ");}}

Ungolfed:

void c(int n)
{
    for (int i = 0; i++ < 10 ; )
    {
        System.Console.Write(i*n+" ");
    }
}

Thank you Jonathan Allan, can't add comments yet.
And thank you Kevin Cruijssen.  I assumed I had to always include the entire program unless the question specified that snippets were allowed.  Would I also be able to leave out the System. call to print to console in this case, or are using/imports required then?


答:
Labyrinth, 41 bytes

First time trying to use Labyrinth.  I have no idea how to take advantage of grid manipulation, so I ignored it in my answer.  There's <s>probably</s> certainly better ways to do this, but I don't know how to do it.

```<code>10}
  ?
: :
:::
  :
":"
"
!\{(@
"  }
":+"
</code>```

Try it online!

Title: Print multiplication tables by input

Body:
Labyrinth, 41 bytes

First time trying to use Labyrinth.  I have no idea how to take advantage of grid manipulation, so I ignored it in my answer.  There's <s>probably</s> certainly better ways to do this, but I don't know how to do it.

10}
  ?
: :
:::
  :
":"
"
!\{(@
"  }
":+"

Try it online!


Title: Print multiplication tables by input

Body:
PHP, 34 bytes

(34 bytes)

for(;$i++<10;)echo$i*$argv[1].' ';

(34 bytes)

for(;++$i%11;)echo$i*$argv[1].' ';

(34 bytes)

while($i++<10)echo$i*$argv[1].' ';

(35 bytes)

for(;$i++<10;)echo' '.$a+=$argv[1];

(<s>41</s> 40 bytes)

<?=join(' ',range(0,10*$a=$argv[1],$a));

<s>

<?=join(' ',range($a=$argv[1],10*$a,$a));

</s>
(44 bytes)

foreach(range(1,10)as$i)echo$i*$argv[1].' ';


Title: Print multiplication tables by input

Body:
R, 11 bytes

scan()*0:10

30 char.


答:
Scala, 41 35 bytes

Usage scala multiplicationtable.scala <input>

Code

```<code>print(1 to 10 map(args(0).toInt*))
</code>```

Title: Print multiplication tables by input

Body:
Scala, 41 35 bytes

Usage scala multiplicationtable.scala <input>

Code

print(1 to 10 map(args(0).toInt*))


答:
MATLAB 57 + 6

```<code>@(a,b)unique(perms([ones(1,a) zeros(1,b)])*2.^(0:a+b-1)')
</code>```

run using

```<code>ans(2,3)
</code>```

ungolfed

```<code>function decimalPerms( nZeros, nOnes )
  a = [ones(1,nOnes) zeros(1,nZeros)];  % make 1 by n array of ones and zeros
  a = perms(a);                         % get permutations of the above
  powOfTwo = 2.^(0:nOnes+nZeros-1)';    % powers of two as vector
  a = a * powOfTwo;                     % matrix multiply to get the possible values
  a = unique(a)                         % select the unique values and print
</code>```

Title: All Binary Combinations to Decimal

Body:
Disclaimer

This question is not a duplicate of this question. I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal numbers that can be constructed from the binary strings based on the digits provided.

Challenge

Given two integers X and Y, representing the number of zeroes (0) and ones (1) respectively, calculate all the possible decimal equivalents that can be determined from creating binary strings using only the zeroes and ones provided, and display them as output.

Example 1:

Input: 0 1

Output: 1

Explanation: Only one 1 to account for, which can only be converted one way.

Example 2:

Input: 1 1

Output: 1,2

Explanation: 01 converts to 1, 10 converts to 2.

Example 3:

Input: 3 2

Output: 3,5,6,9,10,12,17,18,20,24

Explanation: Three 0s and two 1s make 00011 (3), 00101 (5), 00110 (6), 01001 (9), 01010 (10), 01100 (12), 10001 (17), 10010 (18), 10100 (20), 11000 (24)

Limitations and Rules

I will only expect your code to work where 0 < X + Y <= 16 so the maximum number in the output could only occur from 16 1s, i.e. parameters 0 and 16.

As a result of the above limitation, the range of numbers we'd expect in the output are from 0 and 65535.

I will accept functions or code, so long as the resulting output is provided, whether this be a comma separated list, an array, list outputted to STDOUT, etc. The only criteria I must stress about the output is that it must be sorted.

This is code golf, minimum bytes will receive maximum glory.

We will not tolerate silly loopholes

Body:
MATLAB 57 + 6

@(a,b)unique(perms([ones(1,a) zeros(1,b)])*2.^(0:a+b-1)')

run using

ans(2,3)

ungolfed

function decimalPerms( nZeros, nOnes )
  a = [ones(1,nOnes) zeros(1,nZeros)];  % make 1 by n array of ones and zeros
  a = perms(a);                         % get permutations of the above
  powOfTwo = 2.^(0:nOnes+nZeros-1)';    % powers of two as vector
  a = a * powOfTwo;                     % matrix multiply to get the possible values
  a = unique(a)                         % select the unique values and print


Title: Print multiplication tables by input

Body:
Racket 31 bytes

(λ(n)(for/list((i 11))(* n i)))

Saved 7 bytes using suggestion by @StevenH "define(f n)"  replaced by "λ(n)".

Testing:

(f 2)
'(0 2 4 6 8 10 12 14 16 18 20)

(f 20)
'(0 20 40 60 80 100 120 140 160 180 200)

(f 7)
'(0 7 14 21 28 35 42 49 56 63 70)

(f 19)
'(0 19 38 57 76 95 114 133 152 171 190)


答:
Mata, 15 29 Bytes

```<code>args i
mata
A=1..10
B=`i'*A
B
</code>```

Mata is the matrix programming language in the Stata commercial statistics package. Code creates a matrix, multiplies by the input (2 in this case) and the outputs the new matrix

Output

```<code>        1    2    3    4    5    6    7    8    9   10
    +---------------------------------------------------+
  1 |   2    4    6    8   10   12   14   16   18   20  |
    +---------------------------------------------------+
</code>```

Title: Print multiplication tables by input

Body:
Mata, 15 29 Bytes

args i
mata
A=1..10
B=`i'*A
B

Mata is the matrix programming language in the Stata commercial statistics package. Code creates a matrix, multiplies by the input (2 in this case) and the outputs the new matrix

Output

        1    2    3    4    5    6    7    8    9   10
    +---------------------------------------------------+
  1 |   2    4    6    8   10   12   14   16   18   20  |
    +---------------------------------------------------+


问:
Stringsplode the String!
The challenge is relatively simple, but will hopefully lead to some wonderfully creative answers. The task is to take a string as an input (via command line, function parameter etc.) and output/return a stringsploded version of it.

A stringsploded version of a string is its first letter followed by its first 2 letters, followed by its first 3 letters,... until you finally output the complete word.

You are guaranteed that the input will consist of printable ASCII characters and that the input will all be on one line (no new line characters).

Here are examples to clarify what stringsplosions are:

```<code>Input                 Output
==================================================================
"Code"       ---->   "CCoCodCode"
"name"       ---->   "nnanamname"
"harambe"    ---->   "hhaharharaharamharambharambe"
"sp aces?"   ---->   "sspsp sp asp acsp acesp acessp aces?"
"1234"       ---->   "1121231234"
"ss"         ---->   "sss"
</code>```

This is code golf so shortest code wins + up votes for interesting uses of your respective language.

Good luck!

答:
Brachylog, <s>11</s> 5 bytes

```<code>:@[fc
</code>```

Try it online!

Explanation

```<code>:@[f           Find all prefixes of the input
    c          Concatenate
</code>```

Title: Stringsplode the String!

Body:
Brachylog, <s>11</s> 5 bytes

:@[fc

Try it online!

Explanation

:@[f           Find all prefixes of the input
    c          Concatenate


答:
MATL, <s>9</s> <s>8</s> 6 bytes

2 bytes saved thanks to @Luis

```<code>t&+Rf)
</code>```

Try it Online!

Explanation

```<code>t       % Implicitly grab the input and duplicate
&+      % Broadcast and create a 2D matrix with all values > 0
R       % Grab the upper triangular portion (sets the lower triangular values to 0)
f       % Get the linear index for each value > 0
)       % Index into the original string (uses modular indexing)
        % Implicitly display the result
</code>```

Title: Stringsplode the String!

Body:
The challenge is relatively simple, but will hopefully lead to some wonderfully creative answers. The task is to take a string as an input (via command line, function parameter etc.) and output/return a stringsploded version of it.

A stringsploded version of a string is its first letter followed by its first 2 letters, followed by its first 3 letters,... until you finally output the complete word.

You are guaranteed that the input will consist of printable ASCII characters and that the input will all be on one line (no new line characters).

Here are examples to clarify what stringsplosions are:

```<code>Input                 Output
==================================================================
"Code"       ---->   "CCoCodCode"
"name"       ---->   "nnanamname"
"harambe"    ---->   "hhaharharaharamharambharambe"
"sp aces?"   ---->   "sspsp sp asp acsp acesp acessp aces?"
"1234"       ---->   "1121231234"
"ss"         ---->   "sss"
</code>```

This is code golf so shortest code wins + up votes for interesting uses of your respective language.

Good luck!

Body:
MATL, <s>9</s> <s>8</s> 6 bytes

2 bytes saved thanks to @Luis

t&+Rf)

Try it Online!

Explanation

t       % Implicitly grab the input and duplicate
&+      % Broadcast and create a 2D matrix with all values > 0
R       % Grab the upper triangular portion (sets the lower triangular values to 0)
f       % Get the linear index for each value > 0
)       % Index into the original string (uses modular indexing)
        % Implicitly display the result


答:
05AB1E, 3 bytes

```<code>.pJ
</code>```

Explanation

```<code>.p   # get list of prefixes of input
  J  # join as string
</code>```

Try it online!

Title: Stringsplode the String!

Body:
05AB1E, 3 bytes

.pJ

Explanation

.p   # get list of prefixes of input
  J  # join as string

Try it online!


答:
Python 3, 47 bytes

Thanks to @deustice

lambda s:''.join(s[:i]for i in range(len(s)+1))
```

Ideone it!

Title: Stringsplode the String!

Body:
Python 3, 47 bytes

Thanks to @deustice

lambda s:''.join(s[:i]for i in range(len(s)+1))

Ideone it!


答:
Python, <s>34</s> 28 bytes

Here's my rough attempt with a recursive solution:

f=lambda s:s and f(s[:-1])+s
```

<p>Ungolfed:</p>

<pre class="lang-py prettyprint-override"><code>def f(s):
    if s: return f(s[:-1]) + s
    return ''
</code>```

Try it here!

Thanks to @Dennis for -6 bytes.

Title: Stringsplode the String!

Body:
Python, <s>34</s> 28 bytes

Here's my rough attempt with a recursive solution:

f=lambda s:s and f(s[:-1])+s

Ungolfed:

def f(s):
    if s: return f(s[:-1]) + s
    return ''

Try it here!

Thanks to @Dennis for -6 bytes.


答:
Haskell, <s>34 29 28</s> 26 bytes

```<code>reverse=<<scanl(flip(:))[]
</code>```

Title: Stringsplode the String!

Body:
Haskell, <s>34 29 28</s> 26 bytes

reverse=<<scanl(flip(:))[]


答:
Ruby, 13 + 1 = 14 bytes

+1 byte for -p flag. Expects input on STDIN. Requires Windows-style line endings (\r\n).

```<code>gsub(/./){$`}
</code>```

See it on eval.in (a few extra bytes since eval.in doesn't support command line flags):
https://eval.in/637093

Title: Stringsplode the String!

Body:
Ruby, 13 + 1 = 14 bytes

+1 byte for -p flag. Expects input on STDIN. Requires Windows-style line endings (\r\n).

gsub(/./){$`}

See it on eval.in (a few extra bytes since eval.in doesn't support command line flags):
https://eval.in/637093


答:
C, 49 bytes

i;f(char*n){for(i=0;i++<strlen(n);)write(1,n,i);}
```

Try on Ideone

Title: Stringsplode the String!

Body:
C, 49 bytes

i;f(char*n){for(i=0;i++<strlen(n);)write(1,n,i);}

Try on Ideone


答:
Jelly, <s>5 4</s> 2 bytes

-2 bytes thanks to @Dennis

```<code>ḣJ
</code>```

Test it at TryItOnline

Or all test cases, also at TryItOnline

How?

```<code>ḣJ - Main link takes one argument, e.g. "Code"
 J    - range(length(input)), e.g. [1,2,3,4]
ḣ    - head, x[:y] (implicit vectorization), e.g. "CCoCodCode"
</code>```

Title: Stringsplode the String!

Body:
Jelly, <s>5 4</s> 2 bytes

-2 bytes thanks to @Dennis

ḣJ

Test it at TryItOnline

Or all test cases, also at TryItOnline

How?

ḣJ - Main link takes one argument, e.g. "Code"
 J    - range(length(input)), e.g. [1,2,3,4]
ḣ    - head, x[:y] (implicit vectorization), e.g. "CCoCodCode"


答:
C#, <s>91</s> <s>87</s> <s>84</s> 83 bytes

```<code>void c(string n){var b="";for(int i=0;i<n.Length;)System.Console.Write(b+=n[i++]);}
</code>```

Ungolfed:

```<code>void c(string n)
{
    var b = "";
    for (int i = 0; i < n.Length ; )
    {
        System.Console.Write(b+=n[i++]);
    }
}
</code>```

Thank you Kevin Cruijssen.

Title: Stringsplode the String!

Body:
C#, <s>91</s> <s>87</s> <s>84</s> 83 bytes

void c(string n){var b="";for(int i=0;i<n.Length;)System.Console.Write(b+=n[i++]);}

Ungolfed:

void c(string n)
{
    var b = "";
    for (int i = 0; i < n.Length ; )
    {
        System.Console.Write(b+=n[i++]);
    }
}

Thank you Kevin Cruijssen.


答:
Clojure, 70 <s>80</s> bytes

This is my first post on CG, I hope the input is OK:

70 bytes

```<code>(defn -main[& a](println(map #(* %(read-string(first a)))(range 10))))
</code>```

80 bytes

```<code>(defn -main[& a](let[n(read-string(first a))](println(map #(* % n)(range 10)))))
</code>```

The program will read a number as a stdin argument and display the result:

Output

```<code>lein run 10
(0 10 20 30 40 50 60 70 80 90)
</code>```

Title: Print multiplication tables by input

Body:
In this challenge you've to print multiplication tables by input, Here are some examples:

```<code>Input: 2

Output:
0 2  4 6 8  10  12  14  16  18  20

Input: 20

Output: 20 40 60 80 100 120 140 160 180 200
</code>```

Rules

The shortest code in bytes wins.

This challenge is a code-golf, It follows code-golf general rules (code-golf)

If, just if, your code can't print number, you can use letters, Here is an example:

Input: B

Output: B D F H J L N P R T

You can choose to start from 0 or your number (like 20). You can choose if put spaces or don't. The challenge is free, just take an input and print multiplication tables.

Your output must list the first 10 members of the times table for the given number. You may leave out 0*n.

Body:
Clojure, 70 <s>80</s> bytes

This is my first post on CG, I hope the input is OK:

70 bytes

(defn -main[& a](println(map #(* %(read-string(first a)))(range 10))))

80 bytes

(defn -main[& a](let[n(read-string(first a))](println(map #(* % n)(range 10)))))

The program will read a number as a stdin argument and display the result:

Output

lein run 10
(0 10 20 30 40 50 60 70 80 90)


答:
PowerShell v2+, 23 bytes

```<code>param($n)1..10|%{$_*$n}
</code>```

Takes input via command-line argument, loops over the range 1 to 10, each loop placing that number *$n on the pipeline. Output via implicit Write-Output at end of program execution results in newline separated values.

```<code>PS C:\Tools\Scripts\golfing> .\multiplication-table.ps1 2
2
4
6
8
10
12
14
16
18
20

PS C:\Tools\Scripts\golfing> .\multiplication-table.ps1 20
20
40
60
80
100
120
140
160
180
200
</code>```

Title: Print multiplication tables by input

Body:
PowerShell v2+, 23 bytes

param($n)1..10|%{$_*$n}

Takes input via command-line argument, loops over the range 1 to 10, each loop placing that number *$n on the pipeline. Output via implicit Write-Output at end of program execution results in newline separated values.

PS C:\Tools\Scripts\golfing> .\multiplication-table.ps1 2
2
4
6
8
10
12
14
16
18
20

PS C:\Tools\Scripts\golfing> .\multiplication-table.ps1 20
20
40
60
80
100
120
140
160
180
200


答:
Java 8, <s>126</s> 125 bytes

```<code>s->{int t=s.replaceAll("<","").length(),y=t-1;String r=t+++"";for(char c:s.toCharArray())r+=(c+"")+(c<61?t++:y--);return r;};
</code>```

I don't think this even works hehe

Ungolfed test program

```<code>public static void main(String[] args) {
    Function<String, String> function = s -> {
        int t = s.replaceAll("<", "").length(), y = t - 1;
        String r = t++ + "";
        for (char c : s.toCharArray()) {
            r += (c + "") + (c < 61 ? t++ : y--);
        }
        return r;
    };

    System.out.println(function.apply("<<><><<"));
    System.out.println(function.apply(">>><<<"));
    System.out.println(function.apply(">>>"));
    System.out.println(function.apply("<<<"));
    System.out.println(function.apply(">><><>>"));
}
</code>```

Body:
Given a length N string of less-than and greater-than signs (<, >), insert the integers 0 through N at the start and end and in between each pair of signs such that all the inequalities are satisfied. Output the resulting string. If there are multiple valid outputs, output any one (and just one) of them.

For example

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

has 7 characters so all the numbers from 0 to 7 inclusive must be inserted. A valid output is

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

because all the inequalities taken one at a time

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

are true.

If desired, the output may have spaces surrounding the signs, e.g. 2 < 3 < 4 > 1 < 5 > 0 < 6 < 7.

The shortest code in bytes wins.

Test Cases

The first line after an empty line is the input and the next line(s) are each valid output examples.

```<code>[empty string]
0

<
0<1

>
1>0

<<
0<1<2

<>
1<2>0

><
1>0<2
2>0<1

>>
2>1>0

<<<
0<1<2<3

><>
1>0<3>2

>><
3>2>0<1
3>1>0<2
2>1>0<3

>>>
3>2>1>0

>>><<<
3>2>1>0<4<5<6
6>3>1>0<2<4<5
4>2>1>0<3<5<6
4>3>1>0<2<5<6

<<><><<
2<3<4>1<5>0<6<7

>><><>>
7>6>0<5>1<4>3>2

<<<<<<<<<<<<<<
0<1<2<3<4<5<6<7<8<9<10<11<12<13<14

>><<<<><>><><<
6>5>4<7<8<9<10>3<11>2>1<12>0<13<14
14>5>4<7<8<9<10>3<11>2>1<12>0<13<6
</code>```

Body:
Java 8, <s>126</s> 125 bytes

s->{int t=s.replaceAll("<","").length(),y=t-1;String r=t+++"";for(char c:s.toCharArray())r+=(c+"")+(c<61?t++:y--);return r;};

I don't think this even works hehe

Ungolfed test program

public static void main(String[] args) {
    Function<String, String> function = s -> {
        int t = s.replaceAll("<", "").length(), y = t - 1;
        String r = t++ + "";
        for (char c : s.toCharArray()) {
            r += (c + "") + (c < 61 ? t++ : y--);
        }
        return r;
    };

    System.out.println(function.apply("<<><><<"));
    System.out.println(function.apply(">>><<<"));
    System.out.println(function.apply(">>>"));
    System.out.println(function.apply("<<<"));
    System.out.println(function.apply(">><><>>"));
}


答:
PHP, 80 or 63 bytes

depending on wether I must use $argv or can use $x and $y instead.

```<code>for($i=1<<array_sum($argv);$i--;)echo$argv[2]-substr_count(decbin($i),1)?_:$i._;
</code>```

prints all matching numbers in descending order delimited by underscores.

filename must not begin with a digit.

no builtins, 88 or 71 bytes

```<code>for($i=1<<array_sum($argv);$i--;print$c?_:$i._)for($n=$i,$c=$argv[2];$n;$n>>=1)$c-=$n&1;
</code>```

add one byte each for only one underscore after every number.

@WallyWest: You were right. Saves 3 bytes for me from for($i=-1;++$i<...;)

Title: All Binary Combinations to Decimal

Body:
Disclaimer

This question is not a duplicate of this question. I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal numbers that can be constructed from the binary strings based on the digits provided.

Challenge

Given two integers X and Y, representing the number of zeroes (0) and ones (1) respectively, calculate all the possible decimal equivalents that can be determined from creating binary strings using only the zeroes and ones provided, and display them as output.

Example 1:

Input: 0 1

Output: 1

Explanation: Only one 1 to account for, which can only be converted one way.

Example 2:

Input: 1 1

Output: 1,2

Explanation: 01 converts to 1, 10 converts to 2.

Example 3:

Input: 3 2

Output: 3,5,6,9,10,12,17,18,20,24

Explanation: Three 0s and two 1s make 00011 (3), 00101 (5), 00110 (6), 01001 (9), 01010 (10), 01100 (12), 10001 (17), 10010 (18), 10100 (20), 11000 (24)

Limitations and Rules

I will only expect your code to work where 0 < X + Y <= 16 so the maximum number in the output could only occur from 16 1s, i.e. parameters 0 and 16.

As a result of the above limitation, the range of numbers we'd expect in the output are from 0 and 65535.

I will accept functions or code, so long as the resulting output is provided, whether this be a comma separated list, an array, list outputted to STDOUT, etc. The only criteria I must stress about the output is that it must be sorted.

This is code golf, minimum bytes will receive maximum glory.

We will not tolerate silly loopholes

Body:
PHP, 80 or 63 bytes

depending on wether I must use $argv or can use $x and $y instead.

for($i=1<<array_sum($argv);$i--;)echo$argv[2]-substr_count(decbin($i),1)?_:$i._;

prints all matching numbers in descending order delimited by underscores.

filename must not begin with a digit.

no builtins, 88 or 71 bytes

for($i=1<<array_sum($argv);$i--;print$c?_:$i._)for($n=$i,$c=$argv[2];$n;$n>>=1)$c-=$n&1;

add one byte each for only one underscore after every number.

@WallyWest: You were right. Saves 3 bytes for me from for($i=-1;++$i<...;)


答:
Jelly, 2 bytes

```<code>;\
</code>```

Acculumate over concatenation gives all prefixes, which Jelly outputs to STDOUT without a delimiter. Try it online!

Title: Stringsplode the String!

Body:
The challenge is relatively simple, but will hopefully lead to some wonderfully creative answers. The task is to take a string as an input (via command line, function parameter etc.) and output/return a stringsploded version of it.

A stringsploded version of a string is its first letter followed by its first 2 letters, followed by its first 3 letters,... until you finally output the complete word.

You are guaranteed that the input will consist of printable ASCII characters and that the input will all be on one line (no new line characters).

Here are examples to clarify what stringsplosions are:

```<code>Input                 Output
==================================================================
"Code"       ---->   "CCoCodCode"
"name"       ---->   "nnanamname"
"harambe"    ---->   "hhaharharaharamharambharambe"
"sp aces?"   ---->   "sspsp sp asp acsp acesp acessp aces?"
"1234"       ---->   "1121231234"
"ss"         ---->   "sss"
</code>```

This is code golf so shortest code wins + up votes for interesting uses of your respective language.

Good luck!

Body:
Jelly, 2 bytes

;\

Acculumate over concatenation gives all prefixes, which Jelly outputs to STDOUT without a delimiter. Try it online!


答:
Retina, 4 bytes

```<code>.
$`
</code>```

Expects the input to be terminated with a Windows-style \r\n newline (which seems fitting for a .NET-based programming language...).

This can be tested on Regex Storm (which uses \r\n newlines). Click the "Context" tab for the result.

This is essentially the same as Jordan's Ruby answer: it replaces each character in the input (including the \r but not the \n) with all the characters that came before it.

Title: Stringsplode the String!

Body:
Retina, 4 bytes

.
$`

Expects the input to be terminated with a Windows-style \r\n newline (which seems fitting for a .NET-based programming language...).

This can be tested on Regex Storm (which uses \r\n newlines). Click the "Context" tab for the result.

This is essentially the same as Jordan's Ruby answer: it replaces each character in the input (including the \r but not the \n) with all the characters that came before it.


答:
Java 7, <s>81</s> 78 bytes

```<code>String g(String a){for(int i=a.length();i>0;)a=a.substring(0,--i)+a;return a;}
</code>```

Straightforward method. Repeatedly prepends the shrinking prefix until it's done.

As a bonus, it should work for non-ASCII as well.

Sample:

```<code>Input:  ( ͡° ͜ʖ ͡°)
Output: (( ( ͡( ͡°( ͡° ( ͡° ͜( ͡° ͜ʖ( ͡° ͜ʖ ( ͡° ͜ʖ ͡( ͡° ͜ʖ ͡°( ͡° ͜ʖ ͡°)
</code>```

Title: Stringsplode the String!

Body:
Java 7, <s>81</s> 78 bytes

String g(String a){for(int i=a.length();i>0;)a=a.substring(0,--i)+a;return a;}

Straightforward method. Repeatedly prepends the shrinking prefix until it's done.

As a bonus, it should work for non-ASCII as well.

Sample:

Input:  ( ͡° ͜ʖ ͡°)
Output: (( ( ͡( ͡°( ͡° ( ͡° ͜( ͡° ͜ʖ( ͡° ͜ʖ ( ͡° ͜ʖ ͡( ͡° ͜ʖ ͡°( ͡° ͜ʖ ͡°)


答:
C89, 44 bytes

```<code>k;main(n){for(k=n*11;k-=n;)printf("%d ",k);}
</code>```

Ungolfed:

```<code>k;
main(n)
{
    for (k=n*11 ; k-=n ;)
        printf("%d ", k);
}
</code>```

Compile and run with (input 4)

```<code>gcc -ansi main.c && ./a.out 2 3 4
</code>```

Output

```<code>40 36 32 28 24 20 16 12 8 4
</code>```

Test it

Demo

Title: Print multiplication tables by input

Body:
C89, 44 bytes

k;main(n){for(k=n*11;k-=n;)printf("%d ",k);}

Ungolfed:

k;
main(n)
{
    for (k=n*11 ; k-=n ;)
        printf("%d ", k);
}

Compile and run with (input 4)

gcc -ansi main.c && ./a.out 2 3 4

Output

40 36 32 28 24 20 16 12 8 4

Test it

Demo


答:
Python 2, 24 bytes

```<code>lambda n:range(0,11*n,n)
</code>```

range() in Python 2 returns a list, so there is no need to convert.

Title: Print multiplication tables by input

Body:
Python 2, 24 bytes

lambda n:range(0,11*n,n)

range() in Python 2 returns a list, so there is no need to convert.


答:
Retina, 24 bytes

Well, I got destroyed by Martin, but here was my solution.

```<code>1m+`(.*).$
$1$.1$*¶$0
¶

</code>```

Try it online

Title: Stringsplode the String!

Body:
Retina, 24 bytes

Well, I got destroyed by Martin, but here was my solution.

1m+`(.*).$
$1$.1$*¶$0
¶

Try it online


答:
Go, 90 bytes

```<code>package main;import."fmt";func main(){s:="";Scan(&s);for i:=0;i<=len(s);i++{Print(s[:i])}}
</code>```

Title: Stringsplode the String!

Body:
Go, 90 bytes

package main;import."fmt";func main(){s:="";Scan(&s);for i:=0;i<=len(s);i++{Print(s[:i])}}


答:
Jellyfish, 5 bytes

```<code>P,\}I
</code>```

Try it online!

Explanation

```<code>    I  # Read input.
  \}   # Get all prefixes.
 ,     # Flatten.
P      # Print.
</code>```

Title: Stringsplode the String!

Body:
Jellyfish, 5 bytes

P,\}I

Try it online!

Explanation

    I  # Read input.
  \}   # Get all prefixes.
 ,     # Flatten.
P      # Print.