text:
Reverse-ish a string!
Your task: write a program/function that when given a string containing only ASCII characters, outputs/returns the string in reverse-ish.
Example:
1) Input
Hello, World!

2) Number unique characters in input. (Input string separated by pipes (|) for readability)
H|e|l|l|o|,| |W|o|r|l|d|!
1 2 3   4 5 6 7   8   9 10

3) For duplicate characters, find the first occurrence of that character and number the duplicate character with the same number as the first.
H|e|l|l|o|,| |W|o|r|l|d|!
1 2 3 3 4 5 6 7 4 8 3 9 10

4) Reverse the string, but not the numbers.
!|d|l|r|o|W| |,|o|l|l|e|H
1 2 3 3 4 5 6 7 4 8 3 9 10

5) Delete the characters above repeat numbers. (Deleted characters represented with an asterisk.)
!|d|l|*|o|W| |,|*|l|*|e|H
1 2 3 3 4 5 6 7 4 8 3 9 10

6) Replace the deleted characters with the character that appears over the first occurrence of the number that the deleted character is over.
!|d|l|l|o|W| |,|o|l|l|e|H
1 2 3 3 4 5 6 7 4 8 3 9 10

7) Output
!dlloW ,olleH

Test cases:
Input -> Output
"Hello, World!" -> "!dlloW ,olleH"
"18464399" -> "99343488"
"Code Golf" -> "floG eloC"
"abcdefgABCDEFG" -> "GFEDCBAgfedcba"
"Mmm, marshmallows" -> "swwllwmhsrwm  mms"
"15147" -> "74751"

For those who can see deleted posts, the sandbox was here.

Is the string guaranteed to only contain ASCII characters?

@LeakyNun Yes, I will edit.

Pyth, 1 byte
X

Verify all the test cases.
Pyth has wonderful built-ins :-)

Pyth,  8  7 bytes
sm@_QxQ

Verify all the test cases.
How it works
This is the more interesting non-built-in approach.
sm@_QxQ  - Full program.

 m       - Map over the input.
  @_Q    - Get the index in the reversed input.
     xQ  - Of the first index of each character in the String.
s        - Join the list.

Why does Pyth have this as a built in?  How is it useful other than this question?

@JerryJeremiah You can read more about this function here. It is the translate function in Pyth, but if the third argument is missing, the reverse of the second argument is used instead.

Python 2, 46 41 bytes
-5 bytes thanks to Artyer

lambda x:''.join(x[~x.find(n)]for n in x)

Try it online!

You can just do lambda x:''.join(x[~x.find(n)]for n in x) instead of reversing then indexing

Jelly, 5 bytes
iÐ€ịṚ

Try it online!

CJam, 7 bytes
q__W%er

Try it online!
Explanation
q   e# Read all input.
__  e# Make two copies.
W%  e# Reverse the third copy.
er  e# Transliterate the input, mapping the input to its own reverse. Due
    e# to the way transliteration works in CJam, if a character in the source
    e# of the mapping is repeated, all but the first occurrence of that
    e# character are ignored.

I wish Jelly's y worked like that.

@EriktheOutgolfer I wish Alice's y worked like that. :P

MATL, 6 bytes
PGt&m)

Try it online!
           implicit input
P          flip
 Gt        paste input back to stack and dup
   &m      alternate ismember, returns duplicated indices
     )     apply indices to the reversed char array
           implicit output, print as char

05AB1E, 2 bytes
R‡

Try it online!
Explanation:
R‡
R  Reverse input
 ‡ Transliterate the input with itself and its reverse (as above) (it only keeps first occurrences)

Alice, 17 bytes
/?.R?y.@
\i.!yDo/

Try it online!
Explanation
/...@
\.../

This is just the usual template for linear code in Ordinal mode. If we unfold this, the actual program simply becomes:
i.!?D.?.Ryyo

The idea here is similar to that of my CJam answer. Since Alice has no easy way of indexing into strings with integers, it's easiest to replicate this behaviour with transliteration (y in Alice). However, Alice's transliteration semantics are a lot more general than CJam's, which means that Alice doesn't just disregard repeated mappings. For example, if we just wanted to transliterate Mmm, marshmallows to its reverse, this would represent the following list of mappings:
M -> s
m -> w
m -> o
, -> l
  -> l
m -> a
a -> m
r -> h
s -> s
h -> r
m -> a
a -> m
l ->
l -> ,
o -> m
w -> m
s -> M

Note that we've got, for example, m -> w, m -> o, m -> a and m -> a. CJam would just discard all except the first mapping, but Alice would instead cycle through these. So the first m would be mapped to w, the second to o, the fifth again to w and so on. In this case that isn't helpful, because in general if we perform y on AAB (for some strings A and B) as we did in CJam, we'll always just get B in Alice.
So how do we compute a mapping that works for y (i.e. how do we discard the repeated mappings manually)? Of course, by using another transliteration. :)
The source of the mapping we want has to be the nub of the input (i.e. the deduplicated input). If we apply the above mapping to the nub, then each character only appears once, so we're only making use of the first of each of the repeated mappings. So by transliterating the nub with the input and its reverse, we're effectively simply discarding the duplicated mappings. We can then use the nub and this new result as a mapping for the original input. I'm sure that made sense to someone...
So the code:
i   Read input.                   ["Mmm, marshmallows"]
.!  Store a copy on the tape.
?D  Push the nub of the input.    ["Mmm, marshmallows" "Mm, arshlow"]
.   Duplicate.                    ["Mmm, marshmallows" "Mm, arshlow" "Mm, arshlow"]
?   Retrieve input.               ["Mmm, marshmallows" "Mm, arshlow" "Mm, arshlow" "Mmm, marshmallows"]
.R  Push its reverse.             ["Mmm, marshmallows" "Mm, arshlow" "Mm, arshlow" "Mmm, marshmallows" "swollamhsram ,mmM"]
y   Transliterate.                ["Mmm, marshmallows" "Mm, arshlow" "swllmhsr mm"]]
y   Transliterate.                ["swwllwmhsrwm  mms"]
o   Output.                       []

JavaScript ES6 50 bytes
3 bytes saved thanks to Justin Mariner
s=>[...s].map(x=>s.slice(~s.indexOf(x))[0]).join``

Test it:

f=s=>s.split``.map(x=>s.slice(~s.indexOf(x))[0]).join``

let inp = document.getElementById("inp");
let out = document.getElementById("out");

function change() {
  out.innerText = f(inp.value);
}

change();
<input id="inp" type="text" oninput="change()" value="Hello, World!" />

You can save another 3 bytes by using s.replace(/./g,...) instead of [...s].map(...).join\``

Pyke, 7 bytes
L@Q_M@s

Try it here!
L@      - Get the index of the first index of each character.
  Q     - Push the input to the stack.
   _    - Reverse it.
    M@  - Get the element at (each) position in ^^^ in ^.
      s - Join.

Perl 5, 23 + 1 (-p) = 24 bytes
eval"y/$_/".reverse."/"

Try it online!
Thanks to @MartinEnder's Alice entry for the transliteration idea

Java 10, 100 99 97 bytes
s->{var a=new char[256];int l=s.length,i=l;for(;i>0;a[s[--i]]=s[l+~i]);for(;i<l;s[i]=a[s[i++]]);}

Port of @LeakyNun's C answer. I doubt it can be done shorter without doing something similar in Java.
-1 byte thanks to @ceilingcat.
Input as char[] (character-array), and modifies this input instead of returning a new one to save bytes.
Try it here.

R, 68 65 bytes
function(s)chartr(paste(rev(el(strsplit(s,''))),collapse=''),s,s)

Verify test cases!
Ports Erik's 05AB1E method for 3 bytes less. It wasn't the first, but it was the first one I saw.
old version:
function(s)paste(rev(s<-el(strsplit(s,'')))[match(s,s)],collapse='')

Verify all test cases -- prints out the vector with the input as names and the output in quotes below.
A fairly naive implementation, but I don't think this gets shorter in R (and I look forward to being wrong about that). It's essentially an R port of Rod's python answer but it was developed independently.
Ungolfed explanation:
function(s){
 s <- el(strsplit(s,''))      # string to characters
 r <- rev(s)                  # reverse s
 idx <- match(s,s)            # indices of first matches
 r <- r[idx]                  # do the replacement of duplicates
 paste(r, collapse = "")      # characters to string
}                             # implicit return of last evaluated statement

C (gcc), 98 bytes
i,n,a[256];char*f(char*c){n=strlen(c);for(i=n;i>0;i--)a[c[i-1]]=c[n-i];for(;i<n;i++)c[i]=a[c[i]];}

Try it online!
Argument must be a modifiable string; string is modified in-place.

88 bytes

Vyxal, 3 bytes
Ṙ$Ŀ

Try it Online!

Röda, 27 bytes
f x{x|[x[-1-indexOf(_,x)]]}

Try it online!
This takes a list of characters as input and returns a stream of characters.
Using string datatype (40 bytes):
f x{x=x/""x|[x[-1-indexOf(_,x)]]|concat}

Try it online!

Arturo, 39 bytes
$->s->map s'n->s\[dec-size s index s n]

Try it

Scala, 61 bytes
Try it online!
def f(x:String)=x.map(c=>x(x.length-1-x.indexOf(c))).mkString


text:
Golf the pseudoprimes!
Introduction / Background
In a recent discussion in the crypto chat I was challenged to discuss / help with the Fermat primality test and Carmichael numbers. This test is based on the premise that a^(p-1) mod p==1 will always hold for primes p, but not always for composites. Now a carmichael number is essentially the Fermat's test worst enemy: A number for which you have to pick a to be not co-prime with p to get a^(p-1) mod p!=1. Now if a is not co-prime, you essentially found a non-trivial factor of p and as we all know factoring can be quite hard. Especially if all factors are sufficiently large. You may now realize why the Fermat test isn't used in practice as often (well there are better algorithms), it's because there are numbers for which you as a defender (in security terms) would have to do a similar amount of work as an attacker (namely factor the number).
So now that we know why these numbers are somewhat fascinating, we're gonna generate them in the shortest way possible, so we can just memorize the generating code if we ever need any!
Carmichael numbers are also known as A002997 on OEIS.
There is a related challenge already, but entries from there are not competitive here because they are optimized for speed as opposed to size. The same argument holds for the inverse direction, entries here are likely to make trade-offs against speed in favor of size.
Specification
Input
This is a standard sequence challenge, so you take a positive or non-negative integer n as input. n may be 0- or 1-indexed as you prefer (please indicate).
Output
Your output will either be the n-th carmichael number or the first n carmichael numbers, as you prefer (please indicate).
Specification
An integer x is a Carmichael number if and only if x is composite and for all integers y with gcd(x,y)=1, it holds that y^(x-1) mod x==1.
Who wins?
This is code-golf, so the shortest code in byte wins! Standard IO and loophole rules apply.
Test Cases
The first few carmichael numbers are:
 561,1105,1729,2465,2821,6601,8911,10585,15841,
 29341,41041,46657,52633,62745,63973,75361,101101,
 115921,126217,162401,172081,188461,252601,278545,
 294409,314821,334153,340561,399001,410041,449065,
 488881,512461

Mathematica, 71 bytes
(t=s=1;While[t<=#,If[++s~Mod~CarmichaelLambda@s==1&&!PrimeQ@s,t++]];s)&

Try it online!
50->1461241 Try it online!

Mathematica is now on TiO, so if anyone is interested you can try it online!

@Mr.Xcoder Hey!That's great! I added (my first)  mathematica TIO

Python 2, 92 bytes
f=lambda j,n=1:j and f(j-([(k/n)**~-n%n for k in range(n*n)if k/n*k%n==1]<[1]*~-n),n+1)or~-n

Try it online!
1-indexed and slow as molasses.
In the list comprehension, I use Dennis’s method for generating all integers coprime to n (n’s totatives), and then I compute x**~-n%n for all of them. Let’s call this list L.
To detect a Carmichael number, I compare this list lexicographically to a list consisting of n-1 ones. Why does this work?
Each element of L is a positive integer: (k/n) is coprime to n, so (k/n)**~-n also is, so (k/n)**~-n%n > 0. Thus, the only possible values of L that are lexicographically less than [1]*(n-1) are the ones consisting entirely of less than n-1 ones. (L can’t contain more than n-1 values, as n can’t have more than n-1 totatives! So comparisons like [1,1,1,1,3] < [1,1,1,1] are out.)
Checking that there are less than n-1 entries in L ensures that n is composite. (Having n-1 totatives is an equivalent condition to primality.) And then, the condition for being a Carmichael number is exactly that every element of L equals 1. So this lexicographic comparison detects exactly the Ls we’re interested in.
Mr. Xcoder saved a byte by switching to recursive lambda form: j counts down every time we hit a Carmichael number, and n counts up every time we recurse. So once j hits zero, n-1 equals the original_value_of_j’th Carmichael number.

Jelly,  12  11 bytes
-1 byte thanks to miles & Mr. Xcoder (use of Carmichael function atom & a golf thereof)
%Æc’=ÆP
⁹Ç#

A monadic link taking n and returning a list of the first n Carmichael numbers.
Try it online!
How?
Much like the previous (below) except that there is a built-in for the Carmichael function - which yields the smallest power such that the input raised to that power is congruent to one modulo that power for all integers co-prime to that integer. Thus we may exclude the false-positives (primes) in less bytes and have faster code!
%Æc’⁼ÆP - isCarmichael: number, n (any integer)
 Æc     - Carmicael function of n
%       - n modulo that
   ’    - decremented (0 for Carmichael numbers and primes)
     ÆP - is n prime? (1 for primes 0 otherwise)
    ⁼   - equal?

⁹Ç# - Main link: number, n
  # - count up finding the first n values satisfying:
 Ç  - ...condition: call the last link as a monad
⁹   - ...starting with a value of: literal 256

Previous 12 bytes:
Ṗ*%⁼Ṗ_ÆP
⁹Ç#

Try it online! (Yeah, it times out for n=3).
How?
A number, c, is a Carmichael number if it is composite and it is true that any integer, x, raised to c is congruent to x modulo c.
We only need to check this for positive x up to x=c itself.
Note also that at x=c the check is whether x raised to the power of x is congruent to x modulo x, which is true - so we don't need to check this (this makes for shorter code).
Ṗ*%⁼Ṗ_ÆP - Link 1, isCarmichaelNumber: integer c (greater than 1)
Ṗ        - pop c (uses the implicit range(c)) = [1, 2, 3, ..., c-1]
 *       - raise to the power of c (vectorises) = [1^c, 2^c, 3^c, ..., (c-1)^c]
  %      - modulo by c (vectorises) = [1^c%c, 2^c%c, 3^c%c, ..., (c-1)^c%c]
    Ṗ    - pop c = [1, 2, 3, ..., c-1]
   ⁼     - equal? (non-vectorising) = 1 if so, 0 if not
      ÆP - isPrime?(c) = 1 if so, 0 if not
     _   - subtract = 1 if Carmichael 0 if not
         -     (Note the caveat that c must be an integer greater than 1, this is because
         -      popping 1 yields [] thus the equality check will hold; same for 0,-1,...)

⁹Ç# - Main link: number, n
  # - count up finding the first n values satisfying:
 Ç  - ...condition: call the last link as a monad
⁹   - ...starting with a value of: literal 256

Also 12 bytes but computes the first 33 in under a minute by using the Carmichael atom.

11 bytes by using the built-in Carmichael function.

@Mr.Xcoder I was going to suggest miles posted separately, then saw yours then saw your comment and delete. The dv may be because someone thinks it's too similar to miles' commented one rather than this one, but I think even that is an odd reason since there is no reason to think that you did not find the same thing independently (I know I've done that kind of thing many times). I'll post your 11 if you want, but am of the opinion you or miles should take some credit.

@miles too ...^

@JonathanAllan Just post it yourself. Mention miles' and my contribution, and I don't think miles minds either :-) (BTW I didn't even see miles' comment :-/ before posting my answer)

RegexMathEngine (ECMAScript+(?^=)), 59 bytes
^((?=(x(x+?))\2*$)(?^=x\3*$)(?=(x+)(\4+$))\5(?!\2*$)){2,}x$

Try it on replit.com! - sequence harness (RegexMathEngine)
A regex takes a number as input in unary, as a string of x characters whose length represents the number. Its output is a match iff the number is a Carmichael number.
This is launched in RegexMathEngine's sequence mode to satisfy the challenge's specifications, outputting the first n Carmichael numbers, where n can be given either as a command-line argument or through standard input.
Korselt's criterion is used to identify Carmichael numbers.
^                      # tail = N = input number
# Assert that N has at least 2 unique prime factors, and that each of its prime
# factors P are of exactly single multiplicity (i.e. that N is square-free), and
# for each, P-1 divides N-1.
(
    (?=(x(x+?))\2*$)   # \2 = smallest prime factor of tail; \3 = \2-1
    (?^=x\3*$)         # Lookinto – Assert \3 divides N-1
    (?=(x+)(\4+$))     # \4 = tail / \2 (implicitly); \5 = tool to make tail = \4
    \5                 # tail = \4
    (?!\2*$)           # Assert that tail is no longer divisible by \2, i.e. that
                       # that prime factor was of exactly single multiplicity.
){2,}                  # Iterate the above at least 2 times, with no maximum
x$                     # Assert tail == 1

Regex (ECMAScript 2018 or better), 59 bytes
^((?=(x(x+?))\2*$)(?=(x+)(\4+$)(?<=^\3*x))\5(?!\2*$)){2,}x$

A port of the lookinto version, to variable-length lookbehind.
decision-problem harnesses:
Try it online! - ECMAScript 2018
Try it online! - Python (import regex)
Try it online! - .NET
Regex (ECMAScript 2018 or better / Java), 66 bytes
^((?=(x(x+?))\2*$)(?<=(?=x\3*$)^.*)(?=(x+)(\4+$))\5(?!\2*$)){2,}x$

Java's lookbehind is restricted, but is able to do a simple return to start as is done here.
decision-problem harnesses:
Try it online! - ECMAScript 2018
Try it online! - Java
Try it online! - Python (import regex)
Try it online! - .NET
Regex (ECMAScript), 86 89 85 bytes
-4 bytes by changing (?=A)(?!B) to (?!B)A; on some regex engines this results in a slowdown, but RegexMathEngine optimizes this so there is no difference in speed
^(?!(x(x+))(?!\2*$)\1*(?!(xx+)\3+$)\1$)((?=(xx+?)\5*$)(?=(x+)(\6+$))\7(?!\5*$)){2,}x$
Try it on replit.com! - sequence harness (RegexMathEngine, ECMAScript mode)
decision-problem harnesses (ECMAScript):
Try it online! (slow 85 byte version)
Try it online! (faster 89 byte version)
^                      # tail = N = input number
(?!                    # Negative lookahead – assert that neither of the
                       # following two alternatives can match:
    # Cycle through factors \1, with \2 = \1-1, for which \2 does not divide N-1
    (x(x+))            # \1 = conjectured factor of N; \2 = \1-1
    (?!\2*$)           # Assert N-1 is not divisible by \2
    \1*                # Assert N is divisible by \1 - works along with the
                       # subsequent "\1$"; tail = \1
    # If the factor \1, which already passed the above tests, is prime, then
    # fail the outside negative lookahead, because N is not a Carmichael number.
    (?!(xx+)\3+$)
    \1$
)
# Assert that N has at least 2 unique prime factors, and that all of its prime
# factors are of exactly single multiplicity (i.e. that N is square-free).
(
    (?=(xx+?)\5*$)     # \5 = smallest prime factor of tail
    (?=(x+)(\6+$))     # \6 = tail / \5 (implicitly); \7 = tool to make tail = \6
    \7                 # tail = \6
    (?!\5*$)           # Assert that tail is no longer divisible by \5, i.e. that
                       # that prime factor was of exactly single multiplicity.
){2,}
x$

The main magic of this regex is in the part that asserts that all of the prime factors of N are of exactly single multiplicity. It is the same trick as used by my Match strings whose length is a fourth power and Find the Smoothest Number regexes: repeated implicit division by the smallest prime factor.
Regex (ECMAScript), 97 93 92 90 bytes
-4 bytes by changing (?=A)(?!B) to (?!B)A; on some regex engines this results in a slowdown
-1 byte by using \b to streamline searching through all divisors of N
-2 bytes by excluding 1 as a divisor in the square test rather than the divisor search
^(?!(x(x+))(?!\2*$)\1*(?!(xx+)\3+$)\1$|(x*)\4*(?=\4\b)(x(x+))(?=(\5*)\6+$)\5*$\7)(xx+)\8+$
It's also possible to directly test that N has no perfect-square factors (i.e., that N is square-free). This uses a variant of the multiplication algorithm explained in this post, adapted to asserting that \$A^2=C\$.
Using that algorithm on this problem does not provide any benefit, however. It results in a slower regex, with a larger size. Without the prime multiplicity test (which in one loop asserts both that there are at least 2 prime factors and that they are each of single multiplicity), we have to separately assert that N is composite.
Try it on replit.com! - sequence harness (RegexMathEngine, ECMAScript mode)
decision-problem harnesses (ECMAScript):
Try it online! (Slow 90 byte version)
Try it online! (Faster 94 byte version)
^                      # tail = N = input number
(?!                    # Negative lookahead – assert that neither of the
                       # following two alternatives can match:
    # Cycle through factors \1, with \2 = \1-1, for which \2 does not divide N-1
    (x(x+))            # \1 = conjectured factor of N; \2 = \1-1
    (?!\2*$)           # Assert N-1 is not divisible by \2
    \1*                # Assert N is divisible by \1 - works along with the
                       # subsequent "\1$"; tail = \1
    # If the factor \1, which already passed the above tests, is prime, then
    # fail the outside negative lookahead, because N is not a Carmichael number.
    (?!(xx+)\3+$)
    \1$
|
    # Assert that N isn't square-free, i.e. has at least one divisor >1 that is
    # a perfect square (outside the negative lookahead, assert the opposite).
    (x*)\4*(?=\4\b)    # cycle tail through all divisors of N, including N itself

    # Match iff tail is a perfect square
    (x(x+))            # \5 = potential square root >= 2; \6 = \5 - 1
    (?=
        (\5*)\6+$      # iff \5 * \5 == our number, then the first match here must result in \7 == 0
    )
    \5*$\7             # test for divisibility by \5 and for \7 == 0 simultaneously
)
(xx+)\8+$              # Assert that N is composite

(Strictly speaking, this is a decision-problem answer, but the challenge is a sequence challenge.) Presumably in a more powerful regex variant there would be a more direct test for square divisors available?

@Neil You're right, I can golf it down by directly testing for square divisors. In ECMA, no extra features needed. But that will make it much slower (and I'll also want to hide it under a spoiler tag). I'll want to include both versions, I think.

Yes, it's very annoying finding questions for regexes I've already written, that are not right right type of challenge. Should I delete my answer?

@Neil Here you go. I implemented the algorithm using your idea. This is probably why I didn't think to pursue it on my own though; it actually results in a longer regex, because an is-composite test is needed.

(Under site rules you should delete your answer, yes.) My idea was that using extra features of, say, Retina regexes, you could golf it down to ^(?!(x(x+))(?!\2*$)\1*(?=\1$)(?!(xx+)\3+$)|((^x|xx\5){2,})\4*$)(xx+)\6+$, or maybe even less than 72 bytes.

@Neil Nice job making a .NET/Perl/PCRE regex for this problem. This is an ECMAScript regex and the whole idea and beauty of it is to do the job with a more limited set of operations. Forward references trivialize a lot of things. (And once I get my regex engine up on TIO, it won't be a rule violation anymore to submit pure regexes to [tag:sequence] but non-[tag:decision-problem] problems.)

If your regex engine has a flag which makes it find the nth or first n match(es), then I think that counts as a valid solution, as long as you specify that in your answer, even if it's not yet available on TIO. (Had you not had that option, my idea would have been to convert to a Retina sequence answer, but I might try to do that myself now.)

Let us continue this discussion in chat.

J, 72 59 51 bytes
1{(((0>.-)0&p:*~:@q:-:0=q:|&<:])([,(+*)~)])/^:_@,&2

Try it online!

Haskell, 95 bytes
s=filter
c n=s(\x->let l=s((1==).gcd x)f;f=[1..x-1]in l/=f&&all(\y->y^(x-1)`mod`x==1)l)[1..]!!n

Try it online!
Degolfed:
-- function to filter out Carmichael numbers
filterFunction x =
    let coprimes = filter ((1 ==) . gcd x) lesserNumbers
        lesserNumbers = [1 .. x - 1]
    in
        -- the number x is Carmichael if it is not prime
        lesserNumbers /= coprimes &&
            -- and all of its coprimes satisfy the equation
            all (\y -> y ^ (x - 1) `mod` x == 1) coprimes

-- get n'th Carmichael number (zero-based)
c n = filter filterFunction [1..] !! n

Retina, 94 90 81 bytes
\d*$
x
"$+"}/^((?=(x(x+?))\2*$)(?=(x+)(\4+$)(?<=^\3*x))\5(?!\2*$)){2,}x$/^+`$
x
x

Try it online! 1-indexed. Edit: Saved 4 13 bytes by porting @Deadcode's latest Carmichael test, which is also slightly less slow, but still times out for n>6 on TIO. crossed out 4 is still regular 4 Explanation:
\d*$
x

Increment the current value. On the first pass, this also deletes n from the output buffer (but $+ can still access it).
/^((?=(x(x+?))\2*$)(?=(x+)(\4+$)(?<=^\3*x))\5(?!\2*$)){2,}x$/

Test whether the current value is a Carmichael number. This uses @Deadcode's latest regex.
^+`

Repeat until the current value is a Carmichael number.
$
x

Increment the current value.
"$+"}

Repeat the initial increment and above loop n times.
x

Convert the result to decimal.

You can save 4 bytes by using a golf I just applied to my regex.

You should also be able to get another -1 byte by changing (^x|xx\5){2,} to (^x\B|xx\5)+, but it doesn't seem to be working. Any idea why?

@Deadcode But then it will only solve n=1 on TIO... I guess that's technically still valid...

@Deadcode (^x\B|xx\5)+ only enforces 2 xs but you need to enforce 4.

Oh, I get it now. It's not quite what you said, because even (^x(?=xxx)|xx\5)+ wouldn't work. It can see 4 xs but still only loop for 1 iteration thus capturing only 1 x.

@Deadcode Oh, right, because it could backtrack anyway. If it had been matching an exact square, you could have made it atomic, but of course that's getting even further away from the simple {2,}...

81 bytes, and it's fast enough to easily do the 5th now, and even get the 6th in 49 seconds (linked).

source: Stack Exchange

license: 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/

sort: votes


text:
Writing rational numbers as ratio of factorials of primes
Note: this challenge has been posted on the sandbox.
Introduction
This challenge is inspired by 2009 Putnam B1, a problem in an undergraduate mathematics competition. The problem is as follows:

Show that every positive rational number can be written as a quotient of products of factorials of (not necessarily distinct) primes. For example,

Challenge
Your challenge is to take a pair of relatively prime positive integers, representing the numerator and denominator of a positive rational number (or just the rational number itself) as input, and output two lists (or arrays, etc.) of prime numbers so that the inputted rational number is equal to the ratio of the product of the factorials of the primes in the first list to the product of the factorials of the primes in the second list.
Notes

There may not be any primes that contained both in the first list and in the second list; however, a prime may appear as many times as one wishes in either list.
The inputs can be assumed to each be (nonstrictly) between 1 and 65535; however, it cannot be assumed that the factorials of the numbers you will need to output will be in this range.

Example Input and Output
Here are examples of legal inputs and outputs.
input=>output
10,9 => [2,5],[3,3,3]
2,1 => [2],[]
3,1 => [3],[2]
1,5 => [2,3,2],[5]     (elements of a list may be in any order)
3,2 => [3],[2,2]
6,1 => [3],[]

The inputs (2,2), (0,3), (3,0), (3,6) and (1,65536) are illegal inputs (i.e. your program doesn't need to behave in any particular way on them). Here are some examples of illegal outputs:
1,2 => [2],[2,2] (2 is in both returned lists)
5,2 => [5],[2,4] (4 is not prime)
2,1 => [2],[1] (1 is not prime either)
3,2 => [3],[2] (3!/2! = 3, not 3/2)

Scoring
This is code-golf, so the lowest score in bytes wins!

Does some sort of minimally reduced rational need to be given in the event there are multiple ways of expressing the answer?  For example 10/9 = [2*5]/[3*3] = [(2!/1!) * (5!/4!)] / [(3!/2!) * (3!/2!)] = [2! * 5! * 2! * 2!] / [3! * 3!  * 1! * 4!] = (2! * 2! * 2! *5!) / (3! * 3! * 4!).

@DigitalTrauma No; however, 4 is not prime, so the second one would not be valid. I believe (and can write up a proof in the question if you'd like) that any representation is unique.

Is it okay to take input as the fraction 10/9 rather than a pair of numbers 10 and 9?

@MishaLavrov Sure. I'll edit the question to reflect that.

@CarlSchildkraut Thanks - yes that helps - I thought I was missing something

Any reason there's a dot underneath the fraction bar in the image at the top?

@Challenger5 It's a period, part of the TeX from which I found the image on the Art of Problem Solving page that this problem is listed.

05AB1E, 54 53 48 46 40 35 33 32 28 bytes
[D¿÷Z#DÓ€gZD<ØŠQ*DˆR!*]¯øεʒĀ

Try it online! Edit: Saved 2 bytes thanks to @ASCII-only. Saved 1 2 3 4 bytes thanks to @Emigna. (I only need to save one more and I'm down to half my original byte count!) Explanation:
[       Begin an infinite loop
D¿÷     Reduce to lowest terms
Z#      Exit the loop if the (largest) value is 1
DÓ€g    Find the index of the largest prime factor of each value
Z       Take the maximum
D<ØŠ    Convert index back to prime and save for later
Q       Convert to an pair of which value had the largest prime factor
*       Convert to an pair with that prime factor and zero
Dˆ      Save the pair in the global array for later
R!*     Multiply the other input value by the factorial of the prime
]       End of infinite loop
¯ø      Collect all the saved primes
εʒĀ     Forget all the saved 0s

I love "emotional" scripts - ¦D

46 bytes

39 bytes

Mathematica, 175 177 169 154 108 bytes
Join@@@Table[x[[1]],{s,{1,-1}},{x,r@#},x[[2]]s]&@*(If[#==1,1,{p,e}=Last@(r=FactorInteger)@#;p^e#0[p!^-e#]]&)

Try it online!
How it works
This is the composition of two functions. The first, which ungolfs to
If[# == 1,
  1,
  {p,e} = Last[FactorInteger[#]];
  p^e * #0[p!^-e * #]
]&

is a recursive function for actually computing the desired factorization. Specifically, given a rational input x, we compute the primes whose factorials should be in the numerator and denominator, and return the fraction with all of those primes multiplied together. (For example, on input 10/9 = 2!*5!/(3!*3!*3!), we return 10/27 = 2*5/(3*3*3).)
We do this by dealing with the largest prime factor at every step: if pe occurs in the factorization of x, we make sure p!e occurs in the factorial-factorization, and recurse on x divided by p!e.
(Earlier, I had a more clever strategy that avoids large numbers by looking at the previous prime number before p, but Mathematica can handle numbers as big as 65521! easily, so there's no point. The old version you can find in the history is much faster: on my computer, it took 0.05 seconds on inputs that this version handles in 1.6 seconds.)
The second function turns the output of the first function into lists of primes.
Join @@@
  Table[x[[1]],
    {s,{1,-1}},
    {x,FactorInteger[#]},
    x[[2]]*s
  ]&

For s=1 (positive powers) and s=-1 (negative powers), and for each term {prime,exponent} in the factorization r@#, we repeat the prime number prime exponent*s many times.
Noncompeting version with 109 62 bytes
If[#==1,∇1=1,{p,e}=Last@FactorInteger@#;(∇p)^e#0[p!^-e#]]&

Same as above, but instead of giving output as a list, gives output as an expression, using the ∇ operator (because it has no built-in meaning) as a stand-in for factorials. Thus, an input of 10/9 gives an output of (∇2*∇5)/(∇3)^3 to represent (2!*5!)/(3!)^3.
This is shorter because we skip the second part of the function.

+2 bytes: the assignment f=First has to be done in the right place to keep Mathematica from getting upset.
-8 bytes: fixed a bug for integer outputs, which actually made the code shorter.
-15 bytes: FactorInteger returns sorted output, which we can take advantage of.
-46 bytes: we don't actually need to be clever.

Python 2, 220 202 195 183 bytes
g=lambda a,b:a and g(b%a,a)or b;n,d=input();m=c=()
while n+d>2:
 t=n*d;f=p=2
 while t>p:
	if t%p:p+=1;f*=p
	else:t/=p
 if n%p:c+=p,;n*=f
 else:m+=p,;d*=f
 t=g(n,d);n/=t;d/=t
print m,c

Try it online! Edit: Saved 18 25 bytes thanks to @Mr.Xcoder. Saved 12 bytes thanks to @JonathanFrech.

202 bytes

You can shorten it even more in Python 2, since you can replace multiple spaces with tabs in the indentation

189 bytes.

183 bytes.

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


text:
Prime Powers of Primes
For the purpose of this challenge, a Prime Power of a Prime (PPP) is defined as a number that can be defined as a prime number to the power of a prime number.  For example, 9 is a PPP because it can be represented as 3^2.  81 on the other hand is not a PPP because it can only be represented as 3^4, and 4 is not prime.  The first few PPPs are: 4, 8, 9, 25, 27, 32, 49, 121, 125, 128, 169, 243, 289, 343...  This is OEIS sequence A053810
Your Task:
Write a program or function that for an input integer n returns/outputs the nth PPP, either 1-indexed or 0-indexed, whichever you prefer.
Input:
An integer between 0 and 1,000, received through any reasonable method.
Output:
The PPP at the index indicated by the input.
Test Cases:
These are 1-indexed, and so, if your program takes 0-indexed input, the same output should be arrived at for the stated input - 1.
3  -> 9
6  -> 32
9  -> 125

Scoring:
This code-golf,lowest score in bytes wins!

This challenge was sandboxed

05AB1E (legacy),  9  7 bytes
Saved 2 bytes thank to @KevinCruijssen
µNÓ0Kp»

Try it online!
µ           # while counter_variable != input:
 N          #   push iteration counter                       e.g. 125
  Ó         #   get prime exponents                          -> [0, 0, 3]
   0K       #   filter out zeros                             -> [3]
     p      #   is prime?                                    -> [1]
      »     #   join with newlines: we use » instead of J
            #   so that [0,1] is not interpreted as truthy   -> 1
            #   implicit: if 1, increment counter_variable

Oh, I like the use of » instead of J so 0\n1 isn't interpret as truthy! But you can save a byte in the legacy version of 05AB1E (which you also used in your TIO), by omitting the ½, since this is done implicitly for µ (second bullet-point in this 05AB1E tip of mine). Also, ʒĀ} can be 0K. 7 bytes

@KevinCruijssen Cool. Thanks!

Husk, 10 bytes
!fȯṗ§*ELpN

Try it online!
Explanation
!fȯṗ§*ELpN  Implicit input.
 f       N  Filter the natural numbers by this function:
  ȯṗ§*ELp    Argument is a number, say 27.
        p    Prime factors: [3,3,3]
       L     Length: 3
      E      Are all elements equal: 1
    §*       Multiply last two: 3
  ȯṗ         Is it prime? Yes, so 27 is kept.
!           Index into remaining numbers with input.

Haskell, 95 85 80 bytes
-10 bytes thanks to @Lynn
-5 bytes thanks to @WillNess
0-based
(!!)[x|x<-[2..],p<-[[i|i<-[2..x],all((>)2.gcd i)[2..i-1]]],or[y^e==x|e<-p,y<-p]]

Try it online!
Explanation
(!!)                    -- point-free expression, partially evaluate index-access operator
[x|x<-[2..]             -- consider all integers x>=2
,p<-                    -- let p be the list of all primes <=x
[[                      -- list of a list so p ends up as a list
i|i<-[2..x],            -- consider all i<=x to be potentially prime
all((>)2.gcd i)[2..i-1] -- if the gcd of i with all smaller integers is
                        -- smaller than 2 then this i is actually prime
 ]],or                  -- if any of the following list entries is true
[y^e==x|                -- the condition y^e==x holds for x with ...
e<-p,y<-p]              -- y and e being prime, i.e. x is a PPP,
]                       -- then add this x to the output sequence / list

f=(!!)[x|x<-[2..],or[y^e==x|y<-p x,e<-p x]] saves 10 bytes.

can get to 82 bytes by inlining : f=(!!)[x|x<-[2..],p<-[[i|i<-[2..x],all((>)2.gcd i)[2..i-1]]],or[y^e==x|e<-p,y<-p]]. maybe it's OK then to not count the f=? (never sure about the rules).

I was once told that indeed f= shouldn't be counted. So it'll be 80 bytes, with (!!)[x|x<-[2..],p<-[[i|i<-[2..x],all((>)2.gcd i)[2..i-1]]],or[y^e==x|e<-p,y<-p]].

Python 2, 163 157 137 136 bytes

Saved six bytes by using input() rather than defining a function.
Saved four bytes thanks to Felipe Nardi Batista; merging two loops.
Saved sixteen bytes thanks to ASCII-only.
Saved a byte thanks to ArBo.

p=input();r=i=0;e=lambda p:all(p%d for d in range(2,p))
while~-i<p:
 r+=1
 for x in range(r*r):y=x%r;x/=r;i+=x**y==r>e(x)>0<e(y)
print r

Try it online!

use lists instead to save a byte: i=[] and ....i+=[r]*....

153 bytes by removing the second for

@FelipeNardiBatista I did not use lists, as in its first iteration the program was defining a function. Thanks for spotting and the further golf.

Can't you return r instead of i[p]

137?

sadly this is longer (143)

@ASCII-only would this not also work for 136?

dang, this is longer too, as is this

R + numbers, 57 bytes
function(n,x=numbers::Primes(2*n))sort(outer(x,x,"^"))[n]

Try it online!
outer is such a handy function.
Fairly certain this will always work. Will make a formal argument when I have the time.

Jelly, 12 11 10 bytes
1 byte thanks to Dennis.
ÆN€*þ`FṢị@

Try it online!

Actually, 14 bytes
Based on Mr. Xcoder's Pyth solution. Golfing suggestions welcome. Try it online!
;ur♂P;∙⌠iⁿ⌡MSE

Ungolfing
                Implicit input n
;ur             Duplicate and push [0..n]
   ♂P           Push the 0th to nth primes
     ;∙         Push Cartesian square of the primes
       ⌠iⁿ⌡M    Reduce each list in the Cartesian square by exponentiation
            SE  Sort the list and get the nth index (0-indexed)

Mathematica, 48 bytes
Sort[Join@@Array[(p=Prime)@#^p@#2&,{#,#}]][[#]]&

Try it online!
but Martin Ender had a better idea and saved 6 bytes
Mathematica, 42 bytes
Sort[Power@@@Prime@Range@#~Tuples~2][[#]]&

Try it online!

You can use Union instead of Join to avoid the Sort.

But I think Outer saves another byte over Array: (Union@@Outer[Power,p=Prime@Range@#,p])[[#]]&

And Tuples is even shorter: Sort[Power@@@Prime@Range@#~Tuples~2][[#]]&

APL (Dyalog Extended), 15 bytes
{⍵⌷∧∊∘.*⍨¯2⍭⍳⍵}

Try it online!
Explanation
{⍵⌷∧∊∘.*⍨¯2⍭⍳⍵}

              ⍵   Right argument. Our input.
{              }  Wraps the function in dfn syntax which allows us to use ⍵.
             ⍳     Range [1..⍵].
          ¯2⍭     Get the n-th prime for each n in the range.
      ∘.*⍨        Get the prime powers of each prime.
     ∊            Flatten the list.
    ∧             In Extended, this is monadic sort ascending.
 ⍵⌷               Get the input-th index of the list of prime powers of primes.

Pyth, 15 bytes
e.f/^FR^fP_TSZ2

Try it here! or Verify more test cases.
Explanation

e.f/^FR^fP_TSZ2  - Full program. Q means input.

 .f              - First Q inputs with truthy results. Uses the variable Z.
        fP_TSZ   - Filter the range [1, Z] for primes.
       ^      2  - Cartesian square. Basically the Cartesian product with itself.
    ^FR          - Reduce each list by exponentiation.
  /              - Count the occurrences of Z in ^.
e                - Last element.

Javascript 137 133 bytes

P=n=>{for(p=[i=2];j=++i<n*9;j^i&&p.push(i))
for(;j*j<=i;)j=i%++j?j:i
x=[]
for(i of p)
for(j of p)
x[i**j]=1
return Object.keys(x)[n]}

console.log(P(1000))
console.log(P(800))
console.log(P(9))
console.log(P(5))

**normal algorithem(100ms result)
P =n =>
    {
  for(p=[i=2];f=++i<=n*10;!f||p.push(i))
    for(j=0;f&&(x=p[j++])*x<=i;)
      f=i%x
  x=[]
  T=0
  for(i of p)
  for(j of p)
  {
    l= i**j
    if(++T>n &&x.length<l )
    break
    x[l] = 1
  }
  return Object.keys(x)[n]
}

Umm, this is [tag:code-golf], not [tag:fastest-code].  Therefore, the speed of your submission compared to others is not important, as this is scored by byte count.  Please include the byte count and language of your submission in your answer.

but it should have at least a time limit , i can golf it to , but than a 100ms solution will become a 5 seconds solution, is it ok?

The solution may take any finite amount of time to run.  The only goal is to make the code shorter.

Perl 6, 50 bytes
{(sort [X**] (^7028,^24)>>.grep(&is-prime))[$_-1]}

Try it online!
  (^7028,^24)            # create 2 ranges from 0
     >>.grep(&is-prime)  # grep for primes in both
 [X**] ...               # calc each exponential pair (2^2, 2^3, 2^5...)
(sort ... )[$_-1]        # sort and get value at index n-1

The reasons for the 24 and 7028 are that the largest value (n=1000) is 49378729, which is 7027^2, and the largest prime power of 2 which fits under that is 23. So covering 2..7027 ^ 2..23 includes all the items in the first 1000 (and a lot of spares).

Pyth - 13 bytes
e.f&P_lPZ!t{P

Test Suite.

Java 8, 211 bytes
import java.util.*;n->{List l=new Stack();for(int a=2,b;a<132;a++)for(b=2;b<132;b++)if(p(a)*p(b)>0)l.add(Math.pow(a,b));Collections.sort(l);return l.get(n);}int p(int n){for(int i=2;i<n;n=n%i++<1?0:n);return n;}

Very inefficient method.. It basically calculates all PPP's from 22 through 999999 132132 and stores it in a List, then sorts that List, and then gets the n'th item from that List.
EDIT: Instead of using 999999 which results in a List of 28,225 items, I now use 132132 which results in a List of just 1,024 items. This improves the performance quite a bit, and is perfectly acceptable since the challenge states we should support an input from index 0 through 1,000. (Changing 1e3 to 132 doesn't affect the byte-count, though.)
Explanation:
Try it here.
import java.util.*;           // Required import for List, Stack and Collections

n->{                          // Method with integer as parameter and Object as return-type
  List l=new Stack();         //  List to store the PPPs in
  for(int a=2,b;a<132;a++)    //  Loop (1) from 2 to 1,000 (exclusive)
    for(b=2;b<132;b++)        //   Inner loop (2) from 2 to 1,000 (exclusive)
      if(p(a)*p(b)>0)         //    If both `a` and `b` are primes:
        l.add(Math.pow(a,b)); //     Add the power of those two to the List
                              //   End of loop (2) (implicit / single-line body)
                              //  End of loop (1) (implicit / single-line body)
  Collections.sort(l);        //  Sort the filled List
  return l.get(n);            //  Return the `n`'th item of the sorted List of PPPs
}                             // End of method

int p(int n){                 // Separated method with integer as parameter and return-type
  for(int i=2;                //  Index integer (starting at 2)
      i<n;                    //  Loop from 2 to `n` (exclusive)
    n=n%i++<1?                //   If `n` is divisible by `i`:
       0                      //    Change `n` to 0
      :                       //   Else:
       n                      //    Leave `n` the same
  );                          //  End of loop
  return n;                   //  Return `n` (which is now 0 if it wasn't a prime)
}                             // End of separated method

PARI/GP, 48 bytes
f(n)=[x|x<-[1..4^n],isprime(isprimepower(x))][n]

If you do not count the f(n)= part, that is 43 bytes.

Another approach without the set notation which does not check so many unnecessary cases:
f(n)=c=0;i=1;while(c<n,i++;isprime(isprimepower(i))&&c++);i

J, 21 bytes
{[:/:~@,[:^/~p:@i.@>:

Zero-indexed anonymous function.
Try it online!
Trying to get back into the swing of things but I seem to have forgotten all tricks to make good monadic chains.
Short explanation
Constructs a table of prime powers from the 0th prime to the prime at the index of the input plus 1 (to account for 0). Flattens this list and sorts it and then indexes into it. I realize now that this might give incorrect results for some values since the table might not be large enough -- in that case I'd edit in a hardcoded value like 1e4 which should suffice. I can't prove it one way or the other (it passes for the test cases given), so do let me know if this is an issue.
Also 21 bytes
3 :'y{/:~,^/~p:i.>:y'


text:
Hide the Needle in the Haystack (Cops)
This is part of a cops-and-robbers challenge. Go here for the robbers' part.
The Cops' Challenge
You should write a program or function in a language of your choice, which outputs the string Haystack. However, it must be possible to remove some subset of characters from your program (without reordering the rest), such that the resulting string is also a valid program in the same language, which prints Needle instead. Both programs/functions may optionally print a single trailing newline (independently of each other), but nothing else.  Output is case sensitive and must follow the exact casing provided.
Your goal, of course, is to hide the "needle" very well. But note that your submission can be cracked with any valid solution, not just the one you intended.
Please include in your answer:

The language (and version if relevant) of your submission.
The size of the Haystack program in bytes.
The Haystack program itself.
The output method if it's not STDOUT.
If possible, a link to an online interpreter/compiler for your chosen language.

Your submission may be either a program or function, but not a snippet and you must not assume a REPL environment. You must not take any input, and you may output via STDOUT, function return value or function (out) parameter.
Both programs/functions have to complete within 5 seconds on a reasonable desktop machine and need to be deterministic. You must not use built-ins for hashing, encryption or random number generation (even if you seed the random number generator to a fixed value).
In the interest of fairness, there must be a freely available interpreter or compiler for your chosen language.
An answer is cracked if the Needle program is found.  If your answer has not been cracked for 7 days, you may reveal the intended Needle program in your answer, which renders your submission safe. As long as you don't reveal your solution, it may still be cracked by robbers, even if the 7 days have already passed. The shortest safe Haystack program (measured in bytes) wins.
Examples
Here are a couple of simple examples in different languages:
Ruby

Haystack: puts 1>0?"Haystack":"Needle"
Delete:        XXXXXXXXXXXXXXX
Needle:   puts "Needle"

Python 2

Haystack: print "kcatsyaHeldeeN"[-7::-1]
Delete:          XXXXXXXX        XX
Needle:   print "eldeeN"[::-1]

Note that the subset of removed characters doesn't have to be contiguous.
Uncracked Submissions

Related. (The main difference is that that one had the programs implement OEIS sequences and allowed the cracked program to output any different OEIS sequence, which makes it a lot harder for the cops to guard against unintentional cracks. It also allowed robbers to steal cracks from other robbers by finding even shorter solutions.)

I would do this in Haystack but it has no documentation and I cbb looking through the code :(

@Okx https://github.com/kade-robertson/haystack/wiki/Documentation

To brute-force a n - byte submission, you have to check 2^n - 1 sub-programs. Each is required to complete within 5 seconds. If you check programs consecutively, you need about 7.5 days for a 17-byte submission. So this is the lower bound for an expected safe submission :-)

The stack snippet gets the length wrong for this answer

@M.Herzkamp I don't think every possible subprogram must complete within 5 seconds, just the Haystack and Needle ones?

@kamoroso94 Yes, but that means you can terminate candidate programs after 5 or 6 seconds, because if they haven't finished they can't be the solution you're looking for.

What are treated as hashing, encryption or random number generation

You should accept this safe TI-Basic Answer at 119 bytes

Haystack, 84 bytes, Cracked
0\\1-c\
//
?10F17+c8F+4+cd8F+3+c6-c1+c,c2+c8+c|
 0   \1++c,c|
F/c++2F8
c\8F+2+cd

Try it online!
This looks (to me) rather convoluted but if you find the right subset it's a bit too easy... oh well, just to get us started :P

Cracked.

@icrieverytim 1. oo cool they're both unicode glyphs 2. the current one is more scientifically accurate

Yeah, I know, they look really cool. :P I found them in this gold mine of a Unicode block. Don't be surprised if they end up in Neon's code page. 2. TBH, the old one looked better IMO. :P

@icrieverytim I agree, but scientific accuracy > looks :P (to some extent) there's also a diagram which is a dashed hexagon inside a solid hexagon but I can't seem to find a decent image for that version.

@HyperNeutrino Why do you have an interest in benzene?

@Michthan Considering that I'm a neutrino, that is a good question, but I don't know :P

Hexagony, 37 bytes
H[@;(...e<l.a;./$.>;\sN;\ac.>).;;;._y

Try it online!
Just my obligatory Hexagony entry...
For convenience, here is the unfolded code:
   H [ @ ;
  ( . . . e
 < l . a ; .
/ $ . > ; \ s
 N ; \ a c .
  > ) . ; ;
   ; . _ y

How this works:
The program starts off with H, then we move to IP #5. This IP starts in the west corner, bouncing and wrapping around while executing (in effect) ;a;y;s; (so we've printed Hays). Then s gets incremented to a t by ) and printed, then we pass through Ne...(c before getting to a;c; (still bouncing around a small section of the hexagon). The program hits the _, reflects up through \ to l which gets decremented to a k by (, which passes through another \ before being printed and the program terminates on the @.
Verbose version

H   H is entered into the current memory cell
[   We move to the previous instruction pointer (starting at the / and moving NE)
/   No-op
<   Mirrors the IP back to south-west
/   No-op (IP now wraps to the NE corner)
;   Outputs H
.   No-op
a   a is entered into the current memory cell
>   Mirrors the IP back to north-east
a   a is entered into the current memory cell
.   No-op
;   Outputs a (IP now wraps SE corner)
y   y is entered into the current memory cell
;   Outputs y
.   No-op
s   s is entered into the current memory cell (IP now wraps SW corner)
;   Outputs s
)   Increments the memory cell to t
\   Mirrors the IP west
;   Outputs t
N   N is entered into the current memory cell (IP now wraps to e)
e   e is entered into the current memory cell
... No-ops
(   Decrements the memory cell to d (IP now wraps to . on SE edge)
.   No-op
c   c is entered into the current memory cell
a   a is entered into the current memory cell
\   Mirrors the IP north-east
>   Redirects the IP east
;   Outputs a
\   Mirrors the IP south-west
c   c is entered into the current memory cell
;   Outputs c
_   Mirrors the IP north-west
.\. No-ops
l   l is entered into the current memory cell
(   Decrements the memory cell to k (IP now wraps to . on SE edge)
.\  No-ops
;   Outputs k
.   No-op
@   Terminates the program

This language still cracks me up. I love you for it.

My brain is exploding right now. I was trying to figure this out enough to crack the code, but YEESH man. What kind of twisted guy makes this up??

@phroureo ... >_>

After your answer is safe, can you give me a step-by-step on what it's doing? (Or if you already have a step-by-step somewhere one something similar, point me there?)

@phroureo I don't mind adding an explanation of the cop program before it's safe, and I don't think I'll claim it safe anyway (I'm not too keen on winning my own challenge with a submission that I put barely any effort in). I'll try to add the explanation tomorrow. In the meantime, I'm happy to help you with Hexagony in the esolangs chatroom.

@phroureo you might also want to check out Timwi's Esoteric IDE

Cracked, finally.

Brain-Flak, 146 bytes (Cracked)
([((((()()())){}){}){}](()([()](()({}([((((()()()){})))[]])[]({}({})[{}]()({}((()(({}){}){}){}){}())))[][][][][][]))[]))(((()[]){}){({}[()()])}{})

Try it online!
Intended solution, 80 bytes
([((((()()())){}){}){}](()([()](()({}([((((()()()){})))[]])[]({}({})[{}]()({}((()(({}){}){}){}){}())))[][][][][][]))[]))(((()[]){}){({}[()()])}{})
( ((   )(                  [(  (( (         )()()){})) []]   ({}(  )    ( (  ( ()(({}){}){}){}){}())))            ))    (((()[]){}){({}[()  ])}{})

Cracked

Haskell, 168 bytes (Cracked by nimi)
hays=map;hay=zipWith;stack=head;h=stack{-
 hay.(hays.(stackany hay$or id).stack hay
<*>hays(sum$stack haystack<$>hay))-}$words
 "Haystack Hayst ackH aysta ckH aystac k"

Try it online! Evaluating the identifier h returns the string "Haystack", after some deletions h yields "Needle".

Cracked. Was quite some fun to solve.

JavaScript, 95 bytes (ES6), Cracked
A function returning a string.
f=(k=b=x=35)=>x--?f(k*74837258394056219&268435455):k&2?'N'+(k^124038877).toString(b):'Haystack'

"Haystack" demo

f=(k=b=x=35)=>x--?f(k*74837258394056219&268435455):k&2?'N'+(k^124038877).toString(b):'Haystack'

console.log(f())

Very nice puzzle. Cracked

Jelly, 41 bytes (Cracked)
“¿ọ⁽ṅ*FỊ⁼g£¡#!ʋzoɦṪ£ṢÞḲÐɠ`”m3⁾“»jVḟ“¡!pṄ»

Try it online!
Happy hunting!

Cracked.

Hexagony, 32 bytes. Cracked
I couldn't solve Martin's, so I'm posting my own.
];N.@cl;e@;;(\H/;ya;_.>s.;t//<._

Try it online!
Here it is formatted:
   ] ; N .
  @ c l ; e
 @ ; ; ( \ H
/ ; y a ; _ .
 > s . ; t /
  / < . _ .
   . . . .

My aim with this was for both solutions to use as many IPs as possible, I got 6 for Needle and only 5 for Haystack.

Cracked

Pyth, 44 bytes (Cracked)
Kr."Dn2û"2sf!/+rrK2 2r."EL8"2Tr."AhÐP®Z"2

Try it here.

Should be easy to crack, just a first attempt :-)

@_@ Why is there Jelly code

cracked

Java (OpenJDK 8), 226 217 bytes (Cracked)
First ever code golf, probably very easy but it was a fun challenge!
String d(){int h=3609000-5055+911,m=557558,s=15441301-157*10000;String d="0"+h*2+""+m*20+""+s*7,x="",y;for(int g=0;g<d.length();g+=3){y="";for(int e=0;e<3;e++)y+=d.charAt(e+g);x+=(char)Integer.parseInt(y);}return x;}

Try it online!

Your TIO doesn't work. You might want to change the return new Main().d(); to System.out.print(new Main().d()); in the main-method.

@KevinCruijssen Thanks for the heads up!

Cracked.

dc, 148 bytes (Cracked)
6 93 3 9 2 2**+*+483622 1 2 3 3*+3*+89 47*+*+3 5 2* 269 158 9**107 97*2 4*++2 3 3*+42 14 2**+*+5*+5 2148 1 6 2*+*+68262 5 280 7 2 3 3*+5 2**+*+*+*+P

Try it online!
It is rather simple, but I hope it will be at least a little fun to solve :з

Cracked

Brain-Flak, 188 bytes (Cracked)
I only just saw Funky Computer Man's answer As I posted this.
It is somewhat obfuscated.
((((((((((()()()){}){}()){}){}()){}()))<({}[(()()()()){}])(([[]]({})<>)<>)>((()()())){}{})[()]))<[[]()]>((()){}){}((){}[][(<>){}<>])(<>){}(({}<>()[()])[(((()()()){}<[()]>)<(()){}>{}){}()])

Try it online!
Intended solution, 96 bytes:
((((((((((()()()){}){}()){}){}()){}()))<({}[(()()()()){}])(([[]]({})<>)<>)>((()()())){}{})[()]))<[[]()]>((()){}){}((){}[][(<>){}<>])(<>){}(({}<>()[()])[(((()()()){}<[()]>)<(()){}>{}){}()])((((((((()()()){}){}){}()){}){}()<>)<>)(()()()){}())<>(((({}[()]<>)()))[(((()()()){}())()){}{}])
(((((((( (()()()){}){}  ){}){}()){}()))      ()()                   <>)     (()()()) {}    () ) <      >((()      ((){}    <>)     )   )  (({}        )[(((()()  ){}  ()  )  () {}   ){}()])

Try it online!

You mean somewhat obfuscated beyond just normal Brain-Flak obfuscation.

@Gryphon Yes, I added some extra bits.

Cracked.

JavaScript, 119 bytes (ES6), Cracked
A function returning a string. Quite long and not so hard, but hopefully fun.
_=>(+{}+['H'])[+[3]]+(+[][[]]+[])[+!!3]+(+[][[]]+['y'])[3]+(+[][[]]+['s'])[-~2]+(~![]+['t'])[2]+(+[][[]]+[])[+!!3]+'ck'

"Haystack" demo

let f =

_=>(+{}+['H'])[+[3]]+(+[][[]]+[])[+!!3]+(+[][[]]+['y'])[3]+(+[][[]]+['s'])[-~2]+(~![]+['t'])[2]+(+[][[]]+[])[+!!3]+'ck'

console.log(f())

Cracked. The jsfuck github README.md helped a lot.

Python 2.7.10 with Numpy 1.12.1, 208 209 bytes (cracked)
It appears that there is a Needle and a Haystack in Numpy! Here is the Haystack; see if you can find the Needle. I hope you have as much fun searching for the Needle as I had hiding it.
import numpy
print "".join([dir(numpy)[int(i)][1-0] for i in numpy.poly1d([-1*1433/252e1,-3232/1920.,4026./72/2/3.,613/(6*4.)*1,-4723./1.8e2,-9763/120.,-2689/(-1+5*17.),1+138*.4*2])(numpy.arange(-12/3,13%9))])

It outputs as specified:
Haystack

You can repl.it.

Not that it really matters, but this is 209 bytes, not 208

Cracked.

Python 2.7.2, 103 / 117 bytes, Cracked
Function Version (117 bytes):
def e():
 a,b,s=20070763850923833476353301471991752,0b1010100010010011,""
 while a>0:
  s=chr(a%b)+s
  a//=b
 print s

Program Version (103 bytes):
a,b,s=20070763850923833476353301471991752,0b1010100010010011,""
while a>0:
 s=chr(a%b)+s
 a//=b
print s

This should print Haystack well. Tested on Python Fiddle.
Btw this is the first attempt.
Not sure if the program version is counted as a snippet, so I put both versions here.

Cracked.

Java 8, 321 bytes, Cracked
v->{String h="Haystack";int x=-7;return x<0?h:new String(new java.math.BigInteger(new byte[]{(byte)((~-~-~-~-~-~-~-~-~-~1^-x++*x)+151),new Byte("2"+"1+\"0+\"".length()+(x=h.length()*4/x)+"-x-7")}).toByteArray())+(new StringBuffer("hidden".substring(++x%3^4,--x-x--).replaceFirst("dd","e"+(char)(x*211%+93))).reverse());}

Try it here.
More readable:
v->{
  String h="Haystack";
  int x=-7;
  return x<0?
          h
         :
          new String(new java.math.BigInteger(new byte[]{
            (byte)((~-~-~-~-~-~-~-~-~-~1^-x++*x)+151),
            new Byte("2"+"1+\"0+\"".length()+(x=h.length()*4/x)+"-x-7")
          }).toByteArray())
          +(new StringBuffer("hidden".substring(++x%3^4,--x-x--)
             .replaceFirst("dd","e"+(char)(x*211%+93))
            ).reverse());
}

Not sure if it's too long/hard.. Then again, Java in general is pretty long to begin with, so hiding the 'Needle' properly of course increases the byte-count quite a bit..
If no one cracks it, I'll add some spoiler-tips later on.

The TIO has one fewer character, but cracked either way.

Ruby, 185 bytes, cracked by cab404
x='yGwztsPXhxDkBKlCYdFjQnpUROfoHvqmTgbaJSLcEiZrIAuMVNW'
s="n=x.to_i 36;x.bytjs.jach_cons(3){|a,b,c|n+=n*b%c;n*=a^b};puts n%8675309==1388649 ?'Njjdlj':'Haystack'"
eval s.tr ?j,s.size.chr

Try it online!
I'll try to come up with something sneaky, but for now here's a try at "simple but obnoxious."

Cracked: https://codegolf.stackexchange.com/a/144955/74216

that was fun ^^

Well done! Glad brute force wasn't too boring.

T-SQL, 757 characters CRACKED
Apologies for deleting my previous answer--I edited it too many times as I obfuscated, and didn't want to give anything away. :)
In any case, obfuscating in SQL is a bit difficult, unless you want to do crazy stuff like this, and I wasn't that invested.
Also, I unabashedly do not apologize for naming my variables after Dota.
SQL Fiddle
create table a(l int,c int)
insert into a values (1,10),(2,1),(3,8),(4,0)
go
;CREATE FUNCTION b(@ varchar(max)) returns varchar(max) as
begin return 'char('+@+'),'''','end
go
;CREATE FUNCTION h(@ varchar(max),@a varchar(max), @b varchar(max), @c varchar(max), @d varchar(max), @e varchar(max), @f varchar(max), @g varchar(max), @h varchar(max))
returns varchar(max) as
begin
return replace(replace(replace(replace(@,@a,@b),@c,@d),@e,@f),@g,@h)
end
declare @x varchar(max),@ int=1,@y varchar(99)=''
,@D varchar(4)='Ha',@O varchar(4)='ys'
,@T varchar(3)='ta',@A varchar(4)='ck'
WHILE @<=4
BEGIN
set @y+=(SELECT dbo.b(c+100)from a where l=@)+' '
set @+=1
END
SELECT @x='select
left(dbo.h('''+@D+@O+@T+@A+''','+ left(@y,len(@y)-1) +'),char(56))'
execute(@x)

If this is the easiest answer in this thread, you're probably right. :P It's hard to trick SQL.

shouldn't 'haystack' be 'Haystack'?

SQL doesn't handle capitalization very nicely (unless you specifically define the schema that it's supposed to use for the letters). I opted not to. :P

@phroureo The spec does explicitly state that it must be capitalized correctly.

Alright, I fixed the code above (although I didn't necessarily fix the SQL Fiddle, since it works the same).

cracked (I'm sorry...)

@RobertFraser Remember the time where I said "This may be the easiest post in this thread?" Yeah, that's why. :P

@phroureo Wait was that really the intended solution? I see where it selects the ascii codes for 'n', 'e', 'd', and 'l' (values in a table + 100), so it seems like you had something more exciting going on.

It's alllllll in the obfuscation. :P

@RobertFraser to be fair, you picked different letters from the string for "SELECT 'Needle'" than I intended, but you got the intended solution.

Ly, 40 bytes, cracked
(78)"e"&p"Ha"s"yst"l"ck"&o(100)"l"l'&'o;

Try it online!
Oh boy, another Ly CNR submission. These haven't worked very well historically (possibly due to me and not the language), but we'll see how this fares and today is no exception.
Solution:

 (78)"e"sl(100)"l"l&o;, remove XXXXXX XXXXX XXXXXX         X X with seven leading spaces

Cracked.

Java, 345 bytes, Cracked
import java.util.*;interface Main{static void main(String[]args){Stack<Hay>s=new Stack();s.add(new Needle());for(int i=0;i<1000;i++)s.add(new Hay());System.out.println(s.get(s.indexOf(new Hay())+1).a);}}class Needle extends Hay{{a="Needle";}}class Hay{String a="Haystack";public boolean equals(Object o){return getClass().equals(o.getClass());}}

Try it online!
Really long and probably easy to crack, but at least it's got a Stack<Hay>!

very nice one! but yes, pretty easy to crack.

Vyxal o, 51 bytes
‛Ha:₍₴Cv∑∑Ṙ⌊√‹½⇩⇩²C:₴«•∞yλ;ß4ġ∆Ė_□∴9«øc:3Ẏ$4ȯ∇ppĖ5e

Try it Online!
Have fun!
So, here's an explanation of the code:
‛Ha                                      # Push 'ha'
   :₍                                    # Duplicate and parallel apply...
     ₴                                   # Flatprint
      C                                  # And charcode, wrapped into a list
       v∑∑Ṙ                              # Get sum, concatenate, reverse (`961aH`)
           ⌊√‹½                          # Intify, square root, decrement and halve (15)
               ⇩⇩²C                      # Subtract 4, convert to char, which happens to be y
                   :₴                    # Dupe and flatprint.
                     «...«               # Push a string, specially chosen, see below
                          øc             # Compress
                            :3Ẏ$4ȯ∇pp    # Insert ToS (`y`) at char 3
                                     Ė   # Evaluate
                                      5e # Every fifth character

So, I realised I could use the compressed string ‛₍∞ as the needle program. I could easily sneak in a ‛ and ₍, but ∞ was proving to be a problem. Eventually, I managed to construct a compressed string that contained ∞ and y, and had the property that if you took every fifth character, you got 'stack'.
So yeah, this was tricky.

cracked

Vyxal, 44 bytes
17SǏ⌊0»¹∇ḃF2»*»∷J∇Y.ḊṖ¼ḭ¦]uy»S4ẇṫ½Y⌊$oḢJCṅĖǐ

Try it Online!

This is safe now

@emanresuA oh, uh, I kinda forgot this existed. And I don't actually remember the answer, either. So I guess now I gotta crack my own cop. lol

TI-BASIC, 119 bytes (Safe)
Output stored in Ans.
"TIBASIC→Str1
length(Ans→X
Str1
For(I,X,2(7-4not(X-1
Ans+sub("ACDEHKLNSTY",inString("ABCDEFGHIJK",sub("KCBADAEDJDHIGF",1+remainder(11I-1,14),1)),1
End
sub(Ans,1+X,length(Ans)-X

Solution
Remove characters from Str1 to give it a length of 1.
"C→Str1
length(Ans→X
Str1
For(I,X,2(7-4not(X-1
Ans+sub("ACDEHKLNSTY",inString("ABCDEFGHIJK",sub("KCBADAEDJDHIGF",1+remainder(11I-1,14),1)),1
End
sub(Ans,1+X,length(Ans)-X

PHP, 44 bytes, Cracked
fairly easy to crack; but I like it.
for($i=~1;$c=H_aNyesetdalcek[$i+=2];)echo$c;

Run with -nr or try it online.

Aceto, 154 bytes (Safe)

              27\'dNU   QJi9MLJ€{{x(}]J{'!o∑€xiDQxsJ(]sicpicp1.2sJJicp90I.2+D/edxi-'>xd80J0IJicx'NIx5sJsJidcpIcpL7sssJicpei7+ UUdJicpLI7sJicpx'p\p9*coJcU'p+\p
Try it online!

  'N'ed'd80J0IJic'eUpppppp     Try it online!

Explanation:
<space>*2 - Two spaces for the hilbert curve to work right
'N pushes 'N' onto the stack
'e pushes 'e'
d duplicates it
'd pushes d
80 pushes 8, 0
J concats top two values
0I pushes 0, pops, increments, pushes back on, net effect: pushes 1
J concats to '108'
i converts to integer
c pops and pushes ascii equiv on stack
'e pushes 'e' (again)
U reverses the stack
and the p's print out the stack

Rattle, 55 bytes
Haystack&Needl|Ip0=2+(1*2)!Ps[bg0*3b^](`+5);$b|1,%(?3b)

Try it Online!
This isn't terribly difficult but it's not trivial either (note that "Needle" is missing the last "e" near the beginning of the code).
Hint: the Needle program will not have a trailing newline, while the Haystack program does.


text:
Find the Needle in the Haystack (Robbers)
This is part of a cops-and-robbers challenge. Go here for the cops' part.
The Robbers' Challenge
A cop's answer can be cracked by removing any subset of characters from the Haystack program, so that it outputs Needle instead of Haystack (while still being a valid submission in the same language). You don't have to find the exact same solution as the cop intended, as long as yours is valid by the above constraints.
If you manage this, post an answer with the solution, linking to the cop's answer, and leave a comment on the cop's answer linking back to yours.
The robber who cracks the most cop answers wins. Ties are broken by the sum of sizes of the cracked cop answers (in favour of the robber who cracks longer submissions).
Each cop answer can only be cracked once, and of course, you're not allowed to crack your own answer. If the cop's answer turns out to be invalid before or after being cracked, it is not counted towards the robber's score.
Examples
Here are a couple of simple examples in different languages:
Ruby

Haystack: puts 1>0?"Haystack":"Needle"
Delete:        XXXXXXXXXXXXXXX
Needle:   puts "Needle"

Python 2

Haystack: print "kcatsyaHeldeeN"[-7::-1]
Delete:          XXXXXXXX        XX
Needle:   print "eldeeN"[::-1]

Note that the subset of removed characters doesn't have to be contiguous.

If robber use hashing, encryption or random number generation is it allowed?(though possibility tiny)

JavaScript, 85 bytes (ES6)
Cracks Arnauld's answer
f=(k=b=x=35)=>x--?f(k*4853461&268435455):k&2?'N'+(k^12408877).toString(b):'Haystack'

"Needle" demo

f=(k=b=x=35)=>x--?f(k*4853461&268435455):k&2?'N'+(k^12408877).toString(b):'Haystack'

console.log(f())

Explanation
The original function was:
f=(k=b=x=35)=>x--?f(k*74837258394056219&268435455):k&2?'N'+(k^124038877).toString(b):'Haystack'

which is more readable as:
f = (k=b=x=35) => {
    if (x--) {
        return f(k*74837258394056219&268435455);
    } else {
        if (k&2) {
            return 'N'+(k^124038877).toString(b);
        } else {
            return 'Haystack';
        }
    }
}

Note that when n=21625674, then n.toString(35) is 'eedle'.
The 35 in the input probably cannot be changed to a subset (because we want a base large enough to contain all the letters 'del', so we need a base that's at least 22). So the numbers to change are 74837258394056219, 268435455, and 124038877. We want to replace them with numbers a, b, c, each formed with a subset of the digits of the original numbers, such that the function g(k) = (k * a & b), starting with k=35 and iterated 35 times, and then XORed with c, gives 21625674.
For this one, after thinking a bit, as the lengths are small (the maximal a has length 17, b and c have length 9), I just used brute-force :-) Wrote a C++ program to generate all possible numbers a, b, c formed as subsets of the original numbers, iterate through all a and b, and check whether the required c was in the set. Runs in about 15 seconds, and the only output is a=4853461, b=268435455, c=12408877 (turns out the number b doesn't need to be changed). I'm not sure whether there's a more clever way of inverting this function.

Haystack, 82 bytes
Cracks HyperNeutrino's Answer
0\1-c\
/
?10F17+c8F+4+cd8F+3+c6-c1+c,c2+c8+c|
 0   \1++c,c|
F/c++2F8
c\8F+2+cd

Try it online!

Nice! The way I had it set up, my original solution was to literally just remove the 0 at the beginning :P Nice to see another approach though! +1

Brain-Flak, 96 bytes
Cracks Funky Computer Man's answer.
([((((()()())){}){}){}](()[()]({}([(((()()()){}))[]])[]({}({}()(((()(({}){}){}){}){}())))[]))())

Try it online!
This was a fun challenge.
The -24 at the beginning which converts y to a in the original is now used to convert e to M, which is then converted to N in place by changing the entire end loop to ()).  The first pushed letter k was changed to e simply by removing a push-pop that adds 6 to it.  The rest mostly just fell into place, with some humorous missteps along the way (including one program whose output was Meddle).
Comparison of the two programs:
Haystack: ([((((()()())){}){}){}](()([()](()({}([((((()()()){})))[]])[]({}({})[{}]()({}((()(({}){}){}){}){}())))[][][][][][]))[]))(((()[]){}){({}[()()])}{})
Needle:   ([((((()()())){}){}){}](() [()]   ({}([ (((()()()){})) []])[]({}({}     ()(  ((()(({}){}){}){}){}())))[]              ))   ()  )

I was sure that it would end like this

That certainly works, but I had somehow convinced myself that N was 77 instead of 78, so I didn't catch it.

Yours is shorter anyway.

Interesting solution!  I've added my intended solution to the original post if you would like to see it.

Haskell
Cracks @Laikoni's answer.
s=map;hay=zipWith;a=head;h=s a.(hay(scanr id).s a<*>s(succ<$))$words"Haysta ayst ackH ays k ayst"

Try it online!
Original code:
hays=map;hay=zipWith;stack=head;h=stack{-
 hay.(hays.(stackany hay$or id).stack hay
<*>hays(sum$stack haystack<$>hay))-}$words
 "Haystack Hayst ackH aysta ckH aystac k"

replacing removed characters with underscores:
___s=map;hay=zipWith;__a__=head;h=s______
 _a_.(hay__(s__c_an_______r id).s____ _a_
<*>___s(su_____c________c_<$____))__$words
 "Haysta__ _ayst ackH ays__ _k_ ayst____"

How Needle is constructed: the string at the end of the code is split into words. The first char of each word is incremented as many times as there are characters in the word, e.g.  Haysta -> H plus 6 chars -> N.

Hexagony, 17 bytes, H.PWiz
];N@cl;e;;(\.s.;_
Try it online!
Comparison with original:
];N.@cl;e@;;(\H/;ya;_.>s.;t//<._  original
];N @cl;e ;;(\       . s.;     _  modified

Visualisation:
  ] ; N
 @ c l ;
e ; ; ( \
 . s . ;
  _ . .

Explanation
Bonus marks - uses all 6 IPs and all but one of the cells!

The IP #0 starts by heading right along the black path into the ].
We then transition to IP #1, which heads along the red path, printing N with N; then wrapping back into the ] again.
We then transition to IP #2, which heads along the blue path, storing e in the current memory cell, then along the green path, executing (with a reflection at \) ;;(; which prints ee, decrements the memory cell from e to d then prints d.
The IP continues along the orange path, executing Nl;se which prints l, and stores e in the current memory cell. It continues along the brown path, printing the e with ;. By this point we have already printed Needle, so the rest is just finishing. The IP stores c, then hits ].

We then transition to IP #3, which heads along the blue path, hitting \, bouncing into _ which bounces into ].
We then transition to IP #4, which heads along the green path, bouncing on _, then \ and branching to ] (since c is positive).
Finally, we transition to IP #5, which stores e then exits with @.

Nice! That was the intended solution.

Python 2, 123 bytes
Cracks agtoever's Answer
import numpy
print "".join([dir(numpy)[int(i)][0] for i in numpy.poly1d([-143/2e1,-31,14,131,61,184])(numpy.arange(-3,3))])

repl.it
Comparison:
print "".join([dir(numpy)[int(i)][1-0] for i in numpy.poly1d([-1*1433/252e1,-3232/1920.,4026./72/2/3.,613/(6*4.)*1,-4723./1.8e2,-9763/120.,-2689/(-1+5*17.),1+138*.4*2])(numpy.arange(-12/3,13%9))])
print "".join([dir(numpy)[int(i)][  0] for i in numpy.poly1d([-1  43 /2  e1,-3    1    ,               1     4    ,       1         3 1   ,  6     1       ,1   8  4  ])(numpy.arange(-   3, 3  ))])

I had a lot of fun finding solutions that printed Meedle and Needlf by fitting a polynomial to the median of the indices of the numpy symbols that start with each of the letters in Needle. I then tried to find similar coefficients with subsets of the original program by hand, but I ended up having to resort to brute forcing one to find a valid solution.

Wow! Great job! I didn’t expect it to be cracked that soon.

I originally developed the challenge based on numpy 1.13, which I didn’t find in any repl environment, so I had to rewrite it for numpy 1.12... ;-)

Hexagony, 19 bytes, Martin Ender
[@;(...e<l.a;./;N>;

Try it online!
Comparison with original
H[@;(...e<l.a;./$.>;\sN;\ac.>).;;;._y
 [@;(...e<l.a;./   ;  N     >  ;

Unfolded code
  [ @ ;
 ( . . .
e < l . a
 ; . / ;
  N > ;

So, I've never written anything in Hexagony, but I figured with only 37 bytes that I could come up with the crack. Martin, I hope you know I put a lot of time into trying to figure this out. :)
I may be incorrect, but I will explain what I think this code is doing:
The program starts off with [, which automatically moves to IP #5. This IP starts in the west corner, heading toward the [ once again, which moves it to IP #4. From here, it executes N;e then heads to the southeast corner and executes ;, bounces to the right for another ; then wraps to ( which decrements the current e to a d. It then continues (with a wrap) to ...;. then bounces to the l and gets to the [ one last time, moving to IP #3. It executes ;, > redirects to the northwest to . then < redirects to the west, hitting e, wrapping to ;, and terminating on the @.
Verbose version

[   We move to the previous instruction pointer (starting at the e and moving NE)
e   e is entered into the current memory cell
(   Decrements the memory cell to d
[   We move to the previous instruction pointer (starting at the N and moving NW)
N   N is entered into the current memory cell
;   Outputs N
e   e is entered into the current memory cell (IP now wraps to the SE corner)
;   Outputs e
/   Mirrors IP to the east
;   Outputs e (IP now wraps to ( on NW edge)
(   Decrements the memory cell to d
... No-ops (IP now wraps to ; on SW edge)
;   Outputs d
.   No-op
/   Mirrors IP to the NW
l   l is entered into the current memory cell
.   No-op
[   We move to the previous instruction pointer (starting at the ; and moving west)
;   Outputs l
>   Redirects the IP NW
.   No-op
<   Redirects the IP west
e   e is entered into the current memory cell (IP now wraps to ; on the NE corner)
;   Outputs e
@   Terminates the program

I am so glad that you used a normal hexagon size for the Needle program; I was checking size 19 programs (for a length-3 side hexagon) when I realized you could remove any number of characters and it would automatically fill the hexagon with .s at the end, which would make it dramatically more difficult to crack. As it is, Hexagony is an evil language for this challenge because (mostly) any character that is removed changes the whole execution path of the program. That being said, I enjoyed trying to come up with this, even if I did end up brute forcing it at the end. :)

If I've messed up/missed anything, please let me know.

Nice work, this looks pretty accurate. I'll compare it with what I had originally over the weekend.

Javascript, 91 bytes
_=>(+{}+[])[+[]]+([][[]]+[])[3]+([][[]]+[])[3]+([][[]]+[])[2]+(![]+['t'])[2]+([][[]]+[])[3]

Cracks this. It actually was fun.

let f =

_=>(+{}+[])[+[]]+([][[]]+[])[3]+([][[]]+[])[3]+([][[]]+[])[2]+(![]+['t'])[2]+([][[]]+[])[3]

console.log(f())

Jelly, 14 bytes
Cracks Jonathan Allan's Answer
“¡#ɦṢÞɠ»ḟ“¡pṄ»

Try it online!
Comparison:
“¿ọ⁽ṅ*FỊ⁼g£¡#!ʋzoɦṪ£ṢÞḲÐɠ`”m3⁾“»jVḟ“¡!pṄ»
“          ¡#    ɦ  ṢÞ  ɠ      »  ḟ“¡ pṄ»

I used œc to iterate through various subsets of the literal strings, used tr -d for each possible filter, and greped for Needle.  Using the assumption that none of the used characters in the first string were used in the answer let it find an answer in under 15 seconds.

Exactly the one I had in mind Nebbed+ruble without any of rub.

Python 2, 73 bytes
Cracks user71546's Answer.
a,b,s=2707385038437,0b10000000,""
while a>0:
 s=chr(a%b)+s
 a//=b
print s

Try it online!
Solved with this program.

Java (OpenJDK 8), 191 bytes
Cracks Luke Steven's answer
String d(){int h=3905055,m=55,s=15443;String d="0"+h*2+""+m*20+""+s*7,x="",y;for(int g=0;g<d.length();g+=3){y="";for(int e=0;e<3;e++)y+=d.charAt(e+g);x+=(char)Integer.parseInt(y);}return x;}

Try it online!
Deleted chars:
int h=3609000-5055+911,m=557558,s=15441301-157*10000
       xx  xxx    xxxx     xxxx       x xxxxxxxxxxxx

This makes d evaluate to 078101101100108101, which spells Needle.

Ruby, 149 bytes
Cracks this: https://codegolf.stackexchange.com/a/144790/74216
Module was quite small, so I wrote a multi-threaded birthday thing and hoped for the best.
Edit: And after that found an even shorter answer.
x='hxDKFQOoqJLuVNW'
s="n=x.to_i 36;x.bytjs.jach_cons(3){|a,b,c|n+=n*b%c;n*=a^b};puts n%8675309==1388649 ?'Njjdlj':'Haystack'"
eval s.tr ?j,s.size.chr

Try it online!
Changes:
x='yGwztsPXhxDkBKlCYdFjQnpUROfoHvqmTgbaJSLcEiZrIAuMVNW'
x='        hxD  K    F Q    O o  q     J L       u VNW'

# and here's some more variants for extra pwnage:
x=' G  tsPx     KlCYd  Qn U   o v mT  a SLc    I u  NW'
x='  w  s    D BKl  dF QnpU O        ba SLcEiZrI  MV  '
x='yGwz s Xh Dk K C  F  npU O  Hvq   b   L    rIAu V W'

dc, 34 bytes
93 9 2*+432212+ 47*4242160 7 2++*P

Cracks this. TIO.
I started by getting the numerical representation of Haystack (5215583380252484459) and Needle (86197399743589). Next, I did a factorisation of the latter, which is 47*432323*4242169. From this, it was quite easy to reconstruct those numbers.
Marking the characters used:
6 93 3 9 2 2**+*+483622 1 2 3 3*+3*+89 47*+*+3 5 2* 269 158 9**107 97*2 4*++2 3 3*+42 14 2**+*+5*+5 2148 1 6 2*+*+68262 5 280 7 2 3 3*+5 2**+*+*+*+P
  XXX  XXX   XX  X X XX X X     X     XXXX                              X   X      XX X                    X                XXXXX     X     XX     X

gg! i knew that putting that much numbers was a bad idea)

@cab404 Just curious: did you use a very different calculation to get to 86197399743589?

yeah, it is a lot longer

Wow. That’s remarkable. That might be another codegolf question: how many ways are there to get a certain result by deleting characters in an expression...

i guess that would generally require some serious math to calculate all the posibilities and prove that there's only that number of them)

Java (OpenJDK 8), 151 bytes
Cracks Kevin Cruijssen's Answer
v->{String h="H";int x=7;return new String(new byte[]{(byte)((-~-~-~-~-~-~1^x++*x)+15),new Byte("10"+h.length())})+new StringBuffer("elde").reverse();}

Try it online!
Comparison:
v->{String h="Haystack";int x=-7;return x<0?h:new String(new java.math.BigInteger(new byte[]{(byte)((~-~-~-~-~-~-~-~-~-~1^-x++*x)+151),new Byte("2"+"1+\"0+\"".length()+(x=h.length()*4/x)+"-x-7")}).toByteArray())+(new StringBuffer("hidden".substring(++x%3^4,--x-x--).replaceFirst("dd","e"+(char)(x*211%+93))).reverse());}
v->{String h="H       ";int x= 7;return       new String(                         new byte[]{(byte)(( -~-~-~-~-~-~      1^ x++*x)+15 ),new Byte("    1   0  "          +   h.length()    )        })               + new StringBuffer("    e                                 l          d    e"      )             .reverse() ;}

I feel like the last part wasn't intended.

Lol ok, that's a smart way to make "edle". While fiddling around I already thought I did a bit too much and loads of solutions would be possible.. ;) The intended solution was: v->{String h="Haystack";int x=7;return new String(new java.math.BigInteger(new byte[]{(byte)((~-~-~-~-~-~-~-~1^-x++*x)+15),new Byte(""+10+((x=h.length()*4/x)+x-7))}).toByteArray())+(new StringBuffer("hidden".substring(++x%3,x).replaceFirst("d","e"+(char)(x*21+3))).reverse());} (don't know why I've included the BigInteger since just byte-array is enough..), but I like yours better.. :)

Brain-Flak, 102 bytes
(((((((((()()()){}){}){}){}()){}()))()()<>)(()()()){}())<>((()((){}<>)))(({})[(((()()){}())(){}){}()])

Cracks H.PWiz's answer.
Try it online!
((((((((((()()()){}){}()){}){}()){}()))<({}[(()()()()){}])(([[]]({})<>)<>)>((()()())){}{})[()]))<[[]()]>((()){}){}((){}[][(<>){}<>])(<>){}(({}<>()[()])[(((()()()){}<[()]>)<(()){}>{}){}()])
 (((((((((()()()){}){}  ){}){}()){}()))      ()()                   <>)     (()()()) {}    () ) <      >((()      ((){}    <>)     )   )  (({}        )[(((()()  ){}  ()  )  () {}   ){}()])

Ly, 21 bytes
(78)"e"sl(100)"l"l&o;

Try it online!
Cracks LyricLy's answer.

Java by Johnathan S.
import java.util.*;interface Main{static void main(String[]args){Stack<Hay>s=new Stack();s.add(new Needle());System.out.println(s.get(s.indexOf(new Hay())+1).a);}}class Needle extends Hay{{a="Needle";}}class Hay{String a="Haystack";public boolean equals(Object o){return getClass().equals(o.getClass());}}

TiO
Simply remove the loop that adds the Hay and nothing will be left on the stack but the needle.

Ha, nice one - I hadn't actually thought of simply removing the loop! Removing the equals method works just as well.

Vyxal o, cracks emanresu A's answer
‛₍∞

Try it Online!
Simply pushes the string Needle in compressed form, then prints it implicitly.
Characters removed:
‛Ha:₍₴Cv∑∑Ṙ⌊√‹½⇩⇩²C:₴«•∞yλ;ß4ġ∆Ė_□∴9«øc:3Ẏ$4ȯ∇ppĖ5e
 XXX XXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXX

Pyth, 21 bytes
Kr."Dn2û"2+Kr."EL8"Z

cracks this.
Try it online!

Of course, nice. It was just a first try, so the crack was fairly trivial ;-)

T-SQL by  phroureo, 757 bytes
seleCT 'Needle'

Somehow I don't think that was the intended solution. Uses the characters surrounded by {}:
create table a(l int,c int)
in{se}rt into a va{l}u{e}s (1,10),(2,1),(3,8),(4,0)
go
;CREATE FUN{CT}ION b(@ varchar(max)) returns varchar(max) as
begin return{ '}char('+@+'),'''','end
go
;CREATE FU{N}CTION h(@ varchar(max),@a varchar(max), @b varchar(max), @c varchar(max), @d varchar(max), @e varchar(max), @f varchar(max), @g varchar(max), @h varchar(max))
r{e}turns varchar(max) as
b{e}gin
return replace(replace(replace(replace(@,@a,@b),@c,@d),@e,@f),@g,@h)
end
{d}ec{l}ar{e} @x varchar(max),@ int=1,@y varchar(99)={'}'
,@D varchar(4)='Ha',@O varchar(4)='ys'
,@T varchar(3)='ta',@A varchar(4)='ck'
WHILE @<=4
BEGIN
set @y+=(SELECT dbo.b(c+100)from a where l=@)+' '
set @+=1
END
SELECT @x='select
left(dbo.h('''+@D+@O+@T+@A+''','+ left(@y,len(@y)-1) +'),char(56))'
execute(@x)

PHP
Cracks Titus answer
for($i=1;$c=H_aNyesetdalcek[$i+=2];)echo$c;

Try it online


text:
Primes in the prime factorisation
I saw another prime challenge coming by in PPCG, and I do love me some primes. Then I misread the introductory text, and wondered what the creative brains here had come up with.
It turns out the question posed was trivial, but I wonder if the same is true of the question I (mis)read:

\$6\$ can be represented by \$2^1\times3^1\$, and \$50\$ can be represented by \$2^1\times5^2\$.
Your task:
Write a program or function to determine how many distinct primes there are in this representation of a number.
Input:
An integer \$n\$ such that \$1 < n < 10^{12}\$, taken by any normal method.
Output:
The number of distinct primes that are required to represent the unique prime factors of \$n\$.
Test cases:
Input      Factorisation      Unique primes in factorisation representation
24         2^3*3^1            2 (2, 3)
126        2^1*3^2*7^1        3 (2, 3, 7)
8          2^3                2 (2, 3)
64         2^6                1 (2) (6 doesn't get factorised further)
72         2^3*3^2            2 (2, 3)
8640       2^6*3^3*5^1        3 (2, 3, 5)
317011968  2^11*3^5*7^2*13^1  6 (2, 3, 5, 7, 11, 13)
27         3^3                1 (3)

This is not an OEIS sequence.
Scoring:
This is code-golf, lowest score in bytes wins!

What is the expected result for 64? Is it 2 (2,3) (as 6 can be represented as 2*3) or 1 (2) (ignore the 6)?

for 64 the expected result is 1 (2). I like the idea of doing it recursively, but that's not the way I read the original question. I thought 8640 was a suitable test case, but should have been more explicit - thanks.

You claim this is not an OEIS sequence. Is it not A001221, the values of the (small) omega function?

A001221 is similar, but starts to diverge at terms 8 and 9 (here 2, A001221 1) because of the inclusion of the exponent as prime in this exercise.

Ah, I see. Write down the prime factorisation, then see how many different
primes I wrote (regardless of the role they played). I wonder what happens if you go a step further and factorise the exponent...

Mathematica, 39 bytes
Count[Union@@FactorInteger@#,_?PrimeQ]&

Try it online!
thanks to Martin Ender (-11 bytes)

Cases turns out to be shorter than Select (-4 bytes): Tr[1^Union@Cases[FactorInteger@#,_?PrimeQ,2]]& (passes all test cases on a fresh kernel)

How about Count[Union@@FactorInteger@#,_?PrimeQ]&? (Haven't checked all test cases.)

@MartinEnder seems like it should work. Passes all test cases too.

Jelly,  9  7 bytes
ÆFFQÆPS

Try it online! or Check out the test Suite.
How?

ÆFFQÆPS   ~ Full program.

ÆF        ~ Prime factorization as [prime, exponent] pairs.
  F       ~ Flatten.
   Q      ~ Deduplicate.
    ÆP    ~ For each, check if it is prime. 1 if True, 0 if False.
      S   ~ Sum.

05AB1E, 9 7 bytes
Saved 2 bytes thanks to Kevin Cruijssen
ÓsfìÙpO

Try it online!
Explanation
Ó        # push the prime factor exponents of the input
 sfì     # prepend the prime factors of the input
    Ù    # remove duplicates
     p   # check each if it is prime
      O  # sum

-1 byte by using €pO after merging the prime factors and exponents: ÓsfìÙ€pO

@KevinCruijssen: Thanks! Actually saves 2 since € isn't needed.

Ah, of course.. Wow, not sure how I missed that, haha xD

R + numbers, 80 78 bytes
function(n)sum(isPrime(unique(unlist(rle(primeFactors(n))))))
library(numbers)

Try it online!
Similar to Giuseppe (using numbers package and rle) but no assignments.

Nice to see a golf in R. Feel free to put your answer up in the language of the month thread.

Thank you @Razetime. I don't have enough reputation to edit the community wiki post, but you may feel free to add the entry for me!

Note that you don't need to include the code that gives a name to your function in the byte-count (unless this is required for the function to run), so you can make it 1-byte shorter: Try it.

Thanks for the tip, @DominicvanEssen.

MATL, 8 bytes
&YFhuZpz

Try it online!

Gaia, 6 bytes
ḋ_uṗ¦Σ

Try it online!

ḋ  computes the prime factorization, as [prime, exponent] pairs.
_ flattens the list.
u removes duplicate elements.
ṗ¦ maps through the elements and returns 1 if a prime is found, 0 otherwise.
Σ sums the list.

CJam (13 bytes)
{mFe__&:mp1b}

Online test suite
This is pretty straightforward: get primes with multiplicities, reduce to distinct values, filter primes, count.
Sadly Martin pointed out some cases which weren't handled by the mildly interesting trick in my original answer, although he did also provide a 1-byte saving by observing that since mp gives 0 or 1 it can be mapped rather than filtered.

Ohm v2, 6 5 bytes
-1 byte thanks to @Mr.Xcoder
ä{UpΣ

Try it online!

5 bytes: ä{UpΣ

@Mr.Xcoder Thanks! I was looking for that built-in but wasn't able to find it..

APL (Dyalog Unicode) + dfns, 29 bytes
⎕CY'dfns'
{≢∪⍵/⍨1pco⍵}∘∊2pco⊢

Try it online!
-6 bytes from Adám.
Explanation
{≢∪⍵/⍨1pco⍵}∘∊2pco⊢ ⊢ → input
                2pco  prime factors and exponents as matrix
{            }∘∊      flatten and use as right arg for:
    ⍵/⍨              filter out values in arg
        1pco⍵         which aren't prime
 ≢∪                   count the unique values

Actually, 7 bytes
w♂i╔♂pΣ

Try it online!
Explanation:
w♂i╔♂pΣ
w        factor into [prime, exponent] pairs
 ♂i      flatten to 1D list
   ╔     unique elements
    ♂p   for each element: 1 if prime else 0
      Σ  sum

Husk,  11  10 bytes
#ṗuS+omLgp

Try it online!

EDIT: Saved 1 byte thanks to Zgarb.

#ṗuS+omLgp saves a byte.

Python 2, 142 135 119 bytes
f=lambda n,d=2:n-1and(n%d and f(n,d+1)or[d]+f(n/d))or[]
p=f(input())
print sum(f(n)==[n]for n in set(p+map(p.count,p)))

Try it online!

Brachylog, 7 bytes
ḋọcdṗˢl

Try it online!
           The output
      l    is the length of
  c        the concatenated
 ọ         list of pairs [value, number of occurrences]
ḋ          from the prime factorization of
           the input
   d       with duplicates removed
    ṗˢ     and non-primes removed.

A fun 9-byte version: ḋọ{∋∋ṗ}ᶜ¹

Ruby -rprime, 66 bytes
->n{Prime.prime_division(n).flatten.uniq.count{|i|Prime.prime? i}}

Try it online!

49 bytes by using the builtin functions added to the number classes when prime is imported

Japt, 11 bytes
k
âUü ml)èj

Try it
Alternative
k
â¡x¶X})xj

Try it

Husk, 9 bytes
#ṗuṁS:Lgp

Try it online!
Slight improvement over Mr. XCoder's answer.

Vyxal s, 37 bitsv2, 4.625 bytes
ǐĊfUæ

Try it Online!'
Takes the counts of the prime factorization which gives a list of [prime, exponent] for each prime, flattens, uniquifies, finds the primes.

Maxima, 104 bytes
So long, it can be golfed much more.
Try it online!
f(n):=lreduce(lambda([x,y],x+y),map(lambda([x],if primep(x)then 1 else 0),unique(flatten(ifactors(n)))))

R + numbers, 92 bytes
function(n)sum(1|unique((x=c((r=rle(primeFactors(n)))$l,r$v))[isPrime(x)]))
library(numbers)

Try it online!

Pyth, 15 bytes
smP_d{+PQlM.gkP

Try it here!

J, 20 bytes
3 :'+/1 p:~.,__ q:y'

Counted by hand lol, so tell me if this is off.
Any golfing suggestions?
Boring submission: flatten the prime factorization table and count primes.

Pari/GP, 47 bytes
n->#Set(select(isprime,concat(Vec(factor(n)))))

Try it online!

Javascript (ES6), 145 bytes
n=>{for(a=[b=l=0],q=n,d=2;q>=2;)q%d?(b&&(a.push(0),l++),d++,b=0):(q/=d,a[l]++,b=1);for(i in a){for(d=1,e=a[i];e%d;d++);e-d||n%e&&l++};return l+1}

Factor, 62 bytes
group-factors flatten unique values [ prime? ] filter length ;

Attempt This Online!

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


text:
Smaller-Base Palindromes
For the purpose of this challenge, a smaller-base palindrome (SBP) is a number which is palindromic in a base between 1 and itself (exclusive), and is not a repdigit in the same base.  For example, 5 is a SBP because it is a palindrome in base 2 (101).  The first few SBPs are 5,9,10,16,17,20,21,23,25,26,27,28,29,33...
Your Task:
Write a program or function that, when given an integer i as input, returns/outputs the ith SBP.
Input:
An integer i where 0 <= i < 1,000,000.
Output:
The ith SBP.
Test Cases:
12 -> 29
18 -> 41

Scoring:
This is code-golf, lowest score in bytes wins!

Sandbox

It's not in the OEIS? Weird...

@Rod 6 is a repdigit

@NieDzejkob thanks, I overlooked that part

Surprisingly, this is actually (relatively) difficult in some golfing langs.  (relatively meaning ~15 bytes instead of ~3)

@Emigna, thank-you, fixed.  I did these by hand, so I apparently missed that one.

@NieDzejkob, I agree it is weird that it isn't in the OEIS, but unless I was wrong about something between 5 and 26, it isn't.

@Gryphon you should submit it

What is a "repdigit"? I assume it's a single digit repeated? This is never clarified or defined.

Also, what is the result for i = 999,999?

as your examples are 0-indexed, shoudn't your i be in range 0<=i ?

From one of gryphon's closed challenges, [https://codegolf.stackexchange.com/questions/125947/am-a-i-square-repdigit?rq=1 ], A repdigit is an integer that contains only one digit (e.g. 2, 44, 9999) which explains why 3 isn't an SBP since 11 is a palidronme but all the digits are the same

Every number is a repdigit in some base. Do you mean to exclude only base 10 repdigits?

How is 33 not a repdigit?  It's given as an example of a SBP. For that matter how is 5 not?

Ah, sorry.  Ignore that previous comment, I thought it was about another challenge.  I'll delete it now.  What I meant on this challenge was that only palindromes in smaller bases that are not repdigits count.

So 5 is a SBP because it is a palindrome, but not a repdigit, in base 2.

Python 2, 133 119 bytes
-3 thanks to Ovs
-5 thanks to Lynn
1-indexed
j=i=0
n=input()
while n:
 j+=1;l=[];N=i
 while N:l+=N%j,;N/=j
 if{i%j}<set(l)>l==l[::-1]or j>i:n-=j<i;i+=1;j=1
print~-i

Try it online!

What does .; do in while N:l+=N%j,;N/=j?

@NieDzejkob the comma? it makes a tuple of size 1. in python a tuple can be written as (1, 2, 3), but for a tuple of size 1 you must place an extra comma at the end as (1,)

Rolling the loops into one is slick. Here’s 119 bytes.

05AB1E, 15 bytes
µNDLвʒÂQ}ʒË_}gĀ

Try it online!
Explanation
µ                 # loop until input matches are found
 N                # push current iteration number
  D               # duplicate
   L              # range
    в             # convert to each base
     ʒÂQ}         # filter, keep elements that are equal to their reverse
         ʒË_}     # filter, keep elements that are not all equal
             g    # length
              Ā   # is trueish (not zero)

Jelly, 12 bytes
bṖEÐḟŒḂÐfµ#Ṫ

Try it online!
-2 thanks to Jonathan Allan, one being for, well, obvious stuff >_>
Explanation:
bṖEÐḟŒḂÐfµ#Ṫ Special quick behavior requires full program
bṖEÐḟŒḂÐf #  Get the first (STDIN number)th integers with truthy results under this
             function starting from 0
 Ṗ             Make range [1..tested integer)
b              Convert the tested integer to each base in the range above
  EÐḟ          Remove repdigits (i.e. negative filter by all-equal)
     ŒḂÐf      Keep palindromes (i.e. filter by is palindrome)
         µ Ṫ Pop the last element of the integer list formed

One byte save: Ṗ⁸b -> bṖ

Another byte save - take input and remove the 5

@JonathanAllan Except your second byte save won't really work. Dunno what was I thinking with the first one though >_>

At what point will the result deviate? My thinking: the 5 stops the monad's argument acting as the starting point (without that a monadic link would deviate from 6 up since it would start counting n of the # at the wrong point) but a niladic link uses 0 implicitly here, so allows us to use a full program that takes input from STDIN to save a byte.

@JonathanAllan ...niladic? I'm calling it as a monad here, the "last argument" is included. EDIT: take input? now I get it

Pyth, 14 bytes
e.f_I#ft{TjLZS

Try it here.
1-indexed.
Explanation:e.f_I#ft{TjLZSZQ Trailing ZQ is implicit
 .f            Q Find the first Q (input) positive integers that return a truthy result for
             SZ    Make range [1..Z (tested integer)]
          jLZ      Convert Z to each base in the range
      f            Filter by "non-repdigit"
        {T           Unique elements of T (tested element)
       t             Remove first element
   _I#             Filter by Invariant with Reverse (i.e. palindrome)
e                Take last element

Python 2, 125 bytes
n=5
i=input()
while i:
 n+=1;b=1
 while b<n:
	b+=1;l=[];a=n
	while a:l+=a%b,;a/=b
	if{n%b}<set(l)>l==l[::-1]:i-=1;b=n
print n

Try it online!
n represents the integer we test for SBP-ness as we count up.
i is the input: it is decremented each time n is an SBP.
We loop over bases b from 2 to n inclusive* and compute the (backwards) base-b representation of n: this is l. The only real magical part is the chained comparison {n%b}<set(l)>l==l[::-1]:

{n%b}<set(l) makes sure l contains at least two distinct digits (i.e. n is not a repdigit), by checking that {n%b} is a strict subset of set(l). (We know n%b is in l as n%b is the last digit of n in base b.)
set(l)>l is always true because of how Python sorts types.
l==l[::-1] checks that l is a palindrome.

One final trick is using b=n instead of break to exit the loop.
(*It’s safe to include n in the loop, as n in base n is always 10, which isn’t a palindrome. (while b<n looks like we exclude n, but note where the b+=1 is!))

wut? 2 little changes from mine deserved another answer? but the explanation was nice

I didn’t base my answer off yours. I just read the challenge, wrote an answer, and posted it.

but they were identical, except for the while b<n instead of a for and the break bit

Yes, because almost everything about this problem is about as straightforward as it gets. (What am I gonna do, not loop while i:? Not increment n? :)) Over on anarchy golf users regularly come up with nearly identical answers. (See also: our policy on duplicate answers.)

Dyalog APL, 53 bytes
{{∨/∧/¨((1<≢∘∪)∧⌽=⊢)¨(⍵+1)⊥⍣¯1⍨¨1↓⍳⍵+1:⍵+1⋄∇⍵+1}⍣⍵⊢2}

Try it online!

Perl 6, 83 bytes
{(5..*).grep({grep {.Set>1&&[.reverse]eqv$_},map {[.polymod($^a xx*)]},2..$_})[$_]}

Try it
Expanded
{
  # create a list of SBPs
  (5 .. *).grep(
    {
      # find out if the current value is a SBP

      grep
      {    # parameter is $_
        .Set > 1              # is there more than one distinct digit?
        &&
        [.reverse] eqv $_     # is it the same in reverse?
      },
      map
      {    # parameter is $a
        [                     # put into an Array so it is not a one shot Seq
          .polymod( $^a xx *) # convert into new base
        ]
      },
      2 .. $_                 # possible bases
                              # (don't need to exclude $_ here)
    }

  )[ $_ ]                     # index into the list of SBPs
}