问:
Enlarge ASCII art
In this challenge, you must take multiline ASCII art as input, such as:

```<code> OOOOOO  OOOOOO  OOOOOO  OOOOOOO      OOOOOO   OOOOOO  OO      OOOOOOO
OO      OO    OO OO   OO OO          OO       OO    OO OO      OO
OO      OO    OO OO   OO OOOOO       OO   OOO OO    OO OO      OOOOO
OO      OO    OO OO   OO OO          OO    OO OO    OO OO      OO
 OOOOOO  OOOOOO  OOOOOO  OOOOOOO      OOOOOO   OOOOOO  OOOOOOO OO
</code>```

And you will also take an integer as input. You must output the ASCII art enlarged by the amount specified with the integer. For example, if you used a second argument of 3, the output would be

```<code>   OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO                  OOOOOOOOOOOOOOOOOO         OOOOOOOOOOOOOOOOOO      OOOOOO                  OOOOOOOOOOOOOOOOOOOOO
   OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO                  OOOOOOOOOOOOOOOOOO         OOOOOOOOOOOOOOOOOO      OOOOOO                  OOOOOOOOOOOOOOOOOOOOO
   OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO                  OOOOOOOOOOOOOOOOOO         OOOOOOOOOOOOOOOOOO      OOOOOO                  OOOOOOOOOOOOOOOOOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOO                              OOOOOO                     OOOOOO            OOOOOO   OOOOOO                  OOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOO                              OOOOOO                     OOOOOO            OOOOOO   OOOOOO                  OOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOO                              OOOOOO                     OOOOOO            OOOOOO   OOOOOO                  OOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOOOOOOOOOOO                     OOOOOO         OOOOOOOOO   OOOOOO            OOOOOO   OOOOOO                  OOOOOOOOOOOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOOOOOOOOOOO                     OOOOOO         OOOOOOOOO   OOOOOO            OOOOOO   OOOOOO                  OOOOOOOOOOOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOOOOOOOOOOO                     OOOOOO         OOOOOOOOO   OOOOOO            OOOOOO   OOOOOO                  OOOOOOOOOOOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOO                              OOOOOO            OOOOOO   OOOOOO            OOOOOO   OOOOOO                  OOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOO                              OOOOOO            OOOOOO   OOOOOO            OOOOOO   OOOOOO                  OOOOOO
OOOOOO                  OOOOOO            OOOOOO   OOOOOO         OOOOOO   OOOOOO                              OOOOOO            OOOOOO   OOOOOO            OOOOOO   OOOOOO                  OOOOOO
   OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO                  OOOOOOOOOOOOOOOOOO         OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO   OOOOOO
   OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO                  OOOOOOOOOOOOOOOOOO         OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO   OOOOOO
   OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO                  OOOOOOOOOOOOOOOOOO         OOOOOOOOOOOOOOOOOO      OOOOOOOOOOOOOOOOOOOOO   OOOOOO
</code>```

Specifically, each character must turn into an n by n box of that character, where n is the integer argument. For example, an input of

```<code>ab
cd
</code>```

and 3 will result in

```<code>aaabbb
aaabbb
aaabbb
cccddd
cccddd
cccddd
</code>```

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

答:
RProgN 100 Bytes (Windows) Non-Competing

```<code>'l' asoc
'i' asoc
i '[^
]' '%0' l rep replace '[^
]*' '%0
' l rep 'z' asoc z 1 z len 1 - sub replace
</code>```

RProgN doesn't have character escapes as of writing, which makes any handling of new lines require a physical new line. As such, this answer (and any input) has to use CRLFs, instead of just LFs. :(

Also, the 'rep' function was only added after this challenge was issued, as such, this is non-competing.

Title: Enlarge ASCII art

Body:
RProgN 100 Bytes (Windows) Non-Competing

'l' asoc
'i' asoc
i '[^
]' '%0' l rep replace '[^
]*' '%0
' l rep 'z' asoc z 1 z len 1 - sub replace

RProgN doesn't have character escapes as of writing, which makes any handling of new lines require a physical new line. As such, this answer (and any input) has to use CRLFs, instead of just LFs. :(

Also, the 'rep' function was only added after this challenge was issued, as such, this is non-competing.


问:
Draw a Bumpy String
(Inspired by this challenge.)

Let's say we have a string ABBCBA. We can say that there is a rise between A and B, for B follows A; we can say that there is a run between B and B, for nothing changes; and finally we can say there is a fall between C and B. We can draw a graph like this:

```<code>             A   B   B   C   B   A
Rising:        o       o
Continuing:        o
Falling:                   o   o
</code>```

Without the labels, and minimizing whitespace:

```<code>o o
 o
   oo
</code>```

This is the expected output for input ABBCBA.

You may use any non-whitespace character to replace o in the output. Further, each column may optionally have an extra space between them, like so:

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

The input will consist of at least three characters. The string will consist entirely of uppercase letters, but you may instead use lowercase letters.

Test cases

```<code>TEST CASE
LINE 1
LINE 2
LINE 3

HELLOWORLD
 o oo o
  o
o    o oo

TESTCASE
 oo  o

o  oo o

EXAMINATION
o o o o o

 o o o o o

ZSILENTYOUTH
  o ooo o

oo o   o oo

ABC
oo

ABCBA
oo

  oo
</code>```

答:
R, 114 bytes

A non-competing R answer.

```<code>v=y=z=rep(" ",length(x<-diff(utf8ToInt(scan(,"")))));v[x>0]="#";y[x==0]="#";z[x<0]="#";cat(v,"\n",y,"\n",z,sep="")
</code>```

Explanation

Read input from command line and convert into ascii decimal vector

Take 1st difference and create an 3x vectors of the same length with white spaces

Then replace the white space vectors with # if the differences are >0, ==0 or <0.

Coerce the vectors and print them separated by newlines

ContentLicense: CC BY-SA 3.0

Title: Draw a Bumpy String

Body:
R, 114 bytes

A non-competing R answer.

v=y=z=rep(" ",length(x<-diff(utf8ToInt(scan(,"")))));v[x>0]="#";y[x==0]="#";z[x<0]="#";cat(v,"\n",y,"\n",z,sep="")

Explanation

Read input from command line and convert into ascii decimal vector

Take 1st difference and create an 3x vectors of the same length with white spaces

Then replace the white space vectors with # if the differences are >0, ==0 or <0.

Coerce the vectors and print them separated by newlines


问:
Find the odd one out in a sequence
The Challenge:

Consider the function F(N) = 2^N + 1 where N is a positive integer less than 31. The sequence defined by this function is:

```<code>3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825
</code>```

An input will be generated as follows:

Take 5 contiguous integers from the above sequence.

Replace one of them with a different, positive integer (which may or may not be part of the above sequence).

Optionally reorder the the 5 resulting numbers.

Given such a list of 5 integers, find the one that was swapped in and is therefore not part of the original 5 contiguous integers.

Example:

Original sublist: 5, 9, 17, 33, 65.

Replace one: 5, 7, 17, 33, 65.

Reorder: 33, 17, 5, 7, 65.

The expected output would be 7.

The 5 values in the input will always be distinct and there will always be a unique solution. (For instance, you won't have to deal with inputs like 3, 9, 17, 33, 129 where either 3 or 129 might have been swapped in.)

Test Cases:

```<code>5,9,17,33,829
o/p: 829

9,5,17,829,33
o/p: 829

33, 17, 5, 7, 65
o/p: 7

5,9,177,33,65
o/p: 177

65,129,259,513,1025
o/p: 259

129,259,513,1025,65
o/p: 259

63,129,257,513,1025
o/p: 63

65,129,257,513,4097
o/p: 4097

5, 9, 2, 17, 33
o/p: 2

536870913, 67108865, 1073741825, 1, 268435457
o/p: 1
</code>```

答:
Jelly, 15 bytes

```<code>⁹R2*‘ṡ5ḟ@€µEÐfQ
</code>```

TryItOnline

All test cases also at TryItOnline

Returns a list containing one list containing the odd one out.

How?

```<code>⁹R2*‘ṡ5ḟ@€µEÐfQ - Main link, a (list)
⁹               - literal 256 (saving a byte over literal 30)
 R              - range, [1,2,3,...]
  2*            - 2 ** x, [2,4,8,...]
    ‘           - increment, [3,5,9,...]
     ṡ5         - all contiguous slices of length 5
       ḟ@€      - filter with reversed arguments for each
          µ     - monadic chain separation
            Ðf  - filter on condition:
           E    - all equal (those previously filtered lists with only one value)
              Q - unique (there can be two, but both will have the same odd-one-out)
</code>```

Title: Find the odd one out in a sequence

Body:
Jelly, 15 bytes

⁹R2*‘ṡ5ḟ@€µEÐfQ

TryItOnline

All test cases also at TryItOnline

Returns a list containing one list containing the odd one out.

How?

⁹R2*‘ṡ5ḟ@€µEÐfQ - Main link, a (list)
⁹               - literal 256 (saving a byte over literal 30)
 R              - range, [1,2,3,...]
  2*            - 2 ** x, [2,4,8,...]
    ‘           - increment, [3,5,9,...]
     ṡ5         - all contiguous slices of length 5
       ḟ@€      - filter with reversed arguments for each
          µ     - monadic chain separation
            Ðf  - filter on condition:
           E    - all equal (those previously filtered lists with only one value)
              Q - unique (there can be two, but both will have the same odd-one-out)


答:
05AB1E, <s>32</s> <s>30</s> <s>26</s> <s>24</s> 20 bytes

```<code>30Lo>Œ5ùv¹yvyK}Dgi`q
</code>```

Explanation

```<code>30Lo>    # list containing the sequence [3 .. 1073741825]
Œ5ù      # all sequence sublists of length 5
v        # for each such list
 ¹yvyK}  # remove it's elements from input
 Dgi     # if the remaining list has length 1
    `q   # end the program and print the final list flattened
</code>```

Try it online!

Title: Find the odd one out in a sequence

Body:
The Challenge:

Consider the function F(N) = 2^N + 1 where N is a positive integer less than 31. The sequence defined by this function is:

```<code>3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825
</code>```

An input will be generated as follows:

Take 5 contiguous integers from the above sequence.

Replace one of them with a different, positive integer (which may or may not be part of the above sequence).

Optionally reorder the the 5 resulting numbers.

Given such a list of 5 integers, find the one that was swapped in and is therefore not part of the original 5 contiguous integers.

Example:

Original sublist: 5, 9, 17, 33, 65.

Replace one: 5, 7, 17, 33, 65.

Reorder: 33, 17, 5, 7, 65.

The expected output would be 7.

The 5 values in the input will always be distinct and there will always be a unique solution. (For instance, you won't have to deal with inputs like 3, 9, 17, 33, 129 where either 3 or 129 might have been swapped in.)

Test Cases:

```<code>5,9,17,33,829
o/p: 829

9,5,17,829,33
o/p: 829

33, 17, 5, 7, 65
o/p: 7

5,9,177,33,65
o/p: 177

65,129,259,513,1025
o/p: 259

129,259,513,1025,65
o/p: 259

63,129,257,513,1025
o/p: 63

65,129,257,513,4097
o/p: 4097

5, 9, 2, 17, 33
o/p: 2

536870913, 67108865, 1073741825, 1, 268435457
o/p: 1
</code>```

Body:
05AB1E, <s>32</s> <s>30</s> <s>26</s> <s>24</s> 20 bytes

30Lo>Œ5ùv¹yvyK}Dgi`q

Explanation

30Lo>    # list containing the sequence [3 .. 1073741825]
Œ5ù      # all sequence sublists of length 5
v        # for each such list
 ¹yvyK}  # remove it's elements from input
 Dgi     # if the remaining list has length 1
    `q   # end the program and print the final list flattened

Try it online!


问:
Build a nest
The challenge is simple: write a program or function that, when given a finite non-negative integer, outputs a nested array.

The rules

Your code must produce a unique valid nested array for every integer 0 ≤ n < 231.

Every possible nested array with up to 16 open brackets must be outputted within this range. (This does not mean that your code can never output a nested array with more than 16 open brackets.)

Your code may output a string representation of the nested array instead of an actual array (with or without commas).

One possible mapping:

```<code>0 -> []
1 -> [[]]
2 -> [[[]]]
3 -> [[], []]
4 -> [[[[]]]]
5 -> [[[], []]]
6 -> [[[]], []]
7 -> [[], [[]]]
8 -> [[], [], []]
9 -> [[[[[]]]]]
etc.
</code>```

Scoring

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

答:
Python 3, <s>120</s> 114 bytes

def f(n,k=0):
 while~n:
  k+=1
  try:r=eval(bin(k).translate({48:'],',49:'['})[3:-1])+[];n-=1
  except:0
 print(r)
```

Test it on Ideone.

How it works

The defined function f takes input n and initializes k to 0. We'll keep incrementing k until n + 1 values of k result in a valid output. Every time we find such a value of k, n is decremented once it reaches -1, ~n yields 0, and the list r that corresponds to the last value of k is printed.

The partial mapping from the positive integers to nested lists (i.e., k ↦ r) has to be bijective, but there are no other constraints. The one used in this answer operates as follows.

Convert k to a binary string representation, staring with 0b.

For example, 44 ↦ "0b101100".

Replace all 0's (code point 48) in the string representation with the string "]," and all 1's (code point 49) with [.

For example, "0b101100" ↦ "],b[],[[],],".

Remove the first three characters (they correspond to "0b") and the trailing character (hopefully a comma).

For example, "],b[],[[],]," ↦ "[],[[],]".

Try evaluating the generated code. If this results in an error, k isn't mapped to any list.

For example, "[],[[],]" ↦ ([], [[]]).

Concatenate the result (if any) with the empty list. If this results in an error, k isn't mapped to any list.

For example, ([], [[]]) + [] errors since + cannot concatenate lists and tuples.

Title: Build a nest

Body:
Python 3, <s>120</s> 114 bytes

def f(n,k=0):
 while~n:
  k+=1
  try:r=eval(bin(k).translate({48:'],',49:'['})[3:-1])+[];n-=1
  except:0
 print(r)

Test it on Ideone.

How it works

The defined function f takes input n and initializes k to 0. We'll keep incrementing k until n + 1 values of k result in a valid output. Every time we find such a value of k, n is decremented once it reaches -1, ~n yields 0, and the list r that corresponds to the last value of k is printed.

The partial mapping from the positive integers to nested lists (i.e., k ↦ r) has to be bijective, but there are no other constraints. The one used in this answer operates as follows.

Convert k to a binary string representation, staring with 0b.

For example, 44 ↦ "0b101100".

Replace all 0's (code point 48) in the string representation with the string "]," and all 1's (code point 49) with [.

For example, "0b101100" ↦ "],b[],[[],],".

Remove the first three characters (they correspond to "0b") and the trailing character (hopefully a comma).

For example, "],b[],[[],]," ↦ "[],[[],]".

Try evaluating the generated code. If this results in an error, k isn't mapped to any list.

For example, "[],[[],]" ↦ ([], [[]]).

Concatenate the result (if any) with the empty list. If this results in an error, k isn't mapped to any list.

For example, ([], [[]]) + [] errors since + cannot concatenate lists and tuples.


问:
Find the center
Given a string of ASCII characters, output the character that is in the middle. If there is no middle character (when the string has an even length), output the ASCII character whose ordinal is the floored average of the two center characters. If the string is empty, an empty string should be output.

Test cases:

```<code>12345 => 3

Hello => l

Hiya => q

(empty input) => (empty output)
</code>```

Shortest program in characters wins. (Not bytes.)

Leaderboard

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

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

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

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

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

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

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

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

```<code>## [><>](http://esolangs.org/wiki/Fish), 121 characters
</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

```

答:
C#, 77 bytes

```<code>s=>{int n=s.Length;return n<1?' ':(char)(n%2>0?s[n/2]:(s[n/2-1]+s[n/2])/2);};
</code>```

It doesn't actually return a string, and you'll get a space character if the input string is empty because the function must always return a value. 2 more bytes would be needed to return a string.

Full program with test cases:

```<code>using System;

namespace FindTheCenter
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string,char>f= s=>{int n=s.Length;return n<1?' ':(char)(n%2>0?s[n/2]:(s[n/2-1]+s[n/2])/2);};   //77 bytes
            Console.WriteLine(f(""));
            Console.WriteLine(f("Hello"));
            Console.WriteLine(f("Hiya"));
        }
    }
}
</code>```

Alternatively, a full program which reads user input and prints the center of the entered string:

C#,  144 bytes

```<code>using C=System.Console;class P{static void Main(){var s=C.ReadLine();int n=s.Length;C.Write(n<1?' ':(char)(n%2>0?s[n/2]:(s[n/2-1]+s[n/2])/2));}}
</code>```

Again, it uses the same trick of printing a space character, which the user will not notice, and not an empty string, otherwise the solution is 2 bytes longer.

Title: Find the center

Body:
C#, 77 bytes

s=>{int n=s.Length;return n<1?' ':(char)(n%2>0?s[n/2]:(s[n/2-1]+s[n/2])/2);};

It doesn't actually return a string, and you'll get a space character if the input string is empty because the function must always return a value. 2 more bytes would be needed to return a string.

Full program with test cases:

using System;

namespace FindTheCenter
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string,char>f= s=>{int n=s.Length;return n<1?' ':(char)(n%2>0?s[n/2]:(s[n/2-1]+s[n/2])/2);};   //77 bytes
            Console.WriteLine(f(""));
            Console.WriteLine(f("Hello"));
            Console.WriteLine(f("Hiya"));
        }
    }
}

Alternatively, a full program which reads user input and prints the center of the entered string:

C#,  144 bytes

using C=System.Console;class P{static void Main(){var s=C.ReadLine();int n=s.Length;C.Write(n<1?' ':(char)(n%2>0?s[n/2]:(s[n/2-1]+s[n/2])/2));}}

Again, it uses the same trick of printing a space character, which the user will not notice, and not an empty string, otherwise the solution is 2 bytes longer.


问:
Output a string's cumulative slope

Challenge

Given a string such as Hello World!, break it down into its character values: 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33.

Then calculate the difference between each consecutive pair of characters: 29, 7, 0, 3, -79, 55, 24, 3, -6, -8, -67.

Finally, sum them and print the final result: -39.

Rules

Standard loopholes apply

No using pre-made functions that perform this exact task

Creative solutions encouraged

Have fun

This is marked as code-golf, the shortest answer in bytes wins but will not be selected.

答:
Pyke, 5 bytes

```<code>m.o$s
</code>```

Try it here!

```<code>m.o   -   map(ord, input)
   $  -  delta(^)
    s - sum(^)
</code>```

Title: Output a string's cumulative slope

Body:
Pyke, 5 bytes

m.o$s

Try it here!

m.o   -   map(ord, input)
   $  -  delta(^)
    s - sum(^)


答:
Vim,  <s>38</s> <s>24</s> 23 keystrokes

Because vim has a built in function to find the middle line but not the middle  char, we split every character on a separate line first using substitute, find the middle line, then delete everything after and before it.

```<code>:s/\./\0\r/g<cr>ddMjdGkdgg
</code>```

If you want to run this, beware of .vimrc files which may change the behavior of . (magic regex) and g (gdefault). Note that it actually saves me 3 keystrokes on my machine :)

Previous answer

```<code>:exe 'norm '.(virtcol('$')/2).'|d^ld$'
</code>```

Takes a one line buffer as input, updates the current buffer with the middle character. I thought there would have been a shortcut for this in vim!

Note: a potentially shorter solution seems to cause an infinite loop... If someone has an idea: qq^x$x@qq@qp (12 keystrokes) -  it works with <c-c> after the last @q...

Title: Find the center

Body:
Given a string of ASCII characters, output the character that is in the middle. If there is no middle character (when the string has an even length), output the ASCII character whose ordinal is the floored average of the two center characters. If the string is empty, an empty string should be output.

Test cases:

```<code>12345 => 3

Hello => l

Hiya => q

(empty input) => (empty output)
</code>```

Shortest program in characters wins. (Not bytes.)

Leaderboard

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

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

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

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

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

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

Body:
Vim,  <s>38</s> <s>24</s> 23 keystrokes

Because vim has a built in function to find the middle line but not the middle  char, we split every character on a separate line first using substitute, find the middle line, then delete everything after and before it.

:s/\./\0\r/g<cr>ddMjdGkdgg

If you want to run this, beware of .vimrc files which may change the behavior of . (magic regex) and g (gdefault). Note that it actually saves me 3 keystrokes on my machine :)

Previous answer

:exe 'norm '.(virtcol('$')/2).'|d^ld$'

Takes a one line buffer as input, updates the current buffer with the middle character. I thought there would have been a shortcut for this in vim!

Note: a potentially shorter solution seems to cause an infinite loop... If someone has an idea: qq^x$x@qq@qp (12 keystrokes) -  it works with <c-c> after the last @q...


问:
Compute the Carmichael function

Task description

In number theory, the Carmichael function λ takes a positive integer n and returns the least positive integer k so that the k-th power of each integer coprime to n equals 1 modulo n.

Given a positive integer n, your solution must compute λ(n). The shortest code in bytes wins.

Your program should theoretically work for arbitrarily large inputs, but doesn’t need to be efficient.

Tips

The sequence of all λ(n) is OEIS A002322.

An ungolfed Python implementation would look like

```<code>from fractions import gcd

def carmichael(n):
    coprimes = [x for x in range(1, n) if gcd(x, n) == 1]
    k = 1
    while not all(pow(x, k, n) == 1 for x in coprimes):
        k += 1
    return k
</code>```

(In Python, pow(A, B, C) efficiently computes pow(A, B) % C.)

Test cases

```<code>Input    Output
1        1
2        1
3        2
10       4
35       12
101      100
530      52
3010     84
6511     3056
10000    500
</code>```

答:
Java, <s>165 163 158 152</s> 143 bytes

```<code>int l(int n){int k=1,x,a,b,t,d=1;for(;d>0;)for(d=x=0;++x<n;d=a<2&t>1?k++:d){for(a=x,b=n;b>0;b=a%b,a=t)t=b;for(t=b=1;b++<=k;t=t*x%n);}return k;}
</code>```

Another port of my C implementation.

Try it on Ideone

Title: Compute the Carmichael function

Body:
Java, <s>165 163 158 152</s> 143 bytes

int l(int n){int k=1,x,a,b,t,d=1;for(;d>0;)for(d=x=0;++x<n;d=a<2&t>1?k++:d){for(a=x,b=n;b>0;b=a%b,a=t)t=b;for(t=b=1;b++<=k;t=t*x%n);}return k;}

Another port of my C implementation.

Try it on Ideone


Title: Find the odd one out in a sequence

Body:
Racket 198 bytes

(λ(m)(let((l(for/list((i(range 1 31)))(+ 1(expt 2 i))))(r 1)(n(length m)))(for((i(-(length l)n)))(let
((o(for/list((j m)#:unless(member j(take(drop l i)n)))j)))(when(eq?(length o)1)(set! r o))))r))

Ungolfed version:

(define f
  (λ(m)
    (let ((l (for/list ((i (range 1 31)))
               (+ 1 (expt 2 i))))
          (res 1)
          (n (length m)))
      (for ((i (- (length l) n)))
        (let ((o (for/list ((j m)
                             #:unless (member j
                                             (take (drop l i) n)))
                    j)))
          (when (eq? (length o) 1)
            (set! res o))))
      res)))

Testing:

(f '(5 9 17 33 829))
(f '(9 5 17 829 33))
(f '(5 9 177 33 65))
(f '(65 129 259 513 1025))
(f '(129 259 513 1025 65))
(f '(63 129 257 513 1025))
(f '(65 129 257 513 4097))

Output:

'(829)
'(829)
'(177)
'(259)
'(259)
'(63)
'(4097)


答:
Python, 84 bytes

def f(a,i=0):s=set(a)-{2**j+1for j in range(i,i+5)};return len(s)<2and s or f(a,i+1)
```

All test cases are at ideone

For valid input returns a set containing only the odd-one-out.

For invalid input the recursion limit will be reached and an error will be thrown.

Title: Find the odd one out in a sequence

Body:
Python, 84 bytes

def f(a,i=0):s=set(a)-{2**j+1for j in range(i,i+5)};return len(s)<2and s or f(a,i+1)

All test cases are at ideone

For valid input returns a set containing only the odd-one-out.

For invalid input the recursion limit will be reached and an error will be thrown.


答:
Java 7,85 bytes

```<code>int f(int[]a,int l){int i=1;for(;i<l;)if(a[i++-1]*2-1!=a[i])return a[i];return a[0];}
</code>```

Ungolfed

```<code>int f(int[]a,int l){
    int i=1;
    for(;i<l;)
    if(a[i++-1]*2-1!=a[i])
    return a[i];
   return a[0];

}
</code>```

Title: Find the odd one out in a sequence

Body:
Java 7,85 bytes

int f(int[]a,int l){int i=1;for(;i<l;)if(a[i++-1]*2-1!=a[i])return a[i];return a[0];}

Ungolfed

int f(int[]a,int l){
    int i=1;
    for(;i<l;)
    if(a[i++-1]*2-1!=a[i])
    return a[i];
   return a[0];

}


问:
ASCII Odd/Even Cipher
We'll define the ASCII Odd/Even Cipher via the below pseudocode:

```<code>Define 'neighbor' as the characters adjacent to the current letter in the string

If the one of the neighbors is out of bounds of the string, treat it as \0 or null

Take an input string

For each letter in the string, do
  If the 0-based index of the current letter is even, then
    Use the binary-or of the ASCII codes of both its neighbors
  Else
    If the ASCII code of the current letter is odd, then
      Use the binary-or of itself plus the left neighbor
    Else
      Use the binary-or of itself plus the right neighbor
  In all cases,
    Convert the result back to ASCII and return it
  If this would result in a code point 127 or greater to be converted, then
    Instead return a space

Join the results of the For loop back into one string and output it
</code>```

For example, for input Hello, the output is emmol, since

The H turns to \0 | 'e' which is e

The e turns to 'e' | 'l', or 101 | 108, which is 109 or m

The first l also turns to 101 | 108 or m

The second l turns to 108 | 111, which is 111 or o

The o turns to 108 | \0, or l

Input

A sentence composed solely of printable ASCII characters, in any suitable format.

The sentence may have periods, spaces, and other punctuation, but will only ever be one line.

The sentence will be at least three characters in length.

Output

The resulting cipher, based on the rules described above, returned as a string or output.

The Rules

Either a full program or a function are acceptable.

Standard loopholes are forbidden.

This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples

Input on one line, output on the following. Blank lines separate examples.

```<code>Hello
emmol

Hello, World!
emmol, ww~ved

PPCG
PSWG

Programming Puzzles and Code Golf
r wogsmmoonpuu ~ meannncoooeggonl

abcdefghijklmnopqrstuvwxyz
bcfefgnijknmno~qrsvuvw~yzz

!abcdefghijklmnopqrstuvwxyz
aaccgeggoikkomoo qsswuww yy

Test 123 with odd characters. R@*SKA0z8d862
euutu133www|todddchizsscguwssr`jS{SK{z~|v66
</code>```

Title: ASCII Odd/Even Cipher

Body:
PHP, <s>107</s> 97 bytes

probably golfable.

for(;$i<strlen($s=$argv[1]);$i++)echo chr(ord($s[$i-1+$i%2])|ord($s[$i+1-2*($i&ord($s[$i])&1)]));


问:
Generate a pronounceable word
The challenge is simple:

generate a word.

Specifications:

Word must be pronounceable.

This is defined as "alternating between a consonant and a vowel."

A consonant is one of the following letters: bcdfghjklmnpqrstvwxz

A vowel is one of the following letters: aeiouy

Word must be randomly generated.

Words must be able to contain every consonant and vowel. (You can't just use bcdf for consonants and aei for vowels.)

Word must contain 10 letters.

Shortest code (in character count) wins.

答:
R, 83 bytes

```<code>cat(outer((l<-letters)[a<-c(1,5,9,15,21,25)],l[-a],paste0)[sample(1:120,5)],sep="")
</code>```

Generate all possible vowel-consonant sequences in a matrix, then randomly sample 5 of them, yielding a 10-letter word.

Title: Generate a pronounceable word

Body:
R, 83 bytes

cat(outer((l<-letters)[a<-c(1,5,9,15,21,25)],l[-a],paste0)[sample(1:120,5)],sep="")

Generate all possible vowel-consonant sequences in a matrix, then randomly sample 5 of them, yielding a 10-letter word.


问:
IPv4 Integer Conversion Function
Write the shortest function to convert an IP address into it's integer representation and output it as an integer.

To change an IPv4 address to it's integer representation, the following calculation is required:

Break the IP address into it's four octets.

(Octet1 * 16777216) + (Octet2 * 65536) + (Octet3 * 256) + (Octet4)

Sample Input

```<code>192.168.1.1           10.10.104.36           8.8.8.8
</code>```

Sample Output

```<code>3232235777            168454180              134744072
</code>```

答:
PHP (no builtins/eval) - 54

```<code><foreach(explode(".",$argv[1])as$b)$a=@$a<<8|$b;echo$a;
</code>```

ContentLicense: CC BY-SA 2.5

Title: IPv4 Integer Conversion Function

Body:
PHP (no builtins/eval) - 54

<foreach(explode(".",$argv[1])as$b)$a=@$a<<8|$b;echo$a;


问:
i love yOu i lOve you i love yOu!
XKCD #99, with the title "Binary Heart" shows a simple image of ones and zeros, with some digits colored red.

The red heart is visible to the naked eye, but the message hidden in the binary sequence is not. If you remove all the spaces and newlines and interpret the binary sequence as 8 bit ASCII-code, you'll end up with the message:

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

Cute right?

Pssst... The string isn't a pure string repetition.

Your challenge is to create this binary image with 21 digits across, and 23 digits down. There should be exactly one space between each digit in each row, and one newline for each new row. Note that the last bits are only the beginning of the letter e, since 21*23 isn't divisible by 8. You need those bits correct too.

The function or program should not take any input. Leading and trailing spaces and newlines are accepted.

The result of your code should look like this:

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

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

Leaderboard

var QUESTION_ID=94699,OVERRIDE_USER=31516;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

```

答:
05AB1E, <s>77</s> <s>54</s> <s>53</s> <s>44</s> <s>43</s> 41 bytes

Uses CP-1252 encoding.

```<code>’i„Î€î’8×•1žä¿*•S·£™J¦'iìÇb0ìJ011JSðý42ô»
</code>```

Explanation

```<code>’i„Î€î’   # the string "iloveyou"
8×        # repeated 8 times
•1žä¿*•   # the number 3262264221 encoded in base 214
S·        # split to list and multiplied by 2, gives [6, 4, 12, 4, 4, 12, 8, 4, 4, 2]
£         # split the "iloveyou..." string into chunks of these lengths
™J        # title-case the chunks and join, giving the string with capitalized O's
¦'iì      # replace the faulty capitalized "I" in the beginning with a lower case "i"
Ç         # convert to list of ascii values
b0ì       # convert each to binary and prepend a 0 to each binary string
J011J     # join the strings and append "011"
Sðý       # add a space between each digit
42ô       # split in pieces of 42 (21 digits, 21 spaces)
»         # merge on newline
</code>```

Try it online!

ContentLicense: CC BY-SA 4.0

Title: i love yOu i lOve you i love yOu!

Body:
05AB1E, <s>77</s> <s>54</s> <s>53</s> <s>44</s> <s>43</s> 41 bytes

Uses CP-1252 encoding.

’i„Î€î’8×•1žä¿*•S·£™J¦'iìÇb0ìJ011JSðý42ô»

Explanation

’i„Î€î’   # the string "iloveyou"
8×        # repeated 8 times
•1žä¿*•   # the number 3262264221 encoded in base 214
S·        # split to list and multiplied by 2, gives [6, 4, 12, 4, 4, 12, 8, 4, 4, 2]
£         # split the "iloveyou..." string into chunks of these lengths
™J        # title-case the chunks and join, giving the string with capitalized O's
¦'iì      # replace the faulty capitalized "I" in the beginning with a lower case "i"
Ç         # convert to list of ascii values
b0ì       # convert each to binary and prepend a 0 to each binary string
J011J     # join the strings and append "011"
Sðý       # add a space between each digit
42ô       # split in pieces of 42 (21 digits, 21 spaces)
»         # merge on newline

Try it online!


问:
Progruzzle & Colf
Ever fancied creating cool twitter hashtags such as #brexit or #brangelina? this golf is for you.

Write a program that accepts two strings A & B as input and merges them according to the following algorithm:

let n be the number of vowels groups in A (e.g. britain has 2 vowels groups : i in position 3 and ai in position 5).

if n = 1 : truncate A starting at its first vowel group position (example: bill => b)

if n > 1 : truncate A starting at its n-1th vowel group position (example: programming => progr, britain => br)

remove all consonants at the beginning of B (jennifer =>
ennifer)

concatenate the modified A & B

Vowels are aeiou; consonants are bcdfghjklmnpqrstvwxyz.

Input

You can assume the input strings are lowercase and contain at least one vowel and one consonant.

Examples

```<code>brad + angelina      => brangelina
britain + exit       => brexit
ben + jennifer       => bennifer
brangelina + exit    => brangelexit
bill + hillary       => billary
angelina + brad      => angelad
programming + puzzle => progruzzle
code + golf          => colf
out + go             => o
</code>```

答:
Lithp, 65 bytes

```<code>#X::((replace X (regex "([aeiou]+[^aeiou]*){1,2} [^aeiou]*") ""))
</code>```

This is basically a port of the JavaScript answer above, in my Lisp-ish functional programming language.

Example usage:

```<code>(
    % Note, you can define this as a function, or assign it to a variable
    % and use the call function instead.
    (def f #X::((replace X (regex "([aeiou]+[^aeiou]*){1,2} [^aeiou]*") "")))
    (print (f "programming puzzle"))
)
</code>```

No online interpreter yet. I'll provide one soon. It won't be difficult, my language is written in JavaScript.

Instead, this puzzle solution is implemented as a working example for my language. It can be run with the following command:

```<code>node run.js l_src/progruzzle-colf.lithp
</code>```

Title: Progruzzle & Colf

Body:
Lithp, 65 bytes

#X::((replace X (regex "([aeiou]+[^aeiou]*){1,2} [^aeiou]*") ""))

This is basically a port of the JavaScript answer above, in my Lisp-ish functional programming language.

Example usage:

(
    % Note, you can define this as a function, or assign it to a variable
    % and use the call function instead.
    (def f #X::((replace X (regex "([aeiou]+[^aeiou]*){1,2} [^aeiou]*") "")))
    (print (f "programming puzzle"))
)

No online interpreter yet. I'll provide one soon. It won't be difficult, my language is written in JavaScript.

Instead, this puzzle solution is implemented as a working example for my language. It can be run with the following command:

node run.js l_src/progruzzle-colf.lithp


答:
Jelly, <s>41 40 35</s> 33 bytes

Thanks to @Dennis for making the end ṖṖCG! (complement C = 1-x in place of logical not ¬ )

```<code>“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFs21ṖṖCG
</code>```

TryItOnline

How?

```<code>“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFs21ṖṖCG - Main link: no arguments
“ƝƓỊ⁹Ȥ⁶Ị⁺‘                        - code page indexes [150,147,176,137,154,134,176,138]
                                        (bitwise negated values of ordinals of "ilOveyOu")
          ẋ8                      - repeat eight times
            _                     - subtract
                     ¦            - apply to indexes
             “¤ÐŒ#'/‘             - code page indexes [3,15,19,35,39,47]
                                        (the indexes of the lowercase Os)
                      32          - literal 32 (subtracting 32 from the bitwise negated
                                                'O's makes them bitwise negated 'o's)
                        B         - binary (all are 8 bits, hence the negation)
                         F        - flatten list
                          s21     - split into slices of length 21
                             ṖṖ   - pop (remove the last two slices)
                               C  - complement (transform the bits to what they should be)
                                G - format as a grid
                                        (inserts both the spaces and line feeds)
</code>```

"Colour" version, 77 bytes

```<code>“¤Ɓ¥J¬ ¥ƲėNėR½5ðḃḍCṬ’b19‘“Y^‘jĖŒṙḂ
“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFż¢Ḅị“¹0°1”s21ṖṖG
</code>```

TryItOnline

Jelly has no colour output, but this is much easier for me to see anyway (I am colour blind)...

```<code>° ¹ ¹ ° ¹ ° ° ¹ ° ¹ ¹ ° ¹ ¹ ° ° ° ¹ ¹ ° ¹
¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ ¹ ° ° ¹ ¹ ° ° ¹ ° ¹ ° ¹
¹ ¹ ¹ ° ° ¹ ° ¹ ° ° ¹ ¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ °
¹ ° ¹ ¹ ° ¹ ° ° ¹ ° ¹ ¹ ° ¹ ¹ ° ° ° ¹ ° °
¹ ¹ ¹ ¹ ° 1 1 1 ° ¹ ¹ ° ° 1 1 0 ° ¹ ° ¹ °
¹ ¹ ¹ 1 0 0 1 0 1 1 ° 1 1 1 1 0 1 1 ¹ ° ¹
° ¹ ° 1 1 0 1 0 0 1 ° 1 1 0 1 1 0 0 ° ¹ ¹
° ¹ ¹ 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 ° ¹
° ¹ 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 ¹ °
¹ ° 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 ° ¹
° ° ¹ 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 ¹ °
¹ ° ¹ 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 ¹ ¹ ¹
° ¹ ° ¹ 0 1 1 0 1 0 0 1 0 1 1 0 ¹ ¹ ° ° °
¹ ¹ ° ¹ ¹ 1 1 0 1 1 1 0 1 1 0 0 ¹ ¹ ° ° ¹
° ¹ ° ¹ ¹ ¹ 1 0 0 1 0 1 1 0 1 ¹ ¹ ¹ ° ¹ ¹
¹ ° ¹ ° ¹ ° ¹ 1 0 1 0 0 1 0 ¹ ¹ ° ¹ ¹ ° °
° ¹ ° ° ¹ ¹ ¹ ¹ 0 1 1 1 0 ¹ ¹ ° ° ¹ ¹ ° °
¹ ° ¹ ° ¹ ¹ ¹ ¹ ° 0 1 0 ¹ ¹ ° ¹ ¹ ¹ ¹ ° ¹
¹ ¹ ° ¹ ° ¹ ° ¹ ¹ ° 1 ° ° ¹ ° ¹ ¹ ° ¹ ¹ °
° ° ¹ ° ° ¹ ¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ ¹ ° ° ¹ ¹ °
° ¹ ° ¹ ° ¹ ¹ ¹ ¹ ° ° ¹ ° ¹ ° ° ¹ ¹ ¹ ¹ °
¹ ¹ ¹ ° ¹ ° ¹ ° ¹ ¹ ° ¹ ° ° ¹ ° ¹ ¹ ° ¹ ¹
° ° ° ¹ ° ° ¹ ¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ ¹ ° ° ¹ ¹
</code>```

How?

```<code>“¤Ɓ¥J¬ ¥ƲėNėR½5ðḃḍCṬ’b19‘“Y^‘jĖŒṙḂ - Link 1: no arguments
“¤Ɓ¥J¬ ¥ƲėNėR½5ðḃḍCṬ’              - base 250 of a big number
                     b19           - convert to base 19, yields a list of integers
                        ‘          - increment those numbers
                         “Y^‘      - get code page indexes [89,94]
                             j     - join: [89,3,5,3,8, ... ,3,19,1,94]
                                         - {left-right, top-bottom} runs of colours
                              Ė    - enumerate [[1,89],[2,3],[3,5],[4,3],[5,8], ...]
                               Œṙ  - run-length decode [89 1s, 3 2s, 5 3s, 3 4s, 8 5s, ...]
                                 Ḃ - mod 2

“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFż¢Ḅị“¹0°1”s21ṖṖG - Main link: no arguments
“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BF                 - same as the original to get 1s and 0s
                          ż                - zip with
                           ¢               - last link (1) as a nilad
                            Ḅ              - binary to integer (vectorises)
                             ị             - index into
                              “¹0°1”       - string "¹0°1"
                                    s21    - split into length 21 slices
                                       ṖṖ  - pop last two unused slices
                                         G - format as a grid
</code>```

Title: i love yOu i lOve you i love yOu!

Body:
XKCD #99, with the title "Binary Heart" shows a simple image of ones and zeros, with some digits colored red.

The red heart is visible to the naked eye, but the message hidden in the binary sequence is not. If you remove all the spaces and newlines and interpret the binary sequence as 8 bit ASCII-code, you'll end up with the message:

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

Cute right?

Pssst... The string isn't a pure string repetition.

Your challenge is to create this binary image with 21 digits across, and 23 digits down. There should be exactly one space between each digit in each row, and one newline for each new row. Note that the last bits are only the beginning of the letter e, since 21*23 isn't divisible by 8. You need those bits correct too.

The function or program should not take any input. Leading and trailing spaces and newlines are accepted.

The result of your code should look like this:

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

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

Leaderboard

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

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

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

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

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

```

Body:
Jelly, <s>41 40 35</s> 33 bytes

Thanks to @Dennis for making the end ṖṖCG! (complement C = 1-x in place of logical not ¬ )

“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFs21ṖṖCG

TryItOnline

How?

“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFs21ṖṖCG - Main link: no arguments
“ƝƓỊ⁹Ȥ⁶Ị⁺‘                        - code page indexes [150,147,176,137,154,134,176,138]
                                        (bitwise negated values of ordinals of "ilOveyOu")
          ẋ8                      - repeat eight times
            _                     - subtract
                     ¦            - apply to indexes
             “¤ÐŒ#'/‘             - code page indexes [3,15,19,35,39,47]
                                        (the indexes of the lowercase Os)
                      32          - literal 32 (subtracting 32 from the bitwise negated
                                                'O's makes them bitwise negated 'o's)
                        B         - binary (all are 8 bits, hence the negation)
                         F        - flatten list
                          s21     - split into slices of length 21
                             ṖṖ   - pop (remove the last two slices)
                               C  - complement (transform the bits to what they should be)
                                G - format as a grid
                                        (inserts both the spaces and line feeds)

"Colour" version, 77 bytes

“¤Ɓ¥J¬ ¥ƲėNėR½5ðḃḍCṬ’b19‘“Y^‘jĖŒṙḂ
“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFż¢Ḅị“¹0°1”s21ṖṖG

TryItOnline

Jelly has no colour output, but this is much easier for me to see anyway (I am colour blind)...

° ¹ ¹ ° ¹ ° ° ¹ ° ¹ ¹ ° ¹ ¹ ° ° ° ¹ ¹ ° ¹
¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ ¹ ° ° ¹ ¹ ° ° ¹ ° ¹ ° ¹
¹ ¹ ¹ ° ° ¹ ° ¹ ° ° ¹ ¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ °
¹ ° ¹ ¹ ° ¹ ° ° ¹ ° ¹ ¹ ° ¹ ¹ ° ° ° ¹ ° °
¹ ¹ ¹ ¹ ° 1 1 1 ° ¹ ¹ ° ° 1 1 0 ° ¹ ° ¹ °
¹ ¹ ¹ 1 0 0 1 0 1 1 ° 1 1 1 1 0 1 1 ¹ ° ¹
° ¹ ° 1 1 0 1 0 0 1 ° 1 1 0 1 1 0 0 ° ¹ ¹
° ¹ ¹ 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 ° ¹
° ¹ 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 ¹ °
¹ ° 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 ° ¹
° ° ¹ 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 ¹ °
¹ ° ¹ 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 ¹ ¹ ¹
° ¹ ° ¹ 0 1 1 0 1 0 0 1 0 1 1 0 ¹ ¹ ° ° °
¹ ¹ ° ¹ ¹ 1 1 0 1 1 1 0 1 1 0 0 ¹ ¹ ° ° ¹
° ¹ ° ¹ ¹ ¹ 1 0 0 1 0 1 1 0 1 ¹ ¹ ¹ ° ¹ ¹
¹ ° ¹ ° ¹ ° ¹ 1 0 1 0 0 1 0 ¹ ¹ ° ¹ ¹ ° °
° ¹ ° ° ¹ ¹ ¹ ¹ 0 1 1 1 0 ¹ ¹ ° ° ¹ ¹ ° °
¹ ° ¹ ° ¹ ¹ ¹ ¹ ° 0 1 0 ¹ ¹ ° ¹ ¹ ¹ ¹ ° ¹
¹ ¹ ° ¹ ° ¹ ° ¹ ¹ ° 1 ° ° ¹ ° ¹ ¹ ° ¹ ¹ °
° ° ¹ ° ° ¹ ¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ ¹ ° ° ¹ ¹ °
° ¹ ° ¹ ° ¹ ¹ ¹ ¹ ° ° ¹ ° ¹ ° ° ¹ ¹ ¹ ¹ °
¹ ¹ ¹ ° ¹ ° ¹ ° ¹ ¹ ° ¹ ° ° ¹ ° ¹ ¹ ° ¹ ¹
° ° ° ¹ ° ° ¹ ¹ ¹ ¹ ° ¹ ¹ ¹ ° ¹ ¹ ° ° ¹ ¹

How?

“¤Ɓ¥J¬ ¥ƲėNėR½5ðḃḍCṬ’b19‘“Y^‘jĖŒṙḂ - Link 1: no arguments
“¤Ɓ¥J¬ ¥ƲėNėR½5ðḃḍCṬ’              - base 250 of a big number
                     b19           - convert to base 19, yields a list of integers
                        ‘          - increment those numbers
                         “Y^‘      - get code page indexes [89,94]
                             j     - join: [89,3,5,3,8, ... ,3,19,1,94]
                                         - {left-right, top-bottom} runs of colours
                              Ė    - enumerate [[1,89],[2,3],[3,5],[4,3],[5,8], ...]
                               Œṙ  - run-length decode [89 1s, 3 2s, 5 3s, 3 4s, 8 5s, ...]
                                 Ḃ - mod 2

“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BFż¢Ḅị“¹0°1”s21ṖṖG - Main link: no arguments
“ƝƓỊ⁹Ȥ⁶Ị⁺‘ẋ8_“¤ÐŒ#'/‘¦32BF                 - same as the original to get 1s and 0s
                          ż                - zip with
                           ¢               - last link (1) as a nilad
                            Ḅ              - binary to integer (vectorises)
                             ị             - index into
                              “¹0°1”       - string "¹0°1"
                                    s21    - split into length 21 slices
                                       ṖṖ  - pop last two unused slices
                                         G - format as a grid


答:
Java 7, 152 bytes

```<code>String c(String s){char[]a=s.toCharArray();int l=a.length,x,y;return l<2?s:""+(l%2>0?a[l/2]:(char)((x=a[l/2])>(y=a[(l/2)-1])?y+((x-y)/2):x+((y-x)/2)));}
</code>```

Ungolfed & test cases:

Try it here.

```<code>class M{
  static String c(String s){
    char[] a = s.toCharArray();
    int l = a.length,
            x,
            y;
    return l < 2
            ? s
            : "" + (l%2 > 0
                     ? a[l/2]
                     : (char)((x = a[l/2]) > (y = a[(l/2)-1])
                                ? y + ((x-y)/2)
                                : x + ((y-x)/2)));
  }

  public static void main(String[] a){
    System.out.println(c("12345"));
    System.out.println(c("Hello"));
    System.out.println(c("Hiya"));
    System.out.println(c(""));
    System.out.println(c("x")); // Additional test case that will fail on some other answers
  }
}
</code>```

Output:

```<code>3
l
q
(empty output)
x
</code>```

Title: Find the center

Body:
Java 7, 152 bytes

String c(String s){char[]a=s.toCharArray();int l=a.length,x,y;return l<2?s:""+(l%2>0?a[l/2]:(char)((x=a[l/2])>(y=a[(l/2)-1])?y+((x-y)/2):x+((y-x)/2)));}

Ungolfed & test cases:

Try it here.

class M{
  static String c(String s){
    char[] a = s.toCharArray();
    int l = a.length,
            x,
            y;
    return l < 2
            ? s
            : "" + (l%2 > 0
                     ? a[l/2]
                     : (char)((x = a[l/2]) > (y = a[(l/2)-1])
                                ? y + ((x-y)/2)
                                : x + ((y-x)/2)));
  }

  public static void main(String[] a){
    System.out.println(c("12345"));
    System.out.println(c("Hello"));
    System.out.println(c("Hiya"));
    System.out.println(c(""));
    System.out.println(c("x")); // Additional test case that will fail on some other answers
  }
}

Output:

3
l
q
(empty output)
x


答:
JavaScript (ES6), <s>169</s> ... <s>136</s> 135 bytes

let f =

_=>"0213021203131214".replace(x=/./g,v=>0+[a=1768714102,a-8192,a-=66265089,a+8192,3][v].toString(2)).replace(x,(c,i)=>`
`[+!(i%21)]+c)

console.log(f());```
</div>
</div>
</p>
<p><em>Saved 2 bytes thanks to Andrakis</em><br />
<em>Saved 4 bytes thanks to Hedi</em><br />
<em>Saved <s>3</s> 5 bytes thanks to Neil</em></p>
<h2>Colored version, 249 bytes (237 bytes of JS + 12 bytes of CSS)</h2>
<p>The JS code outputs the ASCII art with bold tags for the heart. 12 bytes of CSS are required to colorize in red. (Is that byte count fair?)</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>let f =

_=>"0213021203131214".replace(x=/./g,v=>0+[a=1768714102,a-8192,a-=66265089,a+8192,3][v].toString(2)).replace(x,(c,i)=>`
`[+!(y=i/21|0,x=i%21)]+([57568,a=261112,a,b=524280,b+4,b+4,b,a+1024,65520][y-4]&1<<x|y>12&x>y-9&x<29-y?c.bold():c))

document.getElementById("o").innerHTML = f();</code>```

b{color:red}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><pre id="o">``````

Title: i love yOu i lOve you i love yOu!

Body:
JavaScript (ES6), <s>169</s> ... <s>136</s> 135 bytes

let f =

_=>"0213021203131214".replace(x=/./g,v=>0+[a=1768714102,a-8192,a-=66265089,a+8192,3][v].toString(2)).replace(x,(c,i)=>`
`[+!(i%21)]+c)

console.log(f());

Saved 2 bytes thanks to Andrakis

Saved 4 bytes thanks to Hedi

Saved <s>3</s> 5 bytes thanks to Neil

Colored version, 249 bytes (237 bytes of JS + 12 bytes of CSS)

The JS code outputs the ASCII art with bold tags for the heart. 12 bytes of CSS are required to colorize in red. (Is that byte count fair?)

let f =

_=>"0213021203131214".replace(x=/./g,v=>0+[a=1768714102,a-8192,a-=66265089,a+8192,3][v].toString(2)).replace(x,(c,i)=>`
`[+!(y=i/21|0,x=i%21)]+([57568,a=261112,a,b=524280,b+4,b+4,b,a+1024,65520][y-4]&1<<x|y>12&x>y-9&x<29-y?c.bold():c))

document.getElementById("o").innerHTML = f();

b{color:red}

<pre id="o"></pre>


答:
Actually, 58 bytes

```<code>73*8╙:13542├`≈"÷≥"E`M"«%s₧ªn%s6û"7*%"♠n≥6û"+¿├`' +`M╪♂Σ♂Ri
</code>```

Try it online!

Explanation

There are three main parts here, so I'm going to break it down accordingly.

Part 1: Constructing the base-256 string

We're actually going to construct the binary string reversed, to take advantage of Actually's stack-based (LIFO) structure and to avoid complications with leading zeros in the binary string. Thus, the target binary string is 110011011101111001000110110100101101010111011110010100111101010011001101110111100100011011010010110101011101111011010011110101001100110111011110010001101101001011010101110111101101001111010100110011011101111011000110110100101101010111011110010100111101010011001101110111100100011011010010110101011101111001010011110101001100110111011110110001101101001011010101110111101101001111010100110011011101111001000110110100101101010111011110010100111101010011001101110111101100011011010010110, which is equivalent to 20083405242288679348048842451418880256193335738939042905519679590571514414673488599852759703515507690399267425671627412178904636115120346432419478 in decimal. In base-256 (using the CP437 character table for conversion), the corresponding string is ♠n≥6û«≥₧ªn≥6û«÷₧ªn≥6û«÷₧ªn÷6û«≥₧ªn≥6û«≥₧ªn÷6û«÷₧ªn≥6û«≥₧ªn÷6û. To construct the original binary string, we construct the base-256 string (taking advantage of the pattern in it), and perform base conversions to decimal and binary.

The base-256 string has the following format (spaces and newlines added for clarity):

```<code>♠n≥6û
« (either ≥ or ÷) ₧ªn (either ≥ or ÷) 6û
  (7 times)
</code>```

Thus, each of the 7 middle sections can be formed by using the scaffold «%s₧ªn%s6û and replacing the %s parts with either ≥ or ÷.

The specific sequence of ≥s and ÷s we need is ≥≥÷≥÷÷≥≥≥÷÷≥≥÷. Since we need this as a list of length-1 strings, the naïve way of representing this would be "≥≥÷≥÷÷≥≥≥÷÷≥≥÷"# (push the string, make it into a list). However, we can do slightly better. By interpreting that string as a binary number (where ≥ represents 1 and ÷ represents 0), we get 13542 in decimal. By converting this back to binary (using the traditional 1s and 0s), and indexing into a length-2 string, we can get the list using one less byte than the naïve method.

```<code>:13542├`≈"÷≥"E`M"«%s₧ªn%s6û"7*%"♠n≥6û"+
:13542├                                  push 13542, convert to binary
       `≈"÷≥"E`M                         for each bit:
        ≈                                  convert to integer (from string)
         "÷≥"E                             index into "÷≥"
                "«%s₧ªn%s6û"7*           push the scaffold for the middle section
                              %          old-style Python string formatting to fill in the scaffold
                               "♠n≥6û"+  prepend the beginning piece
</code>```

Part 2: Converting to binary

This part is much more straightforward. If Actually had the capability to directly convert base-256 to binary, we'd use that. Unfortunately, it doesn't, so we'll have to use decimal as an intermediary format.

The , in the following code represents the code from Part 1 - for explanatory purposes, I've replaced the Part 1 code with , to read the output from Part 1 from STDIN. It is not part of the actual final code.

```<code>8╙,¿├
  ,    Part 1 result
8╙ ¿   convert from base-256 to decimal
    ├  convert to binary
</code>```

Part 3: Formatting

If the challenge was to merely output the binary string as-is, we'd be done. However, we still have some formatting to do to get the binary string into a 21 x 23 rectangle.

As in Part 2, the , represents the output from the previous part, and is not part of the actual code.

```<code>73*,`' +`M╪♂Σ♂Ri
   ,              output from Part 2
    `' o`M        insert a space after every character
73*       ╪       chunk into 21 pieces
           ♂Σ     concatenate each piece
             ♂R   reverse each piece
               i  flatten
                  (implicitly print)
</code>```

For those keeping track at home, this is the equivalent Python 3 code (481 bytes):

print('\n'.join([''.join(' '+c for c in bin(sum('\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xa0'.index(c)*256**i for i,c in enumerate(("♠n≥6û"+("«%s₧ªn%s6û"*7)%tuple("÷≥"[int(b)]for b in bin(13542)[2:]))[::-1])))[2:])[i*42:-~i*42][::-1]for i in range(23)][::-1]))
```

Title: i love yOu i lOve you i love yOu!

Body:
Actually, 58 bytes

73*8╙:13542├`≈"÷≥"E`M"«%s₧ªn%s6û"7*%"♠n≥6û"+¿├`' +`M╪♂Σ♂Ri

Try it online!

Explanation

There are three main parts here, so I'm going to break it down accordingly.

Part 1: Constructing the base-256 string

We're actually going to construct the binary string reversed, to take advantage of Actually's stack-based (LIFO) structure and to avoid complications with leading zeros in the binary string. Thus, the target binary string is 110011011101111001000110110100101101010111011110010100111101010011001101110111100100011011010010110101011101111011010011110101001100110111011110010001101101001011010101110111101101001111010100110011011101111011000110110100101101010111011110010100111101010011001101110111100100011011010010110101011101111001010011110101001100110111011110110001101101001011010101110111101101001111010100110011011101111001000110110100101101010111011110010100111101010011001101110111101100011011010010110, which is equivalent to 20083405242288679348048842451418880256193335738939042905519679590571514414673488599852759703515507690399267425671627412178904636115120346432419478 in decimal. In base-256 (using the CP437 character table for conversion), the corresponding string is ♠n≥6û«≥₧ªn≥6û«÷₧ªn≥6û«÷₧ªn÷6û«≥₧ªn≥6û«≥₧ªn÷6û«÷₧ªn≥6û«≥₧ªn÷6û. To construct the original binary string, we construct the base-256 string (taking advantage of the pattern in it), and perform base conversions to decimal and binary.

The base-256 string has the following format (spaces and newlines added for clarity):

♠n≥6û
« (either ≥ or ÷) ₧ªn (either ≥ or ÷) 6û
  (7 times)

Thus, each of the 7 middle sections can be formed by using the scaffold «%s₧ªn%s6û and replacing the %s parts with either ≥ or ÷.

The specific sequence of ≥s and ÷s we need is ≥≥÷≥÷÷≥≥≥÷÷≥≥÷. Since we need this as a list of length-1 strings, the naïve way of representing this would be "≥≥÷≥÷÷≥≥≥÷÷≥≥÷"# (push the string, make it into a list). However, we can do slightly better. By interpreting that string as a binary number (where ≥ represents 1 and ÷ represents 0), we get 13542 in decimal. By converting this back to binary (using the traditional 1s and 0s), and indexing into a length-2 string, we can get the list using one less byte than the naïve method.

:13542├`≈"÷≥"E`M"«%s₧ªn%s6û"7*%"♠n≥6û"+
:13542├                                  push 13542, convert to binary
       `≈"÷≥"E`M                         for each bit:
        ≈                                  convert to integer (from string)
         "÷≥"E                             index into "÷≥"
                "«%s₧ªn%s6û"7*           push the scaffold for the middle section
                              %          old-style Python string formatting to fill in the scaffold
                               "♠n≥6û"+  prepend the beginning piece

Part 2: Converting to binary

This part is much more straightforward. If Actually had the capability to directly convert base-256 to binary, we'd use that. Unfortunately, it doesn't, so we'll have to use decimal as an intermediary format.

The , in the following code represents the code from Part 1 - for explanatory purposes, I've replaced the Part 1 code with , to read the output from Part 1 from STDIN. It is not part of the actual final code.

8╙,¿├
  ,    Part 1 result
8╙ ¿   convert from base-256 to decimal
    ├  convert to binary

<a href="http://actually.tryitonline.net/#code=NzMqLGAnICtgTeKVquKZgs6j4pmCUmk&input=IjExMDAxMTAxMTEwMTExMTAwMTAwMDExMDExMDEwMDEwMTEwMTAxMDExMTAxMTExMDAxMDEwMDExMTEwMTAxMDAxMTAwMTEwMTExMDExMTEwMDEwMDAxMTAxMTAxMDAxMDExMDEwMTAxMTEwMTExMTAxMTAxMDAxMTExMDEwMTAwMTEwMDExMDExMTAxMTExMDAxMDAwMTEwMTEwMTAwMTAxMTAxMDEwMTExMDExMTEwMTEwMTAwMTExMTAxMDEwMDExMDAxMTAxMTEwMTExMTAxMTAwMDExMDExMDEwMDEwMTEwMTAxMDExMTAxMTExMDAxMDEwMDExMTEwMTAxMDAxMTAwMTEwMTExMDExMTEwMDEwMDAxMTAxMTAxMDAxMDExMDEwMTAxMTEwMTExMTAwMTAxMDAxMTExMDEwMTAwMTEwMDExMDExMTAxMTExMDExMDAwMTEwMTEwMTAwMTAxMTAxMDEwMTExMDExMTEwMTEwMTAwMTExMTAxMDEwMDExMDAxMTAxMTEwMTExMTAwMTAwMDExMDExMDEwMDEwMTEwMTAxMDExMTAxMTExMDAxMDEwMDExMTEwMTAxMDAxMTAwMTEwMTExMDExMTEwMTEwMDAxMTAxMTAxMDAxMDExMCI" rel="noreferrer">Part 3: Formatting

If the challenge was to merely output the binary string as-is, we'd be done. However, we still have some formatting to do to get the binary string into a 21 x 23 rectangle.

As in Part 2, the , represents the output from the previous part, and is not part of the actual code.

73*,`' +`M╪♂Σ♂Ri
   ,              output from Part 2
    `' o`M        insert a space after every character
73*       ╪       chunk into 21 pieces
           ♂Σ     concatenate each piece
             ♂R   reverse each piece
               i  flatten
                  (implicitly print)

For those keeping track at home, this is the equivalent Python 3 code (481 bytes):

print('\n'.join([''.join(' '+c for c in bin(sum('\x00☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xa0'.index(c)*256**i for i,c in enumerate(("♠n≥6û"+("«%s₧ªn%s6û"*7)%tuple("÷≥"[int(b)]for b in bin(13542)[2:]))[::-1])))[2:])[i*42:-~i*42][::-1]for i in range(23)][::-1]))


答:
CJam, 48 bytes

```<code>19560Yb"Oo"f="uilvey"8*3/.\s:i2fb0a*7>21/W<Sf*N*
</code>```

Collaboration with @MartinEnder, who took off a tricky 3 bytes with the "uilvey"3/ string. Online interpreter.

```<code>19560Yb        Convert 19560 to base 2
"Oo"f=         Index each bit into the string "Oo" to give "ooooOOooOOOooOoOOO"
"uilvey"8*3/   Repeat the string "uilvey" 8 times then split into chunks of 3
.\s            Vectorised swap (insert the Os into the right places) then stringify
:i2fb          Convert each char to int then take base 2
0a*            Join with 0s
7>             Remove the first 7 bits
21/            Split into chunks of length 21
W<             Drop the last row
Sf*            Join each row with spaces
N*             Join the rows with newlines
</code>```

Title: i love yOu i lOve you i love yOu!

Body:
CJam, 48 bytes

19560Yb"Oo"f="uilvey"8*3/.\s:i2fb0a*7>21/W<Sf*N*

Collaboration with @MartinEnder, who took off a tricky 3 bytes with the "uilvey"3/ string. Online interpreter.

19560Yb        Convert 19560 to base 2
"Oo"f=         Index each bit into the string "Oo" to give "ooooOOooOOOooOoOOO"
"uilvey"8*3/   Repeat the string "uilvey" 8 times then split into chunks of 3
.\s            Vectorised swap (insert the Os into the right places) then stringify
:i2fb          Convert each char to int then take base 2
0a*            Join with 0s
7>             Remove the first 7 bits
21/            Split into chunks of length 21
W<             Drop the last row
Sf*            Join each row with spaces
N*             Join the rows with newlines


答:
MATL, <s>56</s> 55 bytes

```<code>'!?u<TgGU*lB7SE1q3s.?Su(q6)iM'F'eilovyOu'Za8&B!FTTv21e!
</code>```

Try it Online

Explanation

```<code>'!?u<TgGU*lB7SE1q3s.?Su(q6)iM'      % Previously compressed version of the string
F'eilovyOu'Za                       % Decompress this string
8&B                                 % Convert each char to 8-bit binary number
!                                   % Transpose the result
FTTv                                % Append [0 1 1] to the end to take care of
                                    % the partial "e" bits
21e!                                % Reshape it into the appropriate shape
                                    % Implicitly display the result
</code>```

Title: i love yOu i lOve you i love yOu!

Body:
MATL, <s>56</s> 55 bytes

'!?u<TgGU*lB7SE1q3s.?Su(q6)iM'F'eilovyOu'Za8&B!FTTv21e!

Try it Online

Explanation

'!?u<TgGU*lB7SE1q3s.?Su(q6)iM'      % Previously compressed version of the string
F'eilovyOu'Za                       % Decompress this string
8&B                                 % Convert each char to 8-bit binary number
!                                   % Transpose the result
FTTv                                % Append [0 1 1] to the end to take care of
                                    % the partial "e" bits
21e!                                % Reshape it into the appropriate shape
                                    % Implicitly display the result


答:
Javascript ES6 REPL, <s>124</s> <s>121</s> <s>119</s> 113 bytes

Saved 6 bytes thanks to @ETHproductions

This is a full program which can be pasted in the REPL/console to produce the correct result.

```<code>for(i=r='';i<483;)r+=(`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8)>>7-i%8&1)+(++i%21?` `:`
`)
</code>```

f=

_=>{for(i=0,r='';i<483;)r+=(`il${"Oo"[21>>(a=i/64)&1]}vey${"oO"[77>>a&1]}u`.charCodeAt(i/8%8)>>7-i%8&1)+(++i%21==0?`
`:` `);return r}

a.innerHTML = f()```
<pre class="snippet-code-html lang-html prettyprint-override"><code><pre id=a></code>```

More verbose

```<code>for (i=0, r='';                         // r == the result
     i < 483;)                          // 483 == 21 * 23
r+= (                                   // construct "iloveyou"
        `il${                           // il
            "Oo"[21 >> (a = i/64) & 1]  // position in the loop defines the o or O
         }vey${                         // vey
            "oO"[77 >> a & 1]           // position in the loop defines the o or O
         }u`                            // u
        .charCodeAt(                    // "i" == 105 == 01101001
            i / 8 % 8                   // find the correct bit to append
        ) >> 7-i%8 & 1                  // shift it to select 1 or 0
    )
+                                       // add a space or newline
    (
        ++i%21 == 0 ? `
` : ` `                                 // every 21 characters add a new line,
                                           otherwise a space
    )
;                                       // Javascript implicitly returns the last value
                                           edited in a for loop
</code>```

Coloured JavaScript only heart, 281 bytes

```<code>for(i=z=r='',h=[],g=[90,...[...'353871767176G4H4H5G5F7CABB9D7F5H3J1'].map(n=>parseInt(n,20)),-1];i<483;)r+=`%c`+(`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8,--g[+z]||z++,h[i]=z%2)>>7-i%8&1)+(++i%21?` `:`
`);console.log(r,...h.map(H=>`color:${H?'red':'black'}`))
</code>```

This works by switching colours every n bits and makes use of the console.log ability to log colours

Coloured CSS Heart, 229+12 bytes

If using css is allowed, the coloured heart can be reduced even further to 229 bytes of JavaScript code and 12 bytes of CSS

```<code>for(i=z=r='',g=[90,...[...'353871767176G4H4H5G5F7CABB9D7F5H3J1'].map(n=>parseInt(n,20)),-1];C=`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8,--g[+z]||z++)>>7-i%8&1,i++<483;)r+=(z%2?(''+C).bold():C)+(i%21?` `:`
`)
</code>```

let f =

    _=>{for(i=z=r='',g=[90,...[...'353871767176G4H4H5G5F7CABB9D7F5H3J1'].map(n=>parseInt(n,20)),-1];C=`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8,--g[+z]||z++)>>7-i%8&1,i++<483;)r+=(z%2?(''+C).bold():C)+(i%21?` `:`
`);return r}

document.getElementById("b").innerHTML = f();```
<pre class="snippet-code-css lang-css prettyprint-override"><code>b{color:red}</code>```

```

Title: i love yOu i lOve you i love yOu!

Body:
Javascript ES6 REPL, <s>124</s> <s>121</s> <s>119</s> 113 bytes

Saved 6 bytes thanks to @ETHproductions

This is a full program which can be pasted in the REPL/console to produce the correct result.

for(i=r='';i<483;)r+=(`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8)>>7-i%8&1)+(++i%21?` `:`
`)

f=

_=>{for(i=0,r='';i<483;)r+=(`il${"Oo"[21>>(a=i/64)&1]}vey${"oO"[77>>a&1]}u`.charCodeAt(i/8%8)>>7-i%8&1)+(++i%21==0?`
`:` `);return r}

a.innerHTML = f()

<pre id=a>

More verbose

for (i=0, r='';                         // r == the result
     i < 483;)                          // 483 == 21 * 23
r+= (                                   // construct "iloveyou"
        `il${                           // il
            "Oo"[21 >> (a = i/64) & 1]  // position in the loop defines the o or O
         }vey${                         // vey
            "oO"[77 >> a & 1]           // position in the loop defines the o or O
         }u`                            // u
        .charCodeAt(                    // "i" == 105 == 01101001
            i / 8 % 8                   // find the correct bit to append
        ) >> 7-i%8 & 1                  // shift it to select 1 or 0
    )
+                                       // add a space or newline
    (
        ++i%21 == 0 ? `
` : ` `                                 // every 21 characters add a new line,
                                           otherwise a space
    )
;                                       // Javascript implicitly returns the last value
                                           edited in a for loop

Coloured JavaScript only heart, 281 bytes

for(i=z=r='',h=[],g=[90,...[...'353871767176G4H4H5G5F7CABB9D7F5H3J1'].map(n=>parseInt(n,20)),-1];i<483;)r+=`%c`+(`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8,--g[+z]||z++,h[i]=z%2)>>7-i%8&1)+(++i%21?` `:`
`);console.log(r,...h.map(H=>`color:${H?'red':'black'}`))

This works by switching colours every n bits and makes use of the console.log ability to log colours

Coloured CSS Heart, 229+12 bytes

If using css is allowed, the coloured heart can be reduced even further to 229 bytes of JavaScript code and 12 bytes of CSS

for(i=z=r='',g=[90,...[...'353871767176G4H4H5G5F7CABB9D7F5H3J1'].map(n=>parseInt(n,20)),-1];C=`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8,--g[+z]||z++)>>7-i%8&1,i++<483;)r+=(z%2?(''+C).bold():C)+(i%21?` `:`
`)

let f =

    _=>{for(i=z=r='',g=[90,...[...'353871767176G4H4H5G5F7CABB9D7F5H3J1'].map(n=>parseInt(n,20)),-1];C=`il${"Oo"[21>>i/64&1]}vey${"oO"[77>>i/64&1]}u`.charCodeAt(i/8%8,--g[+z]||z++)>>7-i%8&1,i++<483;)r+=(z%2?(''+C).bold():C)+(i%21?` `:`
`);return r}

document.getElementById("b").innerHTML = f();

b{color:red}

<pre id="b">


答:
PHP, 76 Bytes

implemented Titus idea with the mod 5

```<code><?for(;count($x=array_diff($_GET[a],$r))-1;$r[++$i%5]=2**$i+1);echo end($x);
</code>```

126 Bytes before

```<code><?for(;$x=array_diff($_GET[a],array_map(function($z){return 2**$z+1;},range(++$i,$i+4)));)if(count($x)<2){echo end($x);break;}
</code>```

Title: Find the odd one out in a sequence

Body:
The Challenge:

Consider the function F(N) = 2^N + 1 where N is a positive integer less than 31. The sequence defined by this function is:

```<code>3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825
</code>```

An input will be generated as follows:

Take 5 contiguous integers from the above sequence.

Replace one of them with a different, positive integer (which may or may not be part of the above sequence).

Optionally reorder the the 5 resulting numbers.

Given such a list of 5 integers, find the one that was swapped in and is therefore not part of the original 5 contiguous integers.

Example:

Original sublist: 5, 9, 17, 33, 65.

Replace one: 5, 7, 17, 33, 65.

Reorder: 33, 17, 5, 7, 65.

The expected output would be 7.

The 5 values in the input will always be distinct and there will always be a unique solution. (For instance, you won't have to deal with inputs like 3, 9, 17, 33, 129 where either 3 or 129 might have been swapped in.)

Test Cases:

```<code>5,9,17,33,829
o/p: 829

9,5,17,829,33
o/p: 829

33, 17, 5, 7, 65
o/p: 7

5,9,177,33,65
o/p: 177

65,129,259,513,1025
o/p: 259

129,259,513,1025,65
o/p: 259

63,129,257,513,1025
o/p: 63

65,129,257,513,4097
o/p: 4097

5, 9, 2, 17, 33
o/p: 2

536870913, 67108865, 1073741825, 1, 268435457
o/p: 1
</code>```

Body:
PHP, 76 Bytes

implemented Titus idea with the mod 5

<?for(;count($x=array_diff($_GET[a],$r))-1;$r[++$i%5]=2**$i+1);echo end($x);

126 Bytes before

<?for(;$x=array_diff($_GET[a],array_map(function($z){return 2**$z+1;},range(++$i,$i+4)));)if(count($x)<2){echo end($x);break;}


答:
PHP, <s>147</s> 93 bytes

Credits and special thanks to Jörg Hülsermann for golfing my answer 54 bytes down!

```<code><?=($l=strlen($s=$argv[1]))%2?$s[($l-1)/2]:chr(floor((ord($s[$l/2])+ord($s[$l/2-1]))/2));
</code>```

Previous version:

```<code>$s=$argv[1];$l=strlen($s);echo($l%2!=0?substr($s,$n=($l-1)/2,-$n):chr(floor(abs((ord($x=substr($s,$l/2-1,1))-ord(substr($s,$l/2,1)))/2))+ord($x)));
</code>```

Testing code:

```<code>$argv[1] = 'Hiya';
$s=$argv[1];
$l=strlen($s);
echo($l%2!=0?substr($s,$n=($l-1)/2,-$n):chr(floor(abs((ord($x=substr($s,$l/2-1,1))-ord(substr($s,$l/2,1)))/2))+ord($x)));
</code>```

Test online

<s>I have the feeling that this can be improved, but not enough time for it...</s>

Title: Find the center

Body:
Given a string of ASCII characters, output the character that is in the middle. If there is no middle character (when the string has an even length), output the ASCII character whose ordinal is the floored average of the two center characters. If the string is empty, an empty string should be output.

Test cases:

```<code>12345 => 3

Hello => l

Hiya => q

(empty input) => (empty output)
</code>```

Shortest program in characters wins. (Not bytes.)

Leaderboard

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

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

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

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

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

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

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

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

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

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

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

```

Body:
PHP, <s>147</s> 93 bytes

Credits and special thanks to Jörg Hülsermann for golfing my answer 54 bytes down!

<?=($l=strlen($s=$argv[1]))%2?$s[($l-1)/2]:chr(floor((ord($s[$l/2])+ord($s[$l/2-1]))/2));

Previous version:

$s=$argv[1];$l=strlen($s);echo($l%2!=0?substr($s,$n=($l-1)/2,-$n):chr(floor(abs((ord($x=substr($s,$l/2-1,1))-ord(substr($s,$l/2,1)))/2))+ord($x)));

Testing code:

$argv[1] = 'Hiya';
$s=$argv[1];
$l=strlen($s);
echo($l%2!=0?substr($s,$n=($l-1)/2,-$n):chr(floor(abs((ord($x=substr($s,$l/2-1,1))-ord(substr($s,$l/2,1)))/2))+ord($x)));

Test online

<s>I have the feeling that this can be improved, but not enough time for it...</s>


答:
PowerShell v2+, (UTF-16) 300 bytes

Corrected erroneous byte count thanks to @Mego

```<code>'ږƍ໬ƕ๓ƺ֥˄ϝӊ༭ǝ֥ţϝɥޔǮ૒ƱϝĲ˲ӷʴ˘ͻ֙ץŻ઴Ŭɻˌʼֽ͖ҶɻŦʼʞݖɛĽƳ'-split'(..)'-ne''|%{(-join($_[0,1]|%{[convert]::ToString(+$_,2)})).PadLeft(21,'0')-replace'(.)','$1 '}
</code>```

Not the shortest, but a different approach. I manually took each line and sliced them into pairs each (roughly) 9-11 significant bits in length. Converted each of those binary values to a char (Note: PowerShell uses UTF-16 by default, not UTF-8), and mushed that into a string. That's the '...' at the beginning.

We then -split that into strings of length 2, and loop through each pair. Those pairs are split into a char-array via $_[0,1], and each of those are cast as an int +$_, and [convert]ed into a binary (,2) String. That's -joined together into a single string, then PadLeft'd to get the proper length, then each element is -replaced with itself and a space '$1 '.

Those strings are all left on the pipeline, and output is implicit, with the default Write-Output sticking a newline between elements.

```<code>PS C:\Tools\Scripts\golfing> 'ږƍ໬ƕ๓ƺ֥˄ϝӊ༭ǝ֥ţϝɥޔǮ૒ƱϝĲ˲ӷʴ˘ͻ֙ץŻ઴Ŭɻˌʼֽ͖ҶɻŦʼʞݖɛĽƳ'-split'(..)'-ne''|%{(-join($_[0,1]|%{[convert]::ToString(+$_,2)})).PadLeft(21,'0')-replace'(.)','$1 '}
0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1
1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 0 1
1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0 1 0
1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 0 0
1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 0
1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 1 1 0 1
0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1
0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1
0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0
1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1
0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0
1 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 1
0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0
1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1
0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 1
1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0
0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0
1 0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1
1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0
0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0
0 1 0 1 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0
1 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1
0 0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1
</code>```

Title: i love yOu i lOve you i love yOu!

Body:
PowerShell v2+, (UTF-16) 300 bytes

Corrected erroneous byte count thanks to @Mego

'ږƍ໬ƕ๓ƺ֥˄ϝӊ༭ǝ֥ţϝɥޔǮ૒ƱϝĲ˲ӷʴ˘ͻ֙ץŻ઴Ŭɻˌʼֽ͖ҶɻŦʼʞݖɛĽƳ'-split'(..)'-ne''|%{(-join($_[0,1]|%{[convert]::ToString(+$_,2)})).PadLeft(21,'0')-replace'(.)','$1 '}

Not the shortest, but a different approach. I manually took each line and sliced them into pairs each (roughly) 9-11 significant bits in length. Converted each of those binary values to a char (Note: PowerShell uses UTF-16 by default, not UTF-8), and mushed that into a string. That's the '...' at the beginning.

We then -split that into strings of length 2, and loop through each pair. Those pairs are split into a char-array via $_[0,1], and each of those are cast as an int +$_, and [convert]ed into a binary (,2) String. That's -joined together into a single string, then PadLeft'd to get the proper length, then each element is -replaced with itself and a space '$1 '.

Those strings are all left on the pipeline, and output is implicit, with the default Write-Output sticking a newline between elements.

PS C:\Tools\Scripts\golfing> 'ږƍ໬ƕ๓ƺ֥˄ϝӊ༭ǝ֥ţϝɥޔǮ૒ƱϝĲ˲ӷʴ˘ͻ֙ץŻ઴Ŭɻˌʼֽ͖ҶɻŦʼʞݖɛĽƳ'-split'(..)'-ne''|%{(-join($_[0,1]|%{[convert]::ToString(+$_,2)})).PadLeft(21,'0')-replace'(.)','$1 '}
0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1
1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 0 1
1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0 1 0
1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 0 0
1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 0
1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 1 1 0 1
0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1
0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1
0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 1 0
1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1
0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1 0
1 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 1 1
0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0
1 1 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0 1
0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1 1
1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0
0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0 0
1 0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 0 1
1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1 0
0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1 0
0 1 0 1 0 1 1 1 1 0 0 1 0 1 0 0 1 1 1 1 0
1 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 1
0 0 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 0 1 1


Title: i love yOu i lOve you i love yOu!

Body:
///, 237 bytes

/2/\/\///3/0 24/1 25/0
26/1
27/4428/3329/772A/432B/A732C/937A782D/B48B72E/8A4892F/98B93/373A3A737837367A7A7878AA674E37A45D83A5C78A45F7A63D83463C78A639E3745AD8368C7845A9E3763AD8573C7863AF46AAD35348C735AAF673AD5848C753AA9E57AAB48B468348C41

Try it online!


答:
Haskell, <s>66</s> 64 bytes

```<code>g x=[s|n<-[1..],[s]<-[filter(`notElem`[2^m+1|m<-[n..n+4]])x]]!!0
</code>```

Usage example: g [65,129,257,513,4097] -> 4097.

Loops through all contiguous sublists of length 5 of F(N), keeps the elements that are not in the input list x and pattern matches those of length 1 (-> [s]).

Edit: @xnor saved two bytes by removing the upper bound of the outer loop. As a solution is guaranteed to exist, Haskell's laziness stops at the first number found.

Title: Find the odd one out in a sequence

Body:
Haskell, <s>66</s> 64 bytes

g x=[s|n<-[1..],[s]<-[filter(`notElem`[2^m+1|m<-[n..n+4]])x]]!!0

Usage example: g [65,129,257,513,4097] -> 4097.

Loops through all contiguous sublists of length 5 of F(N), keeps the elements that are not in the input list x and pattern matches those of length 1 (-> [s]).

Edit: @xnor saved two bytes by removing the upper bound of the outer loop. As a solution is guaranteed to exist, Haskell's laziness stops at the first number found.


问:
The Solitude of Prime Numbers
Recently I read the novel "The Solitude of Prime Numbers" where the main characters are somewhat compared to twin prime numbers ("always together, but never touching").

A twin prime is a prime number that is either \$\require{cancel}2\$ less or \$2\$ more than another prime number —for example, the twin prime pair \$(41, 43)\$. In other words, a twin prime is a prime that has a prime gap of two. Sometimes the term twin prime is used for a pair of twin primes; an alternative name for this is prime twin or prime pair. Wikipedia

Although I didn't like much the depressing novel, and since I have fallen into PPCG lately, that raised a question in my mind...

Task:

Given a positive integer number \$N > 4\$, find the lonely prime numbers (AKA isolated prime numbers) between the closest couples of twin primes.

Please note that in this case with the term lonely prime numbers, I mean all the prime numbers that are not twin primes and between couples of twin primes. That's why \$N > 4\$ because the first two couples of prime numbers are \$(3, 5)\$ and \$(5, 7)\$.

Example:

\$N = 90\$.

Find the first two couples of twin primes \$< N\$ and \$> N\$. They are: \$(71, 73)\$ and \$(101, 103)\$.

Find the lonely primes in the range \$> 73\$ and \$< 101\$.

They are: \$79, 83, 89, 97\$.

Special cases:

- If N is in between two twin prime numbers, find the closest couples of twin primes \$> N+1\$ and \$< N-1\$. Example: \$N=72\$, find the closest couples of twin primes \$> 73\$ and \$< 71\$ then exclude from the list \$71\$ and \$73\$ because they are not *lonely primes*. So for \$N = 72\$ the expected result is:  \$67, \cancel{71}, \cancel{73}, 79, 83, 89, 97\$
- If N belongs to a couple of twin primes, for example \$N = 73\$, the closest couples of twin primes are \$(71, 73)\$ and \$(101, 103)\$. If \$N = 71\$, the closest couples of twin primes are \$(59, 61)\$ and \$(71, 73)\$.

Test cases:

```<code>N = 70   >  Lonely primes are:  67
N = 71   >  Lonely primes are:  67
N = 72   >  Lonely primes are:  67, 79, 83, 89, 97 (not the twins 71 and 73)
N = 73   >  Lonely primes are:  79, 83, 89, 97
N = 90   >  Lonely primes are:  79, 83, 89, 97
N = 201  >  Lonely primes are:  211, 223
N = 499  >  Lonely primes are:  467, 479, 487, 491, 499, 503, 509
</code>```

Rules:

Write a full program or function that will take the number N from standard input.

Output the list of lonely primes in a readable format as csv, list, array, etc.

Shortest code wins.

Please include (when possible) a testable online fiddle.

答:
PowerShell v2+, <s>237</s> <s>149</s> <s>147</s> <s>231</s> <s>216</s> <s>181</s> <s>174</s> <s>169</s> 166 bytes

```<code>param($n)filter f($a){'1'*$a-match'^(?!(..+)\1+$)..'}for($i=$n;!((f $i)-and(f($i+2)))){$i++}for(){if(f(--$i)){if((f($i-2))-or(f($i+2))){if($i-lt$n-1){exit}}else{$i}}}
</code>```

Takes input $n. Defines a new function f as the regex prime function (here returning a Boolean if the input is a prime or not).

The next part sets $i to be equal to $n, then loops upward until we find the bottom half of our twin prime pair upper bound. E.g., for input 90, this stops at $i=101.

Then, we loop from the upper bound downward. I know, it looks like an infinite loop, but it'll eventually end.

If the current number is a prime (f(--$i)), but its +/- 2 isn't a prime, we add $i to the pipeline. However, if its +/- 2 is a prime, we check whether we're lower than $n-1 (i.e., to account for the situation when it's inside a twin prime pair), at which point we exit. At program completion, the pipeline is printed to screen via implicit Write-Output.

NB - Due to the looping structure, prints the primes in descending order. OP has clarified that's OK.

Examples

Output here is space-separated, as that's the default stringification method for an array.

```<code>PS C:\Tools\Scripts\golfing> 70,71,72,73,90,201,499,982|%{"$_ --> "+(.\the-solitude-of-prime-numbers.ps1 $_)}
70 --> 67
71 --> 67
72 --> 97 89 83 79 67
73 --> 97 89 83 79
90 --> 97 89 83 79
201 --> 223 211
499 --> 509 503 499 491 487 479 467
982 --> 1013 1009 997 991 983 977 971 967 953 947 941 937 929 919 911 907 887
</code>```

Title: The Solitude of Prime Numbers

Body:
PowerShell v2+, <s>237</s> <s>149</s> <s>147</s> <s>231</s> <s>216</s> <s>181</s> <s>174</s> <s>169</s> 166 bytes

param($n)filter f($a){'1'*$a-match'^(?!(..+)\1+$)..'}for($i=$n;!((f $i)-and(f($i+2)))){$i++}for(){if(f(--$i)){if((f($i-2))-or(f($i+2))){if($i-lt$n-1){exit}}else{$i}}}

Takes input $n. Defines a new function f as the regex prime function (here returning a Boolean if the input is a prime or not).

The next part sets $i to be equal to $n, then loops upward until we find the bottom half of our twin prime pair upper bound. E.g., for input 90, this stops at $i=101.

Then, we loop from the upper bound downward. I know, it looks like an infinite loop, but it'll eventually end.

If the current number is a prime (f(--$i)), but its +/- 2 isn't a prime, we add $i to the pipeline. However, if its +/- 2 is a prime, we check whether we're lower than $n-1 (i.e., to account for the situation when it's inside a twin prime pair), at which point we exit. At program completion, the pipeline is printed to screen via implicit Write-Output.

NB - Due to the looping structure, prints the primes in descending order. OP has clarified that's OK.

Examples

Output here is space-separated, as that's the default stringification method for an array.

PS C:\Tools\Scripts\golfing> 70,71,72,73,90,201,499,982|%{"$_ --> "+(.\the-solitude-of-prime-numbers.ps1 $_)}
70 --> 67
71 --> 67
72 --> 97 89 83 79 67
73 --> 97 89 83 79
90 --> 97 89 83 79
201 --> 223 211
499 --> 509 503 499 491 487 479 467
982 --> 1013 1009 997 991 983 977 971 967 953 947 941 937 929 919 911 907 887


答:
Pyth, 18 bytes

```<code>hhlD-LQ.:mh^2dSCd5
</code>```

Form the sequence, take sublists of length 5, Remove each sublist from Q, take the shortest result, output its only element.

Title: Find the odd one out in a sequence

Body:
Pyth, 18 bytes

hhlD-LQ.:mh^2dSCd5

Form the sequence, take sublists of length 5, Remove each sublist from Q, take the shortest result, output its only element.