text:
Output the Hebrew alphabet
Your task is to print this exact text:
אבגדהוזחטיכךלמםנןסעפףצץקרשת

(You are allowed to print a trailing newline)
SHA256 hash of the UTF-8 encoding of the text:
0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085

Base64 encoding:
15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq

Rules

You can't use a builtin outputting this text.
Standard loopholes are disallowed.
This is code-golf, so the shortest answer wins.

Good luck!

I noticed the code points are not directly in order. You have 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1499, 1498, 1500, 1502, 1501, 1504, 1503, 1505, 1506, 1508, 1507, 1510, 1509, 1511, 1512, 1513, 1514. I don't know very much about Hebrew, so could you confirm this is indeed intentional?

@DJMcMayhem I noticed that too, that's probably what makes the challenge a challenge.

@DJMcMayhem Unicode list final letters before normal letters but in the text in the question normal letters are listed before. It was not really intentional, but at least it encourage answers that are not as boring as print(map(chr, range(x, y)))

Because Hebrew is an RTL language, I'm not sure what the exact text is. Could you please post a base-64 encoding of the UTF-8 bytes or something equally unambiguous?

@PeterTaylor Done

אני מדבר עברית!

@OldBunny2800 גם אני :)

Hebrew is hard, I can't make the SHA256 hash match even with a text editor…

@TùxCräftîñg Seriously though, I think "me too"/"thanks"/etc. comments are not constructive.

Aleph null, aleph one, aleph 2, ...

A cryptographic hash allows checking whether the output string is correct, but if it isn't then it doesn't help to identify why not.

@Angs That's because it really doesn't match. echo 15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeq | base64 -d | sha256sum produces f1d4b9c12a197912a4bdb80fb3e4d3fad5a0d9b7edd243fae7b2ab3450618036.

@DJMcMayhem  I know some hebrew, I can explain that one..(and you can verify on charmap), some letters have 2 forms like in english every letter has two forms 'a' 'A'  'p' 'P' in hebrew only some do. . Unicode puts them adjacent, and the poster has put them the other way to how the unicode puts them. If you open charmap and enter 05d0 (the utf-16 code for the first letter), you see all the hebrew letters with their description e.g. kaf and final kaf or as unicode places them.  final kaf, and kaf..

Are trailing newlines allowed?

@TùxCräftîñg Well, when you say "print this exact text" and provide a hash and a base64-encoded version that don't include the newline, it's not particularly clear.

Downvoted for asking us to output "this exact text" when, in reality, it requires the outputting of slightly different text.

Is the hash and base64 encoding with or without the trailing newline?

איך הולך אחינו?

""<>Alphabet@"Hebrew" in Mathematica.

MATLAB, 52 51 bytes
[cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']

Example use:
>> [cumsum([1488 'CCCCCCCCCDADDAEADCDAEADCCC'-66]) '']
ans =
אבגדהוזחטיכךלמםנןסעפףצץקרשת

Explanation
'CCCCCCCCCDADDAEADCDAEADCCC'-66 produces the array [1 1 ... -1 2 1 1 1], which contains the consecutive differences between the codepoints of the desired characters.
[1488 ...] prepends 1488, so the array is now [1488 1 1 ... -1 2 1 1 1].
cumsum(...) computes the cumulative sum: [1488 1489 ... 1514].
[... ''] concatenates with the empty string. This has the effect of converting to char (and is one byte shorter than char(...))

Jelly, 22 21 20 bytes
27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ

Try it online!
Idea
If we subtract 1487 from each code point, we get the array R that follows.
1 2 3 4 5 6 7 8 9 10 12 11 13 15 14 17 16 18 19 21 20 23 22 24 25 26 27

That's just the range from 1 to 27, but not in ascending order; the pairs (11, 12), (14, 15), (16, 17), (20, 21), and (22, 23) have been swapped.
If we take the ascending range and add 2 to 11, 14, 16, 20, and 22, we get the array A that follows.
1 2 3 4 5 6 7 8 9 10 13 12 13 16 15 18 17 18 19 22 21 24 23 24 25 26 27

This is no longer a permutation of the range, but if we stably sort the range by the values in that array, we can reconstruct the original array.
Code
27R+“¿ÇÑÞæ‘¦2Ụ+1487Ọ  Main link. No arguments.

27R                   Yield [1, ..., 27].
           ¦          Conditional application:
    “¿ÇÑÞæ‘             At indices 11, 14, 16, 20, and 22...
   +        2           add 2 to the corresponding value.
                      This yields the array A from the previous section.
             Ụ        Grade up; sort the indices of the result by its corresponding
                      values. This yields the array R from the previous section.
              +1487   Add 1487 to each integer in R.
                   Ọ  Unordinal; convert integers to characters.

PowerShell v2+, 58 bytes (UTF-16)
'אבגדהוזחטיכךלמםנןסעפףצץקרשת'

PowerShell Unicode is UTF-16 unless explicitly specified otherwise, and then it's a crapshoot anyway since it's all UTF-16 in the background.
This just puts the literal string on the pipeline and the default Write-Output at the end of program execution prints it to screen.
The shortest I could get the ASCII version is 63
-join([char[]]'ABCDEFGHIJLKMONQPRSUTWVXYZ['|%{[char](1423+$_)})

Which takes the ASCII value of the string ABC... and adds 1423 to each char to get the appropriate string.

Upvoted only because your ASCII version is clever. Must... support... clever... golfing!

It took me at least 5 minutes to realise that it wasn't the actual alphabet in the ASCII version.

05AB1E, 36 29 26 25 23 bytes
Saved 2 bytes thanks to Adnan
Uses CP-1252 encoding.
1488•’ÉÇW–moû•5Bvy<+Dç?

Try it online!
Explanation
1488            # push 1488 (accumulator)
•’ÉÇW–moû•      # push 2235174277545950437
5B              # convert from base-5 to base-10 (122222222230330403230403222)
  v             # for each digit in above number
   y<           # decrease it by 1
     +          # add to accumulator
      Dç?       # print a copy of accumulator converted from code point

Interpreting the big number as a base 5 number saves two bytes: 1488•’ÉÇW–moû•5Bvy<+Dç?.

@Adnan: Ah of course. Great thinking!

Brain-Flak, 172 bytes
This answer is based largely one DJMcMayhem's solution here so I recomend you check it out.
Like DJMcMayhem's solution this uses the -rA flag to reverse output and print to unicode.
(((((()()()()()){})))<(((({}{}{}()){({}[()])}{})){}{})>){({}[()]<(({})())>)}{}(((((()()())((((((((({}(((({}())[()])()())()())[()]))[()])()())())()())[()]))[()])()())())())())

Try it online!
Explanation
I made this answer by running a bunch of micro-optimizations over the original solution provided by DJMcMayhem.  These optimizations while saving bytes, make the code unreadable and the algorithm obtuse.  I, to be honest, do not really understand how or what my code does.
Perhaps someday I will understand how this works...

Python 3, 50 bytes
#coding:cp862
print('אבגדהוזחטיכךלמםנןסעפףצץקרשת')

The file must be created using the CP862 encoding or by reversing the following hexdump.
0000000: 23 63 6f 64 69 6e 67 3a 63 70 38 36 32 0a 70 72  #coding:cp862.pr
0000010: 69 6e 74 28 27 80 81 82 83 84 85 86 87 88 89 8b  int('...........
0000020: 8a 8c 8e 8d 90 8f 91 92 94 93 96 95 97 98 99 9a  ................
0000030: 27 29                                            ')

This could probably be ported to Python 2 (thus saving two bytes), but I lack the proper locale to test it. Python 3 dutifully prints an UTF-8 encoded version (or whatever is appropriate for the current locale) of the alphabet.
Verification
$ base64 > hebrew.py -d <<< I2NvZGluZzpjcDg2MgpwcmludCgngIGCg4SFhoeIiYuKjI6NkI+RkpSTlpWXmJmaJyk=
$ wc -c hebrew.py
50 hebrew.py
$ echo $LANG
en_US.UTF-8
$ python3 hebrew.py
אבגדהוזחטיכךלמםנןסעפףצץקרשת

CJam, 23 bytes
27,"%(*.0"{i_)e\}/'אf+

Try it online!
How it works
27,                     Push [0 ... 26].
   "%(*.0"              Push that string. Its code points are [37 40 42 46 48],
                        which are [10 13 15 19 21] modulo the length of the string.
          {     }/      For each character:
           i              Compute its code point.
            _)            Push an incremented copy.
              e\          Swap the integers of [0 ... 26] at those indices.
                  'אf+  Add all resulting integers to the first character of the
                        Hebrew alphabet.

JavaScript (ES6), 59 bytes
_=>"אבגדהוזחטיכךלמםנןסעפףצץקרשת"

Best I could do in ASCII was 80 79 78 bytes:
_=>String.fromCharCode(...[...0x377babbcf7f.toString(3)].map(c=>++n-c,n=1488))

If a character array is acceptable, 75 bytes:
_=>[...0x377babbcf7f.toString(3)].map(c=>String.fromCharCode(++n-c),n=1488)

Edit: Saved some bytes thanks to @IsmaelMiguel. Saved another byte thanks to @ETHproductions. If you use Firefox 30-57 then you can save another 2 bytes thanks to @ETHproductions using generator or array comprehensions:
_=>String.fromCharCode(...(for(c of 0x377babbcf7f.toString(3,n=1488))++n-c))
_=>[for(c of 0x377babbcf7f.toString(3,n=1488))String.fromCharCode(++n-c)]

You can save a byte on your ASCII alternative by using 0x377BABBCF7F.toString(3). Combinig this with .map(), you can do _=>0x377BABBCF7F.toString(3,n=1488).split``.map(_=>String.fromCharCode(++n-_)) for 78 bytes. It returns an array of characters.

@IsmaelMiguel Nice catch on the .. but we don't use split around here.

Nice. You can modify the char-array version slightly to get _=>String.fromCharCode(...[...0x377babbcf7f.toString(3)].map(c=>++n-c,n=1488)), 1 byte shorter than the current 79 bytes.

@ETHproductions Bah, I had played around with String.fromCharCode(...) and had managed to convince myself that it would always be longer. In fact it saves 4 bytes on my base 2 solution (which is still 84 bytes because it takes more bytes to decode).

If you're willing to use array comprehensions, you can get 2 bytes off of each; string: _=>String.fromCharCode(...[for(c of 0x377babbcf7f.toString(3,n=1488))++n-c]), char-array: _=>[for(c of 0x377babbcf7f.toString(3,n=1488))String.fromCharCode(++n-c))

@ETHproductions Thanks, I've edited those in, but I changed the first to a generator comprehension because they're cooler ;-)

///, 27 bytes
ABCDEFGHIQSRTVUXWYbdcfeghiq

Try it online!
Output is encoded in CP424.
To verify it yourself:
$ echo ABCDEFGHIQSRTVUXWYbdcfeghiq | ./slashes.pl | python3 -c 'print(bytes(input(), "utf-8").decode("cp424"))' | base64
15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted16DXn9eh16LXpNej16bXpden16jXqdeqCg==

What kind of code is this? I think it needs to be converted to UTF-8 for viewing purposes anyways. Not that it is necessarily invalid :P have a +1

@EriktheGolfer There is no need to convert it to UTF-8. That is not a requirement anywhere in the challenge.

I think you might attract downvotes then. Please note that, in your place, I would have included the UTF-8 version and a hexdump of the original...

Brain-Flak, 186 bytes
(((((((((((((((((((((((((((((((((()()()()()){})){}{}()){({}[()])}{})){}{})())())())())())())())())())()())[()])()())()())[()])()()())[()])()())())()())[()])()()())[()])()())())())())

This code is 182 bytes long, and I added 4 bytes for two command line flags: -r and -u
Try it online!
Many thanks to @Neil for this awesome integer metagolfer that created this sweet way of pushing 1488 (the code point of the first character)
(((((((()()()()()){})){}{}()){({}[()])}{})){}{})

Explanation:
Pushing large number in brain-flak is relatively difficult. However, since the act of pushing a number also evaluates to that number, we can push several numbers at the same time for massive byte savings. Here is a more concrete example. The innermost part (that I wrote above) in psuedo code is
push(1488)

This expression evaluates to 1488, so we wrap the entire thing in another push statement:
push(push(1488) + 1)

This pushes 1488 and 1489, as well as evaluating to 1489. So we wrap this:
push(push(push(1488) + 1) + 1)

which pushes 1488, 1489, and 1490, as well as evaluating to 1490. Repeat this step for each number we need to push.
However, since the increments aren't always 1, it's a little bit more complicated than that. Here is a more readable version:
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
#Push 1488
(((((((()()()()()){})){}{}()){({}[()])}{})){}{})
())     # + 1
())
())
())
())
())
())
())
())
()())   # + 2
[()])   # - 1
()())   # + 2
()())
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
()())   # + 2
[()])   # - 1
()()()) # + 3
[()])   # - 1
()())   # + 2
())     # + 1
())
())

I thought it is +1 for -r because the - doesn't count

@NoOneIsHere - doesn't count if it is already present from a different option (e.g. in perl -e). Brain-Flak doesn't have an existing option like that, so -, the option, and the space after all count toward the total.

Just a little improvement I made http://brain-flak.tryitonline.net/#code=KCgoKCgoKCgpKCkoKSkoKCgoKCgoe30pKCgoKCgoKCgoKCgoKCgoKCgoKCgoe30oKSgpKXt9KSl7fXt9KCkpeyh7fVsoKV0pfXt9KSl7fXt9KSgpKSgpKSgpKSgpKSgpKSgpKSgpKSgpKSgpKSgpKCkpWygpXSkoKSgpKSgpKCkpWygpXSkpWygpXSkoKSgpKSgpKSgpKCkpWygpXSkpWygpXSkoKSgpKSgpKSgpKSgpKQ&input=&args=LXJ1&debug=on

@WheatWizard If I were to take that, then I wouldn't be able to write an explanation. It just looks like a jumbled mess of brackets to me. :P

Its a very small change.  I just moved the two instances of ()()() to the beginning and put them down and up.

///, 54 bytes
אבגדהוזחטיכךלמםנןסעפףצץקרשת

Try it online!
There can't be any version more golfed than this :(

05AB1E, 28*2-1=55 bytes
"אבגדהוזחטיכךלמםנןסעפףצץקרשת

Try it online!
-1 byte thanks to Emigna + 28 bytes thanks to DJMCMayhem ;).

I don't know what encoding 05AB1E uses, but I highly doubt those are one byte chars in whatever it is.

@DJMcMayhem I think TIO has a bug, those characters don't exist in CP-1252.

@EriktheGolfer Most likely it uses UTF-8 for convenience and then the 05AB1E interpreter does the necessary internal conversion. That's what I do for V (which uses latin1).

@DJMcMayhem Here it is shown as UTF-8 I think, but it also supports CP-1252, which you can use to make your byte count lower. This is not pure CP-1252, though, so it must be run with UTF-8 strings.

Scala/Groovy/Python 3, 9 ascii-chars + 27 2-byte chars = 63 bytes
print("אבגדהוזחטיכךלמםנןסעפףצץקרשת")

assuming UTF-8
Scala, 59 bytes
print("ABCDEFGHIJLKMONQPRSUTWVXYZ["map(x=>(x+1423).toChar))

x+1423 is the same as x-'A'+1488

Polygot, it works in Groovy too; also, see my answer, bytecount is off.

also in python 3 (also python 2 but then the parenthesis aren't necessary)

@caruscomputing I'd be wary of editing another user's byte count because you assume a certain encoding. Are you sure Scala can or can only handle UTF-8? Also,  the Hebrew alphabet has 27 letters, so 61 is wrong one way or another.

The first option also works on PHP.

APL (Dyalog), 35 bytes
d←⍳27
d[⎕A⍳'KNPTV']+←2
⎕UCS 1487+⍋d

Try it online!

you can encode 11 14 16 20 22 as ⎕A⍳'KNPTV'

C#6+, 76 86 82 bytes
void f()=>Console.Write("אבגדהוזחטיכךלמםנןסעפףצץקרשת");

First attempt at Golfing. Am I doing this right?
EDIT: +6 bytes for forgetting to enclose in a function. Thanks @Kevin
C#5 and below version, 86 82 bytes
void f(){Console.Write("אבגדהוזחטיכךלמםנןסעפףצץקרשת");}

Actually, you should either print a function or a complete program. So void F(){Console.WriteLine("אבגדהוזחטיכךלמםנןסעפףצץקרשת");} would be valid, or ()=>{Console.WriteLine("אבגדהוזחטיכךלמםנןסעפףצץקרשת");} as well I think (not sure about this last one, though). Also, you can golf it by using .Write instead of .WriteLine. :) That being said, welcome to PPCG! You may find Tips for golfing in C# interesting to read through. Enjoy your stay.

You know, you can use <s>your text</s> to strike some text instead of using strange characters.

I wasn't aware about that. Anyway thanks @EriktheGolfer

ArnoldC, 112 bytes
IT'S SHOWTIME
TALK TO THE HAND "אבגדהוזחטיכךלמםנןסעפףצץקרשת"
YOU HAVE BEEN TERMINATED

Fourier, 53 bytes
|+2a|X1488~i+10(ia^~i)^avaXXva+3avaX^aXva+3avaX^a^a^a
Uses functions again.
Try it FourIDE!

Keg, 34 bytes
Inspired by a Powershell solution.
ZYXVWTUSRPQNOMKLJIHGFEDCBA(֏+")(,

TIO

you're missing one char ("ת") at the end, the output is "אבגדהוזחטיכךלמםנןסעפףצץקרש".

BaCon, 57 bytes

In most BASICs, the question mark simply represents PRINT.
At first glance, the solution below looks like 30 bytes, but the Hebrew characters need 2 bytes of storage because of UTF-8. So there are 27 characters x 2 bytes + 1 byte for the '?' and 2 bytes for the double quotes = 57 bytes.

Solution:
?"אבגדהוזחטיכךלמםנןסעפףצץקרשת"

Try GW-BASIC with a CP862 VGA BIOS for 30. (Same text)

s-lang, 59 bytes
Really simple answer...
t[][אבגדהוזחטיכךלמםנןסעפףצץקרשת]

t - replace function (replaces "nothing" in the input with the alphabet...)

Try it here

zsh, 25 21 bytes
echo ${(j..):-{ת..א}}

My browser is messing it up: the ת should be the first letter, then the א.  If you paste somewhere else, though, it should work.  The old version:
for i in {ת..א};printf $i

Invalid, because final letters and normal letters are reversed in Unicode

Also, it's actually 27 bytes

Oh and the range should actually be aleph first and tav last. If the string is reversed in the question, it's because Hebrew is an RTL language

@TùxCräftîñg in my terminal, it displays correctly only with taf first an aleph last.  What do you mean "final letters and normal letters are reversed in Unicode"?

In the text in the question, there is כך for example (normal kaf first, final kaf second), but in Unicode, final letters are before normal letters (ךכ), so the printed text in invalid. And if it display with tav first, it's because Hebrew is a RTL language, so the first character is displayed rightmost

@Oliver he meant the old version for i in {ת..א};printf $i

I count 23 bytes.

My browser is messing it up
Welcome to the world of right to left text, we deal with this every day

It's supposed to be right to left, so I'm printing from taf to alef, but my browser is showing alef first and then taf.  It works fine in my terminal.

Java 7, 85 bytes
void c(){System.out.print("אבגדהוזחטיכךלמםנןסעפףצץקרשת");}

I'm not even gonna bother posting test code or a 'Try it here' like I usually do..

Perl 6 (74)
(map (*+1488).chr,[\+] '122222222230330403230403222'.comb >>->>1.join.say

Haskell, 23 bytes
main=putStr['א'..'ת']

Try it online!
This works in TIO's version of Haskell

C, 49 bytes
f(i){for(i=0x5d0;i<=0x5ea;i++)wprintf(L"%lc",i);}

Some users may need to call setlocale before using this but it worked fine for me.

Suggest for(i=1488;putwchar(i++)<1514;); instead of for(i=0x5d0;i<=0x5ea;i++)wprintf(L"%lc",i);

Ruby, 49 bytes
-11.upto(15){|r|$><<(""<<r+1499-2601[r]+5202[r])}

Try it online!

Clean, 62 bytes
Start="אבגדהוזחטיכךלמםנןסעפףצץקרשת"

Try it online!


text:
Shuffle Up and Deal!
It is Friday and I am tired, so let's do a quick one! Take no input, however you should output all thirteen different numbered cards in a standard deck of cards. You should output 2 through Ace (Suit agnostic).
Each card has a top that is denoted with a space   and ten _ and another space .
The second row from the top is denoted with a / and ten spaces   and a \
The third row is the same as all the middle-ish rows excepts the character(s) denoting the card value appear two spaces to right (if at the top) or two space to the left (if at the bottom) of the edge.
Each middle-ish row is a simple | and ten spaces   and one more |
Finally the last line is a \ and ten _ and finally a /
If the value is multi-digit the overall width by height of the card should not change. (i.e. the 10 will not make the card's sides wider)
King Example:
 __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/

9 Example
 __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/

10 Example
 __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/

Output them in order from least to greatest (Aces are high!).
This is code-golf so the shortest code wins.
Have fun and have a fun weekend!

May we have a 10 Example to see if the lower 10 is sticking the right edge or not?

@SunnyPun why of course

Should the cards be arranged vertically, horizontally, or does it matter?

Left to right or top to bottom players choice.

PowerShell v2+, 120 116 114 108 bytes
2..10+[char[]]'JQKA'|%{$z=' '*(8-!($_-10));$x='_'*10;$y=' '*10;" $x
/$y\
| $_$z|";,"|$y|"*5;"|$z$_ |
\$x/"}

Constructs a range 2..10 and does array concatenation with char-array JQKA. Feeds that into a loop |%{...}. Each iteration, we set $z equal to an appropriate number of spaces (based on whether we're at card 10 or not), set $x to 10 underscores, and set $y to 10 spaces.
Then, we begin our placements. We're going to leverage the default Write-Output to insert a newline between pipeline elements, so we just need to get the stuff on the pipeline. Note that in most places, we're using a literal newline rather than closing and reopening our strings to save a couple bytes.
The first is just $x with two spaces, then $y with two slashes, then the | $_$z|" the pipe, a space, the appropriate number of spaces, and another pipe. This forms the top of the cards up to and including the value line.
We have to semicolon here, since the next uses an array. The ,"|$y|"*5 constructs a string-array, with the comma-operator, of the pipe with spaces - on output, each element of this array gets a newline for free.
Then, the "|$z$_ | for the bottom value marking, and finally $x with slashes for the bottom of the card.
Output Snippet
PS C:\Tools\Scripts\golfing> 2..10+[char[]]'JQKA'|%{$z=' '*(8,7)[$_-eq10];" $(($x='_'*10)) ";"/$(($y=' '*10))\";"| $_$z|";,"|$y|"*5;"|$z$_ |";"\$x/"}
 __________
/          \
| 2        |
|          |
|          |
|          |
|          |
|          |
|        2 |
\__________/
 __________
/          \
| 3        |
|          |
|          |
|          |
|          |
|          |
|        3 |
\__________/
 __________
/          \
| 4        |
...

It's a strange day when PowerShell is winning! Nice work :)

@Shebang Thanks! Sub-100 is so dang close, but not sure if I can make it.

[shakes fist] you're beating me by 3 bytes.  THREE BYTES!!

Python, 161 160 156 149 bytes
One byte saved by Shebang
This could use some work but here it is:
o=" ";v="_"*10
for x in map(str,range(2,11)+list("JKQA")):print o+v+"\n/",o*9+"\\\n|",x.ljust(8),"|"+("\n|"+o*10+"|")*5+"\n|",o*6+x.ljust(3)+"|\n\\"+v+"/"

Explanation
We make a list of all the ranks in order using map(str,range(2,11).  Then we loop through each of the ranks and make a card.
print o+"_"*10+"\n/",o*9+"\\\n|",x.ljust(8),"|"+("\n|"+o*10+"|")*5+"\n|",o*6+x.ljust(3)+"|\n\\"+"_"*10+"/"

We make the top of the card:
o+v+"\n"

Then the rank goes on the left:
"/",o*9+"\\\n|",x.ljust(8),"|"

We use .ljust because 10 is two long and all the other ones are one wide.
Then we print the 5 rows in the middle:
"|"+("\n|"+o*10+"|")*5+"\n|"

and the bottom rank:
"\n|",o*6+x.ljust(3)+"|\n"

Finally we print the bottom of the card:
"\\"+v+"/"

Holy Moly that was quick

Your byte count seems off (I count 155). However, if you make a variable v="_"*10 and replace those instances will save you another byte!

JavaScript (ES6), 151 bytes

f=
_=>`2345678910JQKA`.replace(/.0?/g,s=>` __________
/          \\
| `+(s+=`   `+s).slice(0,4)+`     |
|     `.repeat(6)+s.slice(-4)+` |
\\__________/
`)
;
document.write('<pre>'+f());

PHP, 233 Bytes
foreach([2,3,4,5,6,7,8,9,10,J,Q,K,A]as$k){for($c="",$i=0;$i<10;$i++)$c.=str_pad($i?$i>1&$i<9?"|":($i<2?"/":"\\"):" ",11,$i%9?" ":_).($i?$i>1&$i<9?"|":($i<2?"\\":"/"):" ")."\n";$c[113]=$c[28]=$k;$k>9&&$c[29]=$c[113]=0&$c[112]=1;echo$c;}

Your last if can be replaced with $k>9&&$c[29]=$c[113]=0&$c[112]=1;, to save a few bytes. Also, Notepad++ is saying your code is actually 241 bytes long. I know 1 of those bytes is from the newline. But the other is a mistery to me.

Perl, 128 117 111 bytes
map{printf$"."_"x10 ."
/".$"x10 .'\
| %-9s|
'.("|".$"x10 ."|
")x5 ."|%9s |
\\"."_"x10 ."/
",$_,$_}2..10,J,Q,K,A

The 6 literal newlines save 1 byte each.  This cannot be run directly from the command line because of the single quotes in lines 2 and 4 in order to save 1 byte by not having to escape a backslash.
Edit: I put Ace at the beginning, but it's supposed to be at the end.  It doesn't change the byte count.
Edit 2: -11 bytes: Got rid of some unnecessary statements and added another literal newline.  Everything is now output via a single printf.
Edit 3: -5 bytes thanks to @Ton Hospel.  But for some reason, I'm getting 111 bytes instead of 112 at home when compared to at work, so I'm going with the byte count my home computer is giving me.

You don't have to quote literals that are a valid symbol names, so _ x10 instead of "_"x10. Also qw is almost never useful. in golf. Use unquoted  J,Q,K,A instead (even leaving out the ())

I get an interpreter error when I remove the quotes around the underscore: Can't locate object method "_" via package "x10" (perhaps you forgot to load "x10"?) at shuffle.pl line 1.  Not sure why, but I won't fight the interpreter :(

A bit more golfed (replace \n by real newline): printf' %2$s\n/%3$10s\\n| %-9s|\n'.'|%3$10s|\n'x5 .'|%1$9s |\n\%s/\n',$_,"_"x10for 2..10,J,Q,K,A

///, 182 180 bytes
/+/_____//*/# |
&//&/@@@@@|# //%/ |
\\\\++\\\/
//$/ ++
\\\/!\\\\
| //#/       //!/#   //@/|!|
/$2*2%$3*3%$4*4%$5*5%$6*6%$7*7%$8*8%$9*9%$10#|
@@@@@|#10 |
\\++\/
$J*J%$K*K%$Q*Q%$A*A%

Try it online!
-2 bytes thanks to m-chrzan

You can save two bytes by having + substitute for only 5 _s, and then having two +s where you have single +s now.

Python 3.5, 110 bytes
u='_'*10
for c in[*range(2,11),*'JQKA']:print(' %s\n/%%11s\n'%u%'\\'+'| %-6s%2s |\n'*7%(c,*' '*12,c)+'\%s/'%u)

Prints

The top two lines ' %s\n/%%11s\n'%u%'\\' where u is '_'*10
The middle 7 lines '| %-2s    %2s |\n', each of which has two string formatting slots. The first and last are filled with the card value, and the rest with spaces for no effect
The bottom line '\%s/'%u

Python 3.5's new unpacking features are used in two places. The list of labels [*range(2,11),*'JQKA'] unpacks the numbers and letters into one list. And, the tuple (c,*' '*12,c) unpacks twelve entries of spaces into the center.

Batch, 236 bytes
@echo off
for %%v in (2 3 4 5 6 7 8 9 10 J Q K A)do call:v %%v
exit/b
:v
set s=%1       %1
echo  __________
echo /          \
echo ^| %s:~0,8% ^|
for /l %%l in (1,1,5)do echo ^|          ^|
echo ^| %s:~-8% ^|
echo \__________/

I tried golfing this in three different ways but ended up with the same byte count each time...

Scala, 161 bytes
val a=" "*7
val u="_"*10
((2 to 10)++"JQKA")map(_+"")map{x=>val p=" "*(2-x.size)
s" $u \n/$a   \\\n| $x$p$a|\n" + s"|$a   |\n" * 5 + s"|$a$p$x |\n\\$u/\n"}

05AB1E, 71 70 68 66 65 64 bytes
Uses CP-1252 encoding.
TL¦"JQKA"S«vð'_T×©ððT×…/ÿ\9yg-ð×y"| ÿÿ|"ÂðT×…|ÿ|5×sTÂ‡®…\ÿ/JTä»,

Slightly modified link as … doesn't work with ÿ on TIO atm.
Try it online!
Explanation
TL¦"JQKA"S« pushes the list [2,3,4,5,6,7,8,9,10,J,Q,K,A]
We then loop over each card value with v
ð'_T×©ð constructs " __________ "
ðT×…/ÿ\ constructs "/          \"
9yg-ð×y"| ÿÿ|"Â constructs the 2 rows with card values (the second row is the first reversed)
ðT×…|ÿ|5× constructs 5 rows of the form "|          |"
Then we
s     # move the 2nd card value row after the 5 "middle rows"
 TÂ‡  # and replace 1 with 0 and vice versa

®…\ÿ/ constructs the bottom row
J       # join everything into 1 string
 Tä     # split into 10 parts
   »,   # merge by newline and print with newline

V, 87 bytes
i ±_
/± \Ypr|$.Y6P3|r2Lhhr2o\±_/
H8ñy}GP2j6j? _ñ2j$X6jxG"04p/9
rJn.nrQn,nrKn.nrAn.

Try it online!
Since this contains some unprintables, here is a hexdump:
0000000: 6920 b15f 200a 2fb1 205c 1b59 7072 7c24  i ._ ./. \.Ypr|$
0000010: 2e59 3650 337c 7232 4c68 6872 326f 5cb1  .Y6P3|r2Lhhr2o\.
0000020: 5f2f 0a1b 4838 f179 7d47 5032 6a01 366a  _/..H8.y}GP2j.6j
0000030: 013f 205f f132 6a24 5836 6a78 4722 3034  .? _.2j$X6jxG"04
0000040: 702f 390a 724a 6e2e 6e72 516e 2c6e 724b  p/9.rJn.nrQn,nrK
0000050: 6e2e 6e72 416e 2e                        n.nrAn.

PHP, 135 131 158 134 bytes
Hopefully, I can find a way to shorten this a little more.
foreach([2,3,4,5,6,7,8,9,10,J,Q,K,A]as$C)printf(" %'_9s
/%12s| %-8s|%s
|%8s |
\\%'_9s/
",_,'\
',$C,str_repeat('
|         |',5),$C,_);

This takes advantage of printf to repeat multiple characters and format everything nicely.

Old version:
Not exactly a piece of beauty, but works!
$L=__________;$S='        ';foreach([2,3,4,5,6,7,8,9,10,J,Q,K,A]as$C)echo" $L
/  $S\
| $C".($P=substr($S,$C>9))."|
",str_repeat("|  $S|
",5),"|$P$C |
\\$L/
";

Thanks to Jörg Hülsermann for detecting a bug and for letting me use part of his code, that reduced it by 4 bytes! And for finding a fatal bug.

The 10 looks strange. I believe you must do extra work

@JörgHülsermann You're right. The 10 is bugged. Is it alright if I use your array? Using [2,3,4,5,6,7,8,9,10,J,Q,K,A] instead of that split saves me 4 bytes. If you don't authorize it, I will understand.

Take it. You have make the better way in PHP and I support all what you need.

@JörgHülsermann Thank you. I am looking at your answer and I'm finding some places where to shave off some bytes.

Instead of $C$S $C".($P=substr($S,$C>9))." to handle the spaces with value 10 and instead of $S$C you need then $P$C

@JörgHülsermann I'm sorry, but I don't understand :/

If you have value 10 you have one space more then you need | 9        | in comparision to | 10        | and so you must short the space sequence

@JörgHülsermann Should be fixed now. Thanks for finding it.

Ruby, 115 bytes
Fairly straightforward use of printf.
([*(?2.."10")]+%w{J Q K A}).map{|e|printf" #{u=?_*10}
/%11s
| %-9s|
#{(?|+' '*10+"|
")*5}|%9s |
\\#{u}/
",?\\,e,e}

Racket 327 bytes
(let*((ms make-string)(p #\space)(e? equal?)(sa string-append)(f(λ(s)(display(sa" "(ms 10 #\_)" \n""/"(ms 10 p)"\\\n""| "s
(ms(if(e? s"10")7 8)p)"|\n"(apply sa(for/list((i 6))"|          |\n"))"| "(ms(if(e? s"10")6 7)p)s" |\n"
"\\"(ms 10 #\_)"/\n")))))(for((i(range 2 11)))(f(number->string i)))(for((i'("J""Q""K""A")))(f i)))

Ungolfed:
(define (main)
(let* ((ms make-string)
       (e? equal?)
       (sa string-append)
      (f(lambda(s)
  (display
   (sa
    " "
    (ms 10 #\_)
    " \n"
    "/"
    (ms 10 #\space)
    "\\\n"
    "| " s   (ms (if(e? s "10") 7 8) #\space)   "|\n"
    (apply sa (for/list ((i 6)) "|          |\n"))
    "| "  (ms (if(e? s "10") 6 7) #\space)  s " |\n"
    "\\" (ms 10 #\_) "/\n")
   ))))
(for ((i(range 2 11)))
  (f (number->string i)))
(for ((i '("J" "Q" "K" "A")))
  (f i))
))

Testing:
(main)

Output:
 __________
/          \
| 2        |
|          |
|          |
|          |
|          |
|          |
|          |
|        2 |
\__________/
 __________
/          \
| 3        |
|          |
|          |
|          |
|          |
|          |
|          |
|        3 |
\__________/
 __________
/          \
| 4        |
|          |
|          |
|          |
|          |
|          |
|          |
|        4 |
\__________/
 __________
/          \
| 5        |
|          |
|          |
|          |
|          |
|          |
|          |
|        5 |
\__________/
 __________
/          \
| 6        |
|          |
|          |
|          |
|          |
|          |
|          |
|        6 |
\__________/
 __________
/          \
| 7        |
|          |
|          |
|          |
|          |
|          |
|          |
|        7 |
\__________/
 __________
/          \
| 8        |
|          |
|          |
|          |
|          |
|          |
|          |
|        8 |
\__________/
 __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/
 __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/
 __________
/          \
| J        |
|          |
|          |
|          |
|          |
|          |
|          |
|        J |
\__________/
 __________
/          \
| Q        |
|          |
|          |
|          |
|          |
|          |
|          |
|        Q |
\__________/
 __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/
 __________
/          \
| A        |
|          |
|          |
|          |
|          |
|          |
|          |
|        A |
\__________/

Java 7, 287 bytes
String c(){String r="",l="__________",c=(" "+l+" \n/s\\\n| z       |\nxxxxxx|       y|\n\\"+l+"/\n").replace("x","|s|\n").replace("s","          ");for(int i=0;i++<13;r+=c.replace("z",i==10?"10":(l=i<2?"A ":i>12?"K ":i>11?"Q ":i>10?"J ":i+" ")).replace("y",i==10?"10 ":" "+l));return r;}

Ok, this is ugly and not very efficient, but it works.. That 10 as special case with a space before at the top and after at the bottom position really screws with everyone..
Ungolfed & test code:
Try it here.
class M{
  static String c(){
    String r = "",
           l = "__________",
           c = (" " + l + " \n/s\\\n| z       |\nxxxxxx|       y|\n\\" + l + "/\n")
                 .replace("x", "|s|\n")
                 .replace("s", "          ");
    for(int i = 0; i++ < 13; r += c
        .replace("z", i == 10
                       ? "10"
                       : (l = i < 2
                               ? "A "
                               : i > 12
                                  ? "K "
                                  : i > 11
                                     ? "Q "
                                     : i > 10
                                        ? "J "
                                        : i+" "))
        .replace("y", i == 10
                       ? "10 "
                       : " "+l));
    return r;
  }

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

Output:
 __________
/          \
| A        |
|          |
|          |
|          |
|          |
|          |
|          |
|        A |
\__________/
 __________
/          \
| 2        |
|          |
|          |
|          |
|          |
|          |
|          |
|        2 |
\__________/
 __________
/          \
| 3        |
|          |
|          |
|          |
|          |
|          |
|          |
|        3 |
\__________/
 __________
/          \
| 4        |
|          |
|          |
|          |
|          |
|          |
|          |
|        4 |
\__________/
 __________
/          \
| 5        |
|          |
|          |
|          |
|          |
|          |
|          |
|        5 |
\__________/
 __________
/          \
| 6        |
|          |
|          |
|          |
|          |
|          |
|          |
|        6 |
\__________/
 __________
/          \
| 7        |
|          |
|          |
|          |
|          |
|          |
|          |
|        7 |
\__________/
 __________
/          \
| 8        |
|          |
|          |
|          |
|          |
|          |
|          |
|        8 |
\__________/
 __________
/          \
| 9        |
|          |
|          |
|          |
|          |
|          |
|          |
|        9 |
\__________/
 __________
/          \
| 10       |
|          |
|          |
|          |
|          |
|          |
|          |
|       10 |
\__________/
 __________
/          \
| J        |
|          |
|          |
|          |
|          |
|          |
|          |
|        J |
\__________/
 __________
/          \
| Q        |
|          |
|          |
|          |
|          |
|          |
|          |
|        Q |
\__________/
 __________
/          \
| K        |
|          |
|          |
|          |
|          |
|          |
|          |
|        K |
\__________/

C#, 385 Bytes
My first ASCII Art challenge - it was fun!
Golfed:
string D(){var d=new string[15];for(int i=2;i<15;i++){var a=i>10?new Dictionary<int,string>(){{ 11,"J"},{12,"Q"},{13,"K"},{14,"A"},}[i]:i+"";var r="|          |";d[i]=string.Join("\n",new string[]{" __________",@"/          \",a.Length>1?"| "+a+"       |":"| "+a+"        |",r,r,r,r,r,a.Length>1?"|       " + a +" |" : "|        "+a+" |",@"\__________/"});}return string.Join("\n",d);}

Ungolfed:
public string D()
{
  var d = new string[15];

  for (int i = 2; i < 15; i++)
  {
    var a = i > 10 ? new Dictionary<int, string>() {
    { 11, "J" },
    { 12, "Q" },
    { 13, "K" },
    { 14, "A" },
    }[i]
      : i+"";

    var r = "|          |";

    d[i] = string.Join("\n", new string[] {
      " __________",
      @"/          \",
      a.Length > 1 ? "| " + a + "       |" : "| " + a + "        |",
      r,
      r,
      r,
      r,
      r,
      a.Length > 1 ? "|       " + a +" |" : "|        " + a +" |",
      @"\__________/"});
  }

  return string.Join("\n", d);
}

Actually, 91 bytes
"JQKA"#9⌐2x+`;k' ;'_9u*@++'\' 9u*'/++"| {:<9}|"5'|;' 9u*@++n"|{:>9} |"'/'_9u*'\++kp@'
jf`Mi

Try it online!
Explanation
Part 1: setting up the list of face values:
"JQKA"#9⌐2x+`PART 2 CODE`Mi
       9⌐2x                  range(2,11) ([2, 10])
"JQKA"#    +                 extend with ["J", "Q", "K", "A"]
            `PART 2 CODE`M   do Part 2 for each item in list
                          i  flatten resulting list and implicitly print

Part 2: creating the cards (newline replaced with \n for readability):
;k' ;'_9u*@++'\' 9u*'/++"| {:<9}|"5'|;' 9u*@++n"|{:>9} |"'/'_9u*'\++kp@'\njf
;k                                                                            duplicate the face value, push both copies to a list
  ' ;'_9u*@++                                                                 construct the top line
             '\' 9u*'/++                                                      construct the second line
                        "| {:<9}|"                                            create a format string to place the value in a left-aligned 9-width field in the top left of the card, one space away from the edge
                                  5'|;' 9u*@++n                               create 5 copies of the blank middle section
                                               "|{:>9} |"                     like before, but right-align the face value
                                                         '/'_9u*'/++          construct the bottom of the card
                                                                    kp@'\nj   push entire stack to a list, pop the list containing the face values out of that list, and join the rest (the card strings) with newlines
                                                                           f  format the card with the face values

R, 175 bytes
for(x in c(2:10,"J","Q","K","A")){r=c("|"," ",x,rep(" ",9-nchar(x)),"|");cat(" __________ \n/          \\\n",r,"\n",rep("|          |\n",5),rev(r),"\n\\__________/\n",sep="")}

A fairly competitive answer in R this time for an ascii-art challenge and should definitely be golfable.
Try it on R-fiddle
Ungolfed and explained
for(x in c(2:10,"J","Q","K","A")){          # For each card in vector 1,...,10,J,Q,K,A
    r=c("|"," ",x,rep(" ",9-nchar(x)),"|")  # Create variable for 3rd row called "r".
    ;cat(" __________ \n/          \\\n",   # Print: hardcoded top two rows,
    r,"\n",                                 # 3rd row,
    rep("|          |\n",5),                # Repeat middle section 5 times,
    rev(r),                                 # Reversed 3rd row,
    "\n\\__________/\n",                    # Hardcoded bottom row
    sep="")                                 # Set separator to empty string
}

The most interesting aspect where a few bytes are saved is the assignment of the third row:
r=c("|"," ",x,rep(" ",9-nchar(x)),"|")

Because there are  8 spaces in total between the character denoting the card value and the final | (except for 10) we can repeat 9 spaces and subtract the number of characters in the currently printed card.
By storing each character in the 3rd row as its own element in the string vector r we can reverse the vector and reuse it for the 9th row.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Does the code terminate?
This is a code golf challenge I thought of with a mathematical bent. The challenge is to write the shortest code possible such that it is an open question whether or not the code terminates. An example of what I mean could be the following piece of python code, adapted from an anwser to this cs stackexchange question.
def is_perfect(n):
    return sum(i for i in range(1, n) if n % i == 0) == n

n = 3
while not is_perfect(n):
    n = n + 2

Mathematicians conjecture that there are no odd perfect numbers, but it has never been proven, so no one knows if this piece of code will ever terminate. Can you come up with other pieces of code (perhaps relying on other open problems like the Collatz conjecture, or the twin primes conjecture) that are shorter, but for which it is unknown whether or not they terminate?
Edit: Some people have brought up a good additional rule - The solutions to the question should be deterministic. Although it might be even more interesting if you could find shorter solutions using nondeterminism. In this case, the rule would be to find a snippet for which the probability of termination is unknown.

Welcome to PPCG!

Your code can be golfed to 50 bytes: n=3
while sum(k*(n%k<1)for k in range(1,n))-n:n+=2.

This really is a great concept.  It's nice to see original ideas like this.

And here I thought this was going to be related to the Church-Turing thesis Nice question!

Useful

May we assume infinite memory?

@Mego I think this challenge only works if you assume infinite data types what will automatically assume infinite memory.

When I read the title I thought you wanted us to solve the halting problem AND golf the solution.

Are snippets explicitly allowed, or is it only full programs or functions?

I love this challenge, because it's basically asking users to solve open-ended problems, which the world wants solved anyway.

@WheatWizard I used this much longer list on Wikipedia.

It is an open problem how long before cosmic rays trigger an infinite loop to NMI reset.

This reminds me of the paper A Relatively Small Turing Machine Whose Behavior Is Independent of Set Theory, which details a Turing machine that runs forever but cannot be proven to do so using the axioms of ZFC set theory.  (The paper even likens the construction of the Turing machine to "code-golfing.")

I think this should be closed: As soon as one of the used conjectures is proven, people have to delete their answers. And it is not too difficult to come up with own conjectures, that might have trivial answers.

We have already closed essentially this same question twice, IIRC. It has two major problems: 1. "Open question" under what assumptions? There are programs which are known to terminate if you assume some extremely strong axioms, but unknown otherwise. 2. It's a multi-duplicate of existing questions relating to Goldbach, Collatz, etc.

Is "Will you let this program run continuously for 10 years?" an open problem?

Jelly, 7 bytes
!‘Æ²µ4#

Try it online!
Background
This will terminate once it finds a fourth solution to Brocard's problem, i.e. a solution n! + 1 = m² with (n,m) ≠ (4, 5), (5, 11), (7, 71) over the positive integers. The implementation doesn't use floating point arithmetic, so it will only terminate if it does find a fourth solution or if n! can no longer be represented in memory.
Brocard's problem was first used in this answer by @xnor.
How it works
!‘Æ²µ4#  Main link. No arguments. Implicit argument: 0

    µ4#  Convert the links to the left into a monadic chain and call it with
         arguments k = 0, 1, 2, ... until 4 of them return 1.
!        Factorial; yield k!.
 ‘       Increment; yield k! + 1.
  Æ²     Squareness; return 1 if k! + 1 is a perfect square, 0 if not.

I need to learn jelly...

Jelly, 11 9 bytes
ÆẸ⁺‘ÆPµ6#

This will terminate once the sixth Fermat prime is found.
Try it online!
How it works
ÆẸ⁺‘ÆPµ6#  Main link. No arguments. Implicit argument: 0

      µ6#  Convert the links to the left into a monadic chain and call it with
           arguments k = 0, 1, 2, ... until 6 of them return 1.
ÆẸ         Convert [k] to the integer with that prime exponent factorization, i.e.,
           into 2 ** k.
  ⁺        Repeat.
   ‘       Increment.
           We've now calculated 2 ** 2 ** k + 1.
    ÆP     Test the result for primality.

Pyth, 10 bytes
fP_h^2^2T5

Uses the conjecture that all Fermat numbers 2^(2^n)+1 are composite for n>4.
f        5   Find the first number T>=5 for which
   h^2^2T    2^(2^T)+1
 P_          is prime

MATL, 11 bytes
`@QEtZq&+=z

Terminates iff the Goldbach conjecture is false. That is, the program stops if it finds an even number greater than 2 that cannot be expressed as the sum of two primes.
`        % Do...while
  @      %   Push iteration index k. Gives 1, 2, 3, ...
  QE     %   Add 1 and multiply by 2. Gives 4, 6, 8, ...
  tZq    %   Duplicate. Push all primes up to current k
  &+     %   Matrix with all pairwise additions of those primes
  =z     %   Number of entries of that matrix that equal k. This is used as loop
         %   condition. That is, the loop continues if this number is nonzero
         % Implicit end

Python, 36 bytes
k=n=1
while(n+1)**.5%1+7/k:k+=1;n*=k

Uses Brocard's problem:

Is n!+1 a perfect square for any n≥8?

Computes successive factorials and checks whether they are squares and have k>7. Thanks to Dennis for 2 bytes!
This assumes Python continues to have accurate arithmetic for arbitrarily large numbers. In actual implementation, it terminates.

Would -~n**.5 not work in place of (n+1)**.5?

@ETHproductions The precedence of exponentation is higher than the precedence of ~, so that would just raise a TypeError for trying to negate a float bitwise.

Brachylog (v2), 3 bytes in Brachylog's encoding
⟦cṗ

Try it online! (will time out without doing anything visible, for obvious reasons)
Full program; if run with no input, searches for the first Smarandache prime, and outputs true. if and when it finds one. It's an open question as to whether any Smarandache primes exist. (Note that Brachylog's prime-testing algorithm, although it works in theory on arbitrarily large numbers, tends to run slowly on them; thus, if you're interested in finding Smarandache primes yourself, I recommend using a different language.)
Explanation
⟦cṗ
⟦     Form an increasing range from 0 to {the smallest number with no assertion failure}
 c    Concatenate all the numbers that make up that range, in decimal
  ṗ   Assert that the result is prime

Brachylog operates on the decimal digits of a number whenever you try to treat it like a list, so "range" followed by "concatenate" is a very terse way to generate the sequence of Smarandache numbers (and then we filter that by primality; Brachylog's default full program behaviour will then force the first element of the resulting generator). The range has a leading zero, but fortunately, with this flow pattern, Brachylog removes the zero rather than failing.
Here's an example that finds the first Smarandache number that's equal to 6 (mod 11), as a demonstration of a similar program that terminates within 60 seconds rather than having unknown halting status:
⟦c{-₆~×₁₁&}

Try it online!
This would print true. as a full program, but I threw in the Z command line argument to actually print the number in question, giving a better demonstration that this general approach works.

Perl, 50 38 36 34 33 bytes
$_=196;$_+=$%while($%=reverse)-$_

Explanation: 196 is a possible Lychrel number - a number that does not form a palindrome by repeatedly adding its reverse to itself.  The loop continues until $n is equal to its reverse, which is as yet unknown for initial value 196.
25 + 52 = 77

which is not valid.
96 + 69 = 165
165 + 561 = 726
726 + 627 = 1353
1353 + 3531 = 4884

so none of the numbers in this sequence are valid.
Edit: Golfed it down by using an until loop instead of a for loop (somehow).  Also, I had fewer bytes than I thought (I should probably look at my bytecount more carefully in the future).
Edit: Replaced $n with $_ to save 2 bytes for the implied argument in reverse.  I think this is as golfed as this implementation is going to get.
Edit: I was wrong.  Instead of using until($%=reverse)==$_ I can go while the difference is nonzero (i.e. true): while($%=reverse)-$_.

Since there are a finite number of possible plain perl numbers I can in fact determine if this program terminates or not. You need to load a bigint package to make this work (or implement it)

Do it. I dare you. :-)

Python, 30 28 bytes
n=2
while 2**~-n%n**3-1:n+=1

This program will halt if and only if there is an integer n bigger than 1 such that 2^(n-1)-1 is divisible by n^3. To my knowledge it is not known whether any number with this property exists (if a number satisfying this property is prime, it is called a Wieferich prime of order 3 to base 2, and it is open whether any such prime exists).

Are you sure the parentheses are placed correctly?  It looks like you're testing to see if 2^(n-1) !≡ 1 (mod n^3), not 2^n ≡ 1 (mod n^3).  Granted, I don't know Python's operator precedence all that well.

Whoops, the code is correct, but my explanation isn't. I'll fix it.

you can replace (n-1) with ~-n

2**n%n**3-2 is shorter

05AB1E, 8 bytes
Will terminate when the 6th Fermat prime is found.
5µNoo>p½

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

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

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

Brain-Flak, 212 208 204 bytes
This program uses a multiplication algorithm written by MegaTom and a non-square checker written by 1000000000
Try It Online
(((()()()()){})){{}((({}()))<{(({})[()])}{}>[()]){({}<({}<>)({<({}[()])><>({})<>}{}<><{}>)>[()])}{}(({}())){(({}[()]<>)<>)(({({})({}[()])}{}[({})]<>)){{}{}({}<>)(<([()])>)}{}({}()){(((<{}{}<>{}>)))}{}}{}}

This program starts at 8 and tests each number to see if n!+1 is a square number.  It exits when it finds one.  This is known as Brocard's Problem and it is an open problem in mathematics.

Python 2, 88 bytes
p=lambda n:all(n%x for x in range(2,n))
s=lambda n:0if p((10223*2**n)+1)else s(n+1)
s(0)

This code will terminate if 10223 is a Sierpiński number. 10223 is currently the smallest candidate that may or may not be a Sierpiński number, as of December 2013.
A Sierpiński number is a number k in which all numbers of the form (k * 2^n) + 1 are composite.

I hope this problem and the Sierpinski problem are resolved in the near future, just with more calculations.

This code surely terminates, since you just name two lambdas, you don't actually call anything. :-P

@Veky sigh Fixed...

In fact you didn't. Your code still always terminates, since Python2 semantics is frozen (PEP 404), and it includes a hard limit on recursive calls by BDFL's fiat (http://neopythonic.blogspot.hr/2009/04/final-words-on-tail-calls.html). ;-P

@Veky Had to upvote your comment.

I also had to upvote yours. It made me laugh. :-D

Not many days after this was written, the prime 10223*2^31172165 + 1 was discovered. Since then, 21181 has been the smallest number for which it is not known if it is Sierpiński or not.

Hooray!!!!!!!!!!

Actually, 16 bytes
1`;;pY)▒@D÷íu*`╓

Try it online!
This code terminates iff there is some composite number n such that totient(n) divides n-1 (Lehmer's totient problem).
Explanation:
1`;;pY)▒@D÷íu*`╓
1`            `╓  first integer, starting with 0, where the following function leaves a truthy value on top of the stack:
    pY       *      composite (not prime) and
   ;  )▒            totient(n)
  ;     @D÷íu       is in the list of divisors of n-1

Jelly, 9 8 bytes
-1 byte thanks to @Dennis! (use exponentiation instead of multiplication to avoid Æṣ(0))
*ḂÆṣ=µ2#

Will return a list of zero and the smallest odd perfect number, if any exist.
How?
*ḂÆṣ=µ2# - Main link: no arguments
     µ   - monadic chain separation
      2# - count up from implicit `n=0` and return the first 2 truthy results of
 Ḃ       -     mod 2        -> n%2
*        -     exponentiate -> n**(n%2)  (1 when n is even, n when n is odd)
  Æṣ     -     sum of proper divisors of n**(n%2)
    =    -     equals n?    -> 1 if n is zero or both perfect and odd, else 0

Pyth, 16 bytes
f!}1.u@,/G2h*3GG

Returns the first value for which the Collatz conjecture does not hold.  As it is unknown whether the conjecture holds for all numbers, it is unknown whether this code will terminate.

Without being able to read it, I doubt your code does exactly what you claim. Do you search for the first number that goes to a loop different from 4-2-1? I guess you won't find it if there is a smaller number that doesn't end in any loop. Anyway, if that's what your code does, that's good enough for not knowing whether it will terminate.

I search for the first integer >= 1 that goes to a loop and nowhere within the traversal to that loop contains a 1.

That's what I expected. But that's not the only conceivable way for a number to not satisfy the collatz conjecture.

Actually, it has been proven that every number either diverges to infinity or coverges to 1-2-4 under the Collatz map. Your code will never terminate. The idea is that the sequence of steps that forms a loop sets up an equation, whose only solutions are 1-2-4, negative values and non-integer rationals.

@JanDvorak I do not believe that is true. Can you cite a source?

@ksft I did not manage to find the proof I remember from years ago, unfortunately. I did find this MO question from 2011 regarding the topic, though: http://mathoverflow.net/questions/68751/larger-cycle-than-4-2-1-in-collatz-iteration. It does trim the cycle space quite significantly. The same result is quoted on Wikipedia. I'll consider this answer valid for now but I'll also keep it in tabs in case I do find the proof I saw and I'm not mis-remembering things.

Haskell, 46 bytes
[n|m<-[1..],n<-[1..m],product[1..n]+1==m^2]!!3

Terminates if it finds the 4th solution to brocard's problem.

Python 2, 123 98 92 bytes
p=lambda n,k=2:n<=k or n%k*p(n,k+1)
g=lambda n:[p(b)*p(n-b)for b in range(n)]and g(n+2)
g(4)

This code will terminate if the Goldbach conjecture does not hold for all even numbers (i.e. if all even numbers can be expressed as the sum of two primes). It has currently been tested for numbers up to 4*10^18.
A huge amount of thanks to @Pietu1998 for shortening my code by a lot!
EDIT: Thanks to @JonathanAllan for shaving 6 bytes off my code!

I think you can save 6 bytes with g=lambda n:[p(b)*p(n-b)for b in range(n)]and g(n+2). I also think this should read "will terminate if the Goldbach conjecture does not hold".

Python, 92 bytes
This isn't winning any code golf competitions, and it requires infinite memory and recursion depth, but this is an almost perfect opportunity to plug an interesting problem I asked on math stackexchange two years ago, that no Fibonacci number greater than 8 is the sum of two positive cubes. Funnily enough, it started as an code golf challenge idea, so I guess I've come full circle.
def f(i,j):
 r=range(i)
 for a in r:
  for b in r:
   if a**3+b**3==i:1/0
 f(j,i+j)
f(13,21)

JavaScript (ES6), 104 101 bytes
for(n=[6,9,p=1];!p;n=n.map((x,i)=>(q=n[n.length+~i],p|=x^q,c=q+x+c/10|0)%10).concat(c/10|0||[]))c=p=0

Uses the same method as the Perl answer: sets n to 196, then repeatedly adds n to its base 10 reverse until it's a palindrome in base 10. This would be shorter if JS supported arbitrary-precision numbers, but oh well.

Although this is long, it's cleverly golfed, so +1.

Python, 80 bytes
Terminates if the Collatz Conjecture is proven false. See this question.
n=2
while 1:
 L=[];x=n
 while~-n:1/(n not in L);L+=[n];n=(n/2,n*3+1)[n%2]
 n=x+1

That's disgusting, but also beautiful.

Jelly, 7 bytes
*+3Ẓµ4#

Try it online! (prints two elements, not 4, so that you can actually see it halt)
Prints the first four \$n\$ such that \$n^n+3\$ is prime. It is not known whether four+ numbers with this property exist. The first three are 2, 1036, and 2770.
Explanation
*+3Ẓµ4#
     4#  Find the first four numbers with the following property:
    µ      (bracketing/grouping: place everything to the left inside the loop)
*          {The number} to the power of {itself}
 +3        plus 3
   Ẓ       is prime

Pyth, 13 bytes
.u@,/G2h*5GG7

Like Steven H.'s answer, but saving a few bytes by using the 5n+1 problem instead

Do the iterates of
$$f(n)=\begin{cases}5n+1&\mbox{if }n\mbox{ is odd}\\\frac{n}{2}&\mbox{otherwise}\end{cases}$$
starting with 7, cycle?

While it seems unlikely, the answer is unknown!

Vyxal, 8 bytes
λEE›æ;5ȯ

Try it Online!
Finds the fifth Fermat Prime.
λ    ;5ȯ # First 5 numbers where
 EE›     # 2^2^n + 1
   æ     # Is prime

R, 30 bytes, arguable whether it is deterministic
while(any(sample(2,654,T)>1))1

R's default random number generator has equidistribution in 653 consecutive dimensions but it is not known to in 654 dimensions. Thus there may or may not be a sequence of pseudorandom numbers that sample the lowest element from a given vector 654 times in a row (here the vector 1:2).
Since R's RNG is periodic (albeit with very long period), I claim that this is deterministic since it will eventually loop round to the start. Your opinions may differ, of course.

Python 2, 64 bytes

A Lychrel number is a natural number that cannot form a palindrome through the iterative process of repeatedly reversing its digits and adding the resulting numbers.

No Lychrel numbers have been proven to exist in base ten. 196 is the smallest base ten Lychrel number candidate. It has been shown that if a palindrome exists (making 196 not a Lychrel number), it would have at least a billion (10^9) digits, because people have run the algorithm that long.
n=196
while 1:
    x=str(n);r=x[::-1]
    if x!=r:n=n+int(r)
    else:1/0

@trichoplax Ah, the tabs / spaces "feature" strikes again...

If anyone else also finds the tab conversion unhelpful, there's a discussion on meta...

Pushy, 13 bytes
7$h&fh&r2e=?i

Try it online!
This program attempts to find a solution to Brocard's Problem - it will keep running until it finds a \$n \ge 8\$ such that \$ n! +1=m^2, m \in \mathbb{N} \$

Python 3, 101 bytes
I know it's longer than many others, but I spent a lot of time seeing how short I could golf this.
This attempts to disprove Euler's Sum of Powers Conjecture for k=6 (there exists no positive integer solution to the Diophantine equation A^6+B^6+C^6+D^6+E^6==F^6), for which no counterexample has been found.
R=[1]
while 1:R+=[R[-1]+1];eval(("[1/("+"+%s**6"*5+"!=%%s**6)%s]"%("for %s in R "*6))%(*"ABCDEF"*2,))

In Python 2 (104 bytes):
R=[1]
while 1:R+=[R[-1]+1];eval(("[1/("+"+%s**6"*5+"!=%%s**6)%s]"%("for %s in R "*6))%tuple("ABCDEF"*2))

Less golfed:
x=2
while 1:
    R=range(1,x)
    [1/(A**6+B**6+C**6+D**6+E**6!=F**6)for F in R for E in R for D in R for C in R for B in R for A in R]
    x+=1

Mathy version with no eval:
R=range
x=2
while 1:
    for i in R(x**6):1/(sum(map(lambda x:x**6,[1+(i%x**-~j/x**j)for j in R(6)]))-i%x-1)
    x+=1

Alternate reference: Euler's Sum of Powers Conjecture - MathWorld

Python, 68 bytes
n=2
while"".join(str((i+2)**n)[0]for i in range(8))!="23456789":n+=1

Try it online
Tries to answer one of Gelfand's Questions.

Will the row "23456789" ever appear for n>1? None does for n<=10^5. ...

Clojure, 154 bytes
(loop[x 82001](if(= 0(reduce +(map{true 1 false 0}(for[y(range 3 6)](true?(for[z(str(range 2 y))](.indexOf z(Integer/toString x y))))))))x(recur(inc x))))

Checks if there's a number above 82,000 that only contains 0's and 1's for base 2 all the way to base 5. In other words, it checks if there's another number in this sequence.
In that special group, there are only 3 numbers: 0, 1 and 82,000. There are no more numbers that follow that rule that are less than approximately 3*10^19723.

Pyt, 14 bytes
27*²0`ŕĐ₫+Đ₽¬ł

Port of mbomb007's answer.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Goldbach partitions
The Goldbach conjecture states that every even number greater than two can be expressed as the sum of two primes. For example,
4 = 2 + 2
6 = 3 + 3
8 = 5 + 3

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

but it can also be written as
7 + 3

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

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

Your challenge is to write a program or function that finds the Goldbach partition of a number. Now, technically the term "Goldbach partition" is used only to refer to even numbers. However, since the odd integer p + 2 can also be expressed as the sum of two primes if p > 2 is prime, we will extend this to all positive integers (A061358).
You may safely assume that your input will always be a positive integer, and you may take input and output in any of our default allowed methods, for example function arguments and return value, STDIN and STDOUT, reading and writing to a file, etc.
The Goldbach partitions of the positive integers up to 100 are:
0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 2, 1, 2, 1, 3, 0, 3, 1,
3, 0, 2, 0, 3, 1, 2, 1, 4, 0, 4, 0, 2, 1, 3, 0, 4, 1, 3, 1, 4, 0, 5, 1, 4,
0, 3, 0, 5, 1, 3, 0, 4, 0, 6, 1, 3, 1, 5, 0, 6, 0, 2, 1, 5, 0, 6, 1, 5, 1,
5, 0, 7, 0, 4, 1, 5, 0, 8, 1, 5, 0, 4, 0, 9, 1, 4, 0, 5, 0, 7, 0, 3, 1, 6

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

You always come up with such nice challenges :-)

Jelly, 8 bytes
_ÆRÆPSHĊ

Try it online! or verify all test cases.
How it works
_ÆRÆPSHĊ  Main link. Argument: n (positive integer)

 ÆR       Prime range; yield [2, 3, 5, ..., n].
_         Subtract all primes in this range from n.
   ÆP     Compute the primality of the resulting differences.
          This returns 1 for each prime p such that n - p is also prime.
     S    Compute the sum of the resulting Booleans.
      H   Divide it by 2, since [p, n - p] and [n - p, p] have both been counted.
       Ċ  Ceil; round the resulting quotient up (needed if n = 2p).

Oh much better :D

MATL, 8 bytes
tZq&+=Rz

Try it online!
Explanation
Consider input 8 as an example
      % Take input implicitly
t     % Duplicate
      % STACK: 8, 8
Zq    % All primes up to that number
      % STACK: 8, [2 3 5 7]
&+    % Matrix with all pairwise additions
      % STACK: 8, [4  5  7  9
                   5  6  8 10
                   7  8 10 12
                   9 10 12 14]
=     % True for entries that equal the input
      % STACK: [0 0 0 0
                0 0 1 0
                0 1 0 0
                0 0 0 0]
R     % Extract upper triangular part (including diagonal).
      % This removes pairs that are equal up to order
      % STACK: [0 0 0 0
                0 0 1 0
                0 0 0 0
                0 0 0 0]
z     % Number of nonzero entries
      % STACK: 1
      % Display implicitly

It's interesting to observe the graph of the sequence, using a slightly modified version of the code:
:"@       % Input n implicitly. For each k from 1 to n, push k
tZq&+=Rz  % Same code as above. Pushes the result for each k
]v'.'&XG  % End. Concatenate all results into a vector. Plot as dots

For input 10000 the result is

You can try it at MATL Online (Refresh the page if the "Run" button doesn't change to "Kill" when pressed). It takes several about 25 seconds to produce the graph for input 3000; inputs above a few thousands will time out.

That Upper triangular part trick is really cool!

Python 2, 76 bytes
g=lambda n,k=2:n/k/2and all(x%i for x in[k,n-k]for i in range(2,x))+g(n,k+1)

Recursively crawls up from k=2 to n/2, adding up values where both k and n-k are prime. It would be nice to count n down at the same time instead, but this has a problem that k=0 and k=1 are falsely called prime:
g=lambda n,k=0:n/k and all(x%i for x in[k,n]for i in range(2,x))+g(n-1,k+1)

The primality check is trial-division, shortened by checking both k and n-k together. I found this to be shorter than using a Wilson's Theorem generator (79 bytes):
f=lambda n,k=1,P=1,l=[]:n/k and P%k*(n-k in l+P%k*[k])+f(n,k+1,P*k*k,l+P%k*[k])

The idea for this one is to keep a list of all primes in the bottom half to be checked by the time we get to the top half, but for the midpoint k=n/2, we haven't had time to add n-k to out list when we get to k. An iterative version gets around this, but is 82 bytes:
n=input()
s=P=k=1;l=[]
while k<n:l+=P%k*[k];s+=P%k*(n-k in l);P*=k*k;k+=1
print~-s

05AB1E, 6 bytes
;ÅP-pO

Try it online!
Explanation:
                  # implicit input (example: 10)
;                 # divide input by 2 (5)
 ÅP               # primes up to that ([2, 3, 5])
   -              # subtract from the implict input ([8, 7, 5])
    p             # isPrime? ([0, 1, 1])
     O            # sum (2), implicit output

Regex  (ECMAScriptRME / Perl / PCRE), 38 33 32 bytes
^(xx+)(?=\1(x*))(?!\2?(xx+)\3+$)

Try it on replit.com! - ECMAScript (RegexMathEngine)
Try it online! - Perl
Try it online! - PCRE2
Takes its input in unary, as a string of x characters whose length represents the number. Returns its output as the number of ways the regex can match. (The rabbit emoji indicates this output method.)
^                     # tail = N = input number
(xx+)                 # \1 = conjectured first prime, automatically asserted
                      #      to be ≥ 2;
                      # tail = N-\1 == conjectured second prime
(?=
    \1                # tail -= \1; assert that second prime ≥ first prime;
                      # since the first prime is ≥ 2, this automatically
                      # asserts the second also to be so.
    (x*)              # \2 = tail == N-2*\1 == tool to make tail = \1
)
(?!                   # Assert there is no way to make the following match:
    \2?               # either leave tail unchanged, or tail = \1
    (xx+)\3+$         # Assert that tail is composite (which is only the same
                      # as being not prime for numbers ≥ 2)
)

Regex  (ECMAScript 2018 or better), 36 bytes
(?<=(x+x))(?=\1(x*))(?!\2?(xx+)\3+$)

Returns its output as the number of matches.
Try it online! - ECMAScript 2018
Try it online! - Python (import regex)
Try it online! - .NET
Regex  (ECMAScript 2018 or better / Java), 37 bytes
(?<=^(xx+))(?=\1(x*))(?!\2?(xx+)\3+$)

Try it online! - ECMAScript 2018
Try it online! - Java
Try it online! - Python (import regex)
Try it online! - .NET

JavaScript (ES6), 77 73 70 bytes
Saved 3 bytes thanks to @Arnauld
f=(n,x=n)=>--x<2||n%x&&f(n,x)
g=(a,b=a>>1)=>b>1?f(b)*f(a-b)+g(a,b-1):0

f is a primality-test function; the relevant function is g.
f works by recursively counting down from n-1; the control flow at each stage goes like this:

x<2|| If x < 2, the number is prime; return 1.
n%x&& Otherwise if n mod x = 0, the number is not prime; return n%x.
f(n,x-1) Otherwise, the number may or may not be prime; decrement x and try again.

g works in a similar fashion, though with not so much control flow. It works by multiplying f(b) by f(a-b) for each integer b in the range [2, floor(a/2)], then summing the results. This gives us the number of pairs that sum to a where both numbers in the pair are prime, which is exactly what we want.

Since a is positive, b=a>>1 should save you a byte.

@Arnauld Thanks! I should've remembered the >> operator...

Regarding the primality-test function, could you do f=(n,x=n)=>--x<2||n%x&&f(n,x)?

@Arnauld That's genius, thanks :)

GAP, 57 bytes
n->Number([2..QuoInt(n,2)],k->IsPrime(k)and IsPrime(n-k))

I don't think GAP has a shorter way than this obvious one. Number counts how many elements of a list satisfy a predicate.
Using it to compute the first 100 values:
gap> List([1..100],n->Number([2..QuoInt(n,2)],k->IsPrime(k)and IsPrime(n-k)));
[ 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 2, 1, 2, 0, 2, 1, 2, 1, 3, 0, 3, 1,
  3, 0, 2, 0, 3, 1, 2, 1, 4, 0, 4, 0, 2, 1, 3, 0, 4, 1, 3, 1, 4, 0, 5, 1, 4,
  0, 3, 0, 5, 1, 3, 0, 4, 0, 6, 1, 3, 1, 5, 0, 6, 0, 2, 1, 5, 0, 6, 1, 5, 1,
  5, 0, 7, 0, 4, 1, 5, 0, 8, 1, 5, 0, 4, 0, 9, 1, 4, 0, 5, 0, 7, 0, 3, 1, 6 ]

Brachylog, 22 bytes
:{,A:B>=.:#pa+?,.=}fl

Try it online!
Explanation
A straight up transcription of the problem.
:{                }f       Find all valid outputs of the predicate in brackets for the Input
                    l      Output is the number of valid outputs found

  ,A:B>=.                  Output = [A, B] with A >= B
         :#pa              Both A and B must be prime numbers
             +?,           The sum of A and B is the Input
                .=         Label A and B as integers that verify those constraints

Mathematica, 52 bytes
Count[IntegerPartitions[#,{2}]//PrimeQ,{True,True}]&

The result is provided as an anonymous function. Try to plot a graph over it:
DiscretePlot[
 Count[IntegerPartitions[#, {2}] // PrimeQ, {True, True}] &[i], {i, 1,
   1000}]

By the way, the code has the same length with function version of demo code on OEIS.

49 bytes: PrimeQ[#~IntegerPartitions~{2}]~Count~{a=True,a}&

05AB1E, 10 8 bytes
Extremely inefficient.
D!f-pO;î

Try it online!
or Try a less efficient way of generating primes
Explanation
n = 10 used as example.
D          # duplicate
           # STACK: 10, 10
 !         # factorial
           # STACK: 10, 3628800
  f        # unique prime factors
           # STACK: 10, [2,3,5,7]
   -       # subtract
           # STACK: [8,7,5,3]
    p      # is prime
           # STACK: [0,1,1,1]
     O     # sum
           # STACK: 3
      ;    # divide by 2
           # STACK: 1.5
       î   # round up
           # STACK: 2
           # implicit output

Couldn't you use ü instead? Like D!fü+r¢?

@carusocomputing: I don't see how that would work. For the example n=10 that would be count(10, [5,8,12]) which is 0 instead of 2. ü is applied between each pair of items only. It gave me the idea to try ã though, but that turned out 1 byte longer unfortunately.

Vyxal, 6 bytes
½~æ-æ∑

Try it Online! Includes header and footer to produce first 100 results.

Jelly, 12 bytes
HRð,_@ÆPð×/S

TryItOnline
1-100
How?
HRð,_@ÆPð×/S - Main link: n    e.g. 22
H            - halve
 R           - range          [1,2,3,4,5,6,7,8,9,10,11] (note this will be 1 to n//2)
  ð          - dyadic chain separation
   ,         - pair with
    _@       - n -           [[1,2,3,4,5,6,7,8,9,10,11],[21,20,19,18,17,16,15,14,13,12,11]]
      ÆP     - is prime? (1 if prime 0 if not)
                            [[0,1,1,0,1,0,1,0,0,0,1],[0,0,1,0,1,0,0,0,1,0,1]]
        ð    - dyadic chain separation
         ×/  - reduce with multiplication
                             [0,0,1,0,1,0,0,0,0,0,1]
           S - sum           3

Racket 219 bytes
(let*((pl(for/list((i n) #:when(prime? i))i))(ll(combinations(append pl pl)2))(ol'()))(for/list((i ll))(define tl(sort i >))
(when(and(= n(apply + i))(not(ormap(λ(x)(equal? x tl))ol)))(set! ol(cons tl ol))))(length ol))

Ungolfed:
(define(f n)
 (let* ((pl                                   ; create a list of primes till n
          (for/list ((i n) #:when (prime? i))
            i))
         (ll (combinations (append pl pl) 2)) ; get a list of combinations of 2 primes
         (ol '()))                            ; initialize output list
    (for/list ((i ll))                        ; test each combination
      (define tl (sort i >))
      (when (and (= n (apply + i))            ; sum is n
                 (not(ormap (lambda(x)(equal? x tl)) ol))) ; not already in list
        (set! ol (cons tl ol))))              ; if ok, add to list
    (println ol)                              ; print list
    (length ol)))                             ; print length of list

Testing:
(f 10)
(f 100)

Output:
'((5 5) (7 3))
2
'((97 3) (89 11) (83 17) (71 29) (59 41) (53 47))
6

Actually, 11 bytes
;R`p`░@-♂bΣ

Try it online!
Explanation:
;R`p`░@-♂bΣ
 R`p`░       prime values in [1, n]
;     @-     subtract each value from n
        ♂b   convert each value to boolean
          Σ  sum

Haskell, 73 bytes
f n|r<-[a|a<-[2..n],all((<2).gcd a)[2..a-1]]=sum[1|p<-r,q<-r,q<=p,p+q==n]

Usage example: map f [1..25] -> [0,0,0,1,1,1,1,1,1,2,0,1,1,2,1,2,0,2,1,2,1,3,0,3,1].
Direct implementation of the definition: first bind r to all primes up to the input number n, then take a 1 for all p and q from r where q<=p and p+q==n and sum them.


text:
Generate a random digit!
Your task is to generate a random digit following these steps:
First, generate 10 random digits to make a binary number, 50% 0, and 50% 1:
010011001

If it is all zeros, generate a new one.
Convert this to decimal:
153

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

Convert this to decimal:
263

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

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

Do we have to use this algorithm, or does it suffice if the distribution is the same?

@Pietu1998 If you can prove that the distribution is the same, then OK.

BTW, your example for 10 digits has 9 digits

This doesn't actually define a distribution. How should the initial number be generated?

OK, my previous comment might be due to a misunderstanding. Does the generated number have to consist of five 0‘s and five 1's or should 0‘s and 1's follow a u iform distribution?

Hmm good point @Dennis, reading between the lines I think the latter, since otherwise we never get to "If it is all zeros".

What do you mean by the second "convert this to decimal" - isn't 100000111 converted to decimal 263?

I don't know why I even bother anymore, because you clearly don't listen... Use the Sandbox!

Can we assume our random generator is uniform?

Pyth, 23 22 bytes
1 byte thanks to @Jakube (swap r operands).
ehc2`ir9,R=!ZjOS1023T2

Try it online.

First, generate 10 random digits to make a binary number, 50% 0, and 50% 1.
If it is all zeros, generate a new one.
Convert this to decimal.

Generate a number between 1 and 1023. OS1023 in Pyth. Then get its digits: j…T.

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

Pair each digit with an alternating True or False: ,R=!Z. The alternating booleans come from =!Z, or Z = not Z where Z starts as 0. Then run-length decode: r…9.

Convert this to decimal.

Parse integer as binary: i…2.

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

Take the string representation: `. Split it in two, with the possible middle character going to the left: c2. Take the first half's last character: eh.

r9... instead of r...9

Perl, 62 61 55 53 bytes
Get the digit distribution through a lookup table. Implementing the original algorithm is about 15 bytes longer.
perl -E 'say-(map+(--$n)x$_,unpack"W*","\x90leJZaEC_")[rand 1023]'

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

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

05AB1E, 19 bytes
To<L.RvTNèy×}JC2ä¬¤

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

Jelly 17 bytes
⁵Ḷx“ḶƇleJZaEC_‘µX

TryItOnline!
How?
The distribution of the first step are [1,1023] with equal likelihood.
Applying the transformation instructed for each of those numbers produces a distribution of:
{0: 178, 1: 144, 2: 108, 3: 101, 4: 74, 5: 90, 6: 97, 7: 69, 8: 67, 9: 95}
⁵Ḷx“ḶƇleJZaEC_‘µX - Main link: (niladic)
⁵                 - literal 10
 Ḷ                - range -> [0,1,2,3,4,5,6,7,8,9]
   “ḶƇleJZaEC_‘   - code page indexes -> [178,144,108,101,74,90,97,69,67,95]
  x               - repeat - > [178 zeros, 144 ones, 108 twos, ...]
               µ  - monadic chain separation
                X - pick a random element


text:
Print the tetration

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

Given two numbers \$a\$ and \$b\$, print \${}^ba\$.
Test cases
1 2 -> 1
2 2 -> 4
5 2 -> 3125
3 3 -> 7625597484987
etc.

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

What kind of numbers? Positive integers?

Related

Exponentiation is non-associative. You should include at least one test cade with b > 2.

@Dennis 3 3 -> 7625597484987

Can I get the inputs reversed?

@EriktheGolfer Yes

What are the two downvotes for?

So 3^3^3 is 3^(3^(3)) and not (3^3)^3 you have to put ()

@RosLuP No, 3^3^3 automatically means 3^(3^(3)). See https://en.wikipedia.org/wiki/Order_of_operations, where it says "Stacked exponents are applied from the top down, i.e., from right to left."

Related.

Dyalog APL, 3 bytes
*/⍴

TryAPL.
Explanation
*/⍴  Input: b (LHS), a (RHS)
  ⍴  Create b copies of a
*/   Reduce from right-to-left using exponentation

Hey, somebody who's beating @Dennis! Now that's rare! (; :P

J, 5 4 bytes
^/@#

This is literally the definition of tetration.
Usage
   f =: ^/@#
   3 f 2
16
   2 f 1
1
   2 f 2
4
   2 f 5
3125
   4 f 2
65536

Explanation
^/@#  Input: b (LHS), a (RHS)
   #  Make b copies of a
^/@   Reduce from right-to-left using exponentation

Ok a^^b is above reversed b^^a...

@RosLuP Yes, J and APL evaluate from right-to-left, so 2 ^ 2 ^ 2 is evaluated as 2 ^ (2 ^ 2) and so on

Haskell, 19 bytes
a%b=iterate(a^)1!!b

Iterates exponentiating starting at 1 to produce the list [1,a,a^a,a^a^a,...], then take the b'th element.
Same length directly:
a%0=1;a%b=a^a%(b-1)

Point-free is longer:
(!!).(`iterate`1).(^)

Python, 30 bytes
f=lambda a,b:b<1or a**f(a,b-1)

Uses the recursive definition.

Mathematica, 16 bytes
Power@@Table@##&

Explanation
Table@##

Make b copies of a.
Power@@...

Exponentiation.

Jelly, 4 bytes
x*@/

Try it online! or verify all test cases.
How it works
x*@/  Main link. Arguments: a, b

x     Repeat [a] b times.
 *@/  Reduce the resulting array by exponentation with swapped arguments.

Python, 33 bytes
lambda a,b:eval('**'.join([a]*b))

This evaluates to an unnamed function, that takes the string representation of a number and a number. For example:
>>> f=lambda a,b:eval('**'.join([a]*b))
>>> f('5',2)
3125
>>>

If mixing input formats like this does not count, there is also this 38 byte version:
lambda a,b:eval('**'.join([str(a)]*b))

What a cool method!

05AB1E, 9 4 2 bytes
-2 thanks to ovs.
Gm

Try it online! Beats all other answers
Gm  # full program
G   # for N in [1, 2, 3, ...,
    # ..., implicit input...
G   # ...minus 1]...
 m  # push...
    # implicit input...
 m  # to the power of...
    # implicit input...
    # (implicit) or top of stack if not first iteration
    # implicit output

Welcome to the site and impressive first answer! I've edited your TIO link so that it includes an example input. Be sure to check out other recently active challenges as well as our Tips for golfing in 05AB1E page to see if you can shave any bytes off your answer!

Thanks! I did actually end up checking out that page before submitting this answer :)

Does Gm work?

@ovs (－‸ლ) of course it does. Thank you!

Perl, 19 bytes
Includes +1 for -p
Give numbers on separate lines on STDIN
tetration.pl
2
3
^D

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

R, 39 bytes
Recursive function:
f=function(a,b)ifelse(b>0,a^f(a,b-1),1)

Factor, 29 26 bytes
[ 1 rot [ dupd ^ ] times ]

Try it online!
-3 thanks to @Bubbler

26 bytes.

Element, 11 bytes
__2:':1[^]`

Try it online!
This is just "straightforward" exponentiation in a loop.
__2:':1[^]`
__              take two values as input (x and y)
  2:'           duplicate y and send one copy to the control stack
     :          make y copies of x
      1         push 1 as the initial value
       [ ]      loop y times
        ^       exponentiate
          `     print result

JavaScript (ES7), 24 bytes
f=(a,b)=>b?a**f(a,b-1):1

The ES6 version is 33 bytes:
f=(a,b)=>b?Math.pow(a,f(a,b-1)):1

Save 1 byte: f=a=>b=>b?a**f(a,b-1):1

@programmer5000 no, the function call would have to be f(a)(b-1) inside, adding 1 byte and cancelling out the effect.

@ophact You're right, but that's a 4-year-old comment... However, you can really get -3 bytes by calling only the inner function.

dc, 35 29 bytes:
?dsdsa?[ldla^sa1-d1<b]dsbxlap

Here is my first complete program in dc.

GameMaker Language, 52 50 bytes
d=a=argument0;for(c=1;c<b;c++)d=power(a,d)return d

This is my 300th answer :o

GameMaker wtf? lol

@SimplyBeautifulArt Yes, and while I'm at it I'll take off 2 bytes for you.

Lol, nice. =) Have my +1, seems simple enough and I understand it.

@SimplyBeautifulArt Appreciated

PHP, 51 Bytes
for($b=$p=$argv[1];++$i<$argv[2];)$p=$b**$p;echo$p;

Perl, 40 bytes
map{$a=$ARGV[0]**$a}0..$ARGV[1];print$a;

Accepts two integers as input to the function and outputs the result

Use pop to get $ARGV[1], then use "@ARGV" to get $ARGV[0]. Use say instead of print (option -M5.010 or -E is free). But still, ARGV is terribly long. A -p program almost always wins

Actually, 6 bytes
n`ⁿ)`Y

Try it online!
Input is taken as b\na (\n is a newline)
Explanation:
n`ⁿ)`Y
n       a copies of b
 `ⁿ)`Y  while stack changes between each call (fixed-point combinator):
  ⁿ       pow
   )      move top of stack to bottom (for right-associativity)

CJam, 9 bytes
q~)*{\#}*

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

Wonder, 21 bytes
f\@@[#0?^#1f#1-#0 1?1

Uses the recursive approach. Usage:
f\@@[#0?^#1f#1-#0 1?1];f 2 3

Bonus solution, 22 bytes
@@:^ -#0 1(genc ^#1)#1

A slightly unconventional approach. Usage:
t\@@+>#[^;#1]tk -#0 1rpt#1;t 2 3

More readable:
@@
  iget
    - #0 1
    (genc ^#1) #1

Assuming a^^b:
Generates an infinite list of tetrated a; for a=2, this list would look something like [2 4 16 65536...]. Then indexes at b-1 because Wonder is zero-indexed.

Flurry -nii, 14 bytes
{}{{}({})}{{}}

Try it online!
Takes two numbers a b from stdin, and outputs as the return value.
How it works
It works basically like xnor's Haskell answer: repeat (a^) b times to 1. a is left on the stack, so that it can be referenced in each iteration.
// In Church numeral, x a → a^x
main = b power_of_a 1

power_of_a = \x. x a
           = \x. x (push pop)  // assumes a is on the top of the stack,
                               // pops and takes its value and pushes it back

GolfScript, 9 bytes
~])*{\?}*

Try it online!
~]          # Put a and b in an array
  )         # Remove b from the array
   *        # Make b copies of a
    {  }*   # Execute this block for each number in the array
     \?     # Exponentiation

Just {?} would be (3^3)^3 instead of 3^(3^3).

Vyxal r, 4 bytes
This is lyxal's solution
‹(⁰e

Try it Online!
‹(⁰e
‹     Decrement b
 (  ) For loop (second parentheses is implicit) using b-1
  ⁰   Push a
   e  And raise it to the power of the accumulator (initially a)

Vyxal, 6 5 bytes
Saved 1 byte thanks to lyxal
ʁ•⁽eḭ

Try it Online!
This one is a worse solution. a is inputted as a singleton list.
ʁ•λe;ḭ
ʁ      Make a range [0,b) (only the length of the range matters (b))
 •     Reshape [a] to that (make a list of b a's)
     ḭ Reduce from the right
  λe;  using exponentiation

5 bytes

4 bytes

Red, 38 26 37 bytes
Thanks to @9214 for telling me about the loop command for -12 bytes.
+11 bytes to fix invalidities brought out by @Bubbler.
func[a b][x: a loop b - 1[x: a ** x]]

Try it online!

Tip: you can simplify it down to 27 with loop.

@9214 Thanks, that is exactly the command I needed, and apparently, it returns a value, so I can even simplify it down to 26 bytes!

Gah, I said 27 because of the missed space after 1...

Is this answer valid without func[a b] part? Because it looks like, say, omitting lambda a,b: part in Python, which is invalid (makes the answer a snippet with a and b hardcoded).

@Bubbler Fixed. I think I understand now how function submissions work. Thanks for pointing that out!

K (ngn/k), 7 bytes
(*/#)/#

Try it online!
Takes two inputs in the order of [hyperexponent; base] and returns the result.
K does not have exponentiation built-in, so I simulate n^m with "product */ of m copies # of n" instead. Tetration is basically the same, in the sense that it is a fold by exponentiation. K's fold is left to right, and */# accepts [exponent; base], so the direction of exponentiation is correctly y^(y^(y^...)).
Although it does not use exponentiation built-in, it fails to solve this challenge because 4^(4^4) is way too big to handle with built-in integer sizes.

Pyth, 6 bytes
u^QGE1

Try it online.
Explanation
          (implicit: input a to Q)
     1    Start from 1.
u   E     b times,
 ^GQ      raise the previous number to power a.

Minkolang 0.15, 12 11 bytes
nnDI1-[;]N.

Try it here!
Explanation
nn             Read two integers from input
  D            Pop top of stack and duplicate next element that many times
   I1-         Push length of stack, minus 1
      [        Pop top of stack and repeat for loop that many times
       ;       Pop b, a and push a^b
        ]      Close for loop
         N.    Output as number and stop.

Racket 51 bytes
(define ans 1)(for((i b))(set! ans(expt a ans)))ans

Ungolfed:
(define (f a b)
  (define ans 1)
  (for((i b))
    (set! ans
          (expt a ans)))
  ans)

Testing:
(f 1 2)
(f 2 2)
(f 5 2)
(f 3 3)

Output:
1
4
3125
7625597484987

Scala, 45 bytes
Seq.fill(_:Int)(_:Double)reduceRight math.pow

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

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

TI-Basic, 19 bytes
Prompt A,B
A
For(C,2,B
A^Ans
End

C, 50 bytes
double t(int x,int n){return n?pow(x,t(x,n-1)):1;}

Straightforward from the definition of Tetration.

Axiom 70 bytes
l(a,b)==(local i;i:=1;r:=a;repeat(if i>=b then break;r:=a^r;i:=i+1);r)

this less golfed
l(a,b)==
  local i
  i:=1;r:=a;repeat(if i>=b then break;r:=a^r;i:=i+1)
  r

(3) ->  [l(1,2),l(2,2),l(5,2),l(3,3),l(4,3)]

     (3)
     [1, 4, 3125, 7625597484987,
      13407807929942597099574024998205846127479365820592393377723561443721764030_
       0735469768018742981669034276900318581864860508537538828119465699464336490_
       06084096
       ]
                                                   Type: List PositiveInteger

8 bytes would be reduced if local i; could be removed.

Bash, 50 bytes
(within the bounds of bash integer data type)
Golfed
E() { echo $(($(printf "$1**%.0s" `seq 1 $2`)1));}

Explanation
Build expression with printf, e.g. E 2 5:
  2**2**2**2**2**1

then use bash built-in arithmetic expansion to compute the result
Test
E 1 2
1

E 2 2
4

E 5 2
3125

E 3 3
7625597484987

Powershell, 68 Bytes
filter p ($a){[math]::Pow($a,$_)};iex (,$args[0]*$args[1]-join"|p ")

This is the shortest of the three approaches I tried, not that great overall though, i'm 100% sure there's a shorter approach but the few things I tried somehow ended up with slightly more bytes.
PS C:\++\golf> (1,2),(2,2),(5,2),(3,3) | % {.\sqsq $_[0] $_[1]}
1
4
3125
7625597484987

Sadly Powershell has no built-in ^ or ** operator, or it would be a clean 32/33 byte answer, i.e.
iex (,$args[0]*$args[1]-join"^")

Java 7, 71 57 bytes
double c(int a,int b){return b>0?Math.pow(a,c(a,b-1)):1;}

Ungolfed & test code:
Try it here.
class M{
  static double c(int a, int b){
    return b > 0
            ? Math.pow(a, c(a, b-1))
            :1;
  }

  public static void main(String[] a){
    System.out.println(c(1, 2));
    System.out.println(c(2, 2));
    System.out.println(c(5, 2));
    System.out.println(c(3, 3));
  }
}

Output:
1.0
4.0
3125.0
7.625597484987E12

Clojure, 56 bytes
(fn[a b](last(take a(iterate #(apply *(repeat % b))b))))

Maybe there is a shorter way via apply comp?

Funky, 27 bytes
f=(a,b)=>(b<2)?a:a^f(a,b-1)

Try it online!

Thunno 2 t, 3 bytes
ọƲ@

Try it online!
Explanation
ọƲ@  # Implicit input
ọ    # Repeat [a] b times
 Ʋ   # Reduce the list by:
  @  #  Swapped exponentiation
     # Implicit output

Raku, 16 bytes
{[**] $^a xx$^b}

Try it online!
$^a and $^b are the arguments to this anonymous function.  $^a xx $^b is a list of the first argument replicated a number of times given by the second argument.  [**] reduces that list with the exponentiation operator.  The reduction respects the right-associativity of the operator.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/