text:
Goodness Giza Golf!
A "Giza number", also colloquially known as a Timmy Number is any number where the digits represent a pyramid (A134810). For example, "12321" is a giza number because it can be visualized like this:
  3
 2 2
1   1

However, something like "123321" is not a Giza number because there are two digits at the top of the pyramid
  33
 2  2
1    1

In other words, a number is a Giza number if all of the following conditions are met:

It has an odd number of digits, and the center digit is the largest
It's palindromic (the same read forwards or backwards), and
The first half of the digits are strictly increasing by one. (Since it must be palindromic, this means the second half of the digits must be strictly decreasing by one)

You must write a full program or a function that takes a positive integer as input, and determine if it is a Giza number or not. You may take the input as a string or as a number. If it is a Giza number, output a truthy value. Otherwise, a falsy value.
There are a total of 45 Giza numbers, so any one of these inputs should result in a truthy value:
1
2
3
4
5
6
7
8
9
121
232
343
454
565
676
787
898
12321
23432
34543
45654
56765
67876
78987
1234321
2345432
3456543
4567654
5678765
6789876
123454321
234565432
345676543
456787654
567898765
12345654321
23456765432
34567876543
45678987654
1234567654321
2345678765432
3456789876543
123456787654321
234567898765432
12345678987654321

Any other input should give a falsy value. Of course, you do not have to handle invalid inputs, such as non-positive numbers, non-integers, or non-numbers.
As usual, this is code-golf, so standard loopholes are banned, and the shortest answer in bytes wins!

what about 0? is that a thruthy?

@tuskiomi Technically, no, but it's irrelevant because you do not have to handle non-positive numbers.

The reason I ask is because if it is a giza number, then numbers like 1210, 123210, etc would also be truthy.

@tuskiomi Neither of those are palindromic or have an odd number of digits. Unless you're counting a leading 0 but that makes everything way more complicated.

Is 0787 truthy? Or should we not ignore the leading zero?

@nedla2004 I think leading 0's makes input formats more complicated. To keep everything nice and simple, we'll say you can assume that inputs will not contain leading 0's.

Python 2, 48 47 46 bytes
lambda s:s[~len(s)/2:]in'987654321'>s==s[::-1]

Test it on Ideone.
How it works
In Python, a chained comparison returns True if and only if all individual comparison do the same. In this specific case, our lambda returns True if and only if all of the following conditions are met.

s[~len(s)/2:]in'987654321'
For a string s of length 2n + 1, ~len(s)/2 returns ~(2n + 1) / 2 = -(2n + 2) / 2 = -(n + 1), so s[~len(s)/2:] yields the rightmost n + 1 characters of s.
Similarly, for a string s of length 2n, ~len(s)/2 returns ~(2n) / 2 = -(2n + 1) / 2 = -(n + 1) (integer division always round towards -∞, so s[~len(s)/2:] once more yields the rightmost n + 1 characters of s
The comparison returns True if and only if the rightmost n + 1 characters form a substring of 987654321.
Note that if they do and s has 2n characters, s cannot be a palindrome; the nth and (n+1)th characters from the right will be distinct, and the latter is the nth character from the left.
'987654321'>s
This compares the strings lexicographically. Since 9 is the only Giza number that starts with 9, all Giza numbers satisfy this comparison.
Note that comparing these strings does not form part of our decision problem; >s is simply three characters shorter than and s.
s==s[::-1]
This returns True if and only if s is a palindrome.

This answer is insane wizardry. I understand how bits and pieces of it work, but can't even begin to comprehend how you came up with it. And for a moment there, I was proud of my 64. +1

i love the guaranteed comparison to save those 3 bytes

Perl, 39 37 42 39 + 1 = 40 bytes
Using a new method, I managed to cut down a huge number of bytes.  Run with the -n flag.  Accepts input repeatedly at runtime, printing 0 or 1 accordingly.
I had to add 5 bytes because I realized without it, the code worked for inputs such as 1234567900987654321, which is not a Giza number.  Since Giza numbers never contain the digit 0 (and all false positives by necessity would contain the digit 0), these 5 bytes account for that.
say!/0/*($_- s/..?/1/gr**2)=~/^(.)\1*$/

Explanation:
say!/0/*($_- s/..?/1/gr**2)=~/^(.)\1*$/  #$_ contains input by default.
   !/0/                                  #Ensure that the initial text doesn't contain the number 0
       *                                 #Since both halves of this line return either 0 or 1, multiplying them together only yields 1 if both are true (which we want).
             s/   / /gr                  #Perform a substitution regex on $_ (see below)
                                         #/g means keep replacing, /r means don't modify original string; return the result instead
               ..?                       #Replace 1 or 2 characters (2, if possible)...
                   1                     #...with the number 1
                       **2               #Square this number...
        ($_-              )              #...and subtract it from the input
                           =~            #Do a regex match on the result
                             /^      $/  #Make sure the regex matches the WHOLE string
                               (.)       #Match any character...
                                  \1*    #...followed by itself 0 or more times
say                                      #Finally, output the result of the whole line of code.

The purpose of the substitution regex is to construct a string of 1s whose length is half the length of the input, rounded up.  Thus, an input of 12321 will produce the string 111, which then gets squared (explanation below).  Even-length inputs will produce strings that are too small to ensure the final regex is successful.
The reason this code works is because of the following:
        1         =         1**2
       121        =        11**2
      12321       =       111**2
     1234321      =      1111**2
    123454321     =     11111**2
   12345654321    =    111111**2
  1234567654321   =   1111111**2
 123456787654321  =  11111111**2
12345678987654321 = 111111111**2

We can clearly see that the number of 1's in RHS is equal to 1/2 more than half the size of LHS. (1 more if we truncate).  Additionally:
567898765 - 123454321 = 444444444, which is just 4 repeating.  So when we subtract our square from our number, if we get a repdigit, our original number is a Giza number.
Old code and old method (58 + 1 = 59 bytes)
Saved 1 byte thanks to @Dada
Run with the -n flag, pipe text in using echo
say$_==($;=join"",/(.)/..($==y///c/2+/(.)/)-1).$=.reverse$

Calculates the unique giza number determined by the length and the leading integer, and sees if it matches the input.
Run as echo -n "123454321" | perl -M5.010 -n giza.pl
Returns 1 if it's a Giza number, null otherwise.

That's a beautiful observation for the second method.

Jelly, 10 7 6 bytes
9ẆŒBḌċ

Generates all 45 Giza numbers numbers, then tests for membership.
Try it online! or see the generated numbers.
How it works
9ẆŒBḌċ  Main link. Argument: n

9       Set the return value to 9.
 Ẇ      Windows; yield all "substrings" of [1, ..., 9].
  ŒB    Bounce; map each [a, ..., b] to [a, ..., b, ..., a].
    Ḍ   Undecimal; convert the digit arrays to integers.
     ċ  Count the number of occurrences of n.

Java 7, 128 119 105 bytes
boolean t(long n){long a=1,b=1,c=0;for(;a<n/10;b=b*b<=n/10?b*10+1:b,c^=1)a=a*10+1;return(n-b*b)%a<1&c<1;}

No more strings! So, now I start by generating a 111... number of the same length as input (a), and one shorter to square (b). Then you can subtract b*b from the input and check divisibility by a. c is just there to check odd/even, pay it no mind >_>
Whitespaced:
boolean t(long n){
    long a=1,b=1,c=0;
    for(;a<n/10;b=b*b<=n/10?b*10+1:b,c^=1)
        a=a*10+1;
    return(n-b*b)%a<1&c<1;
}

Old Method, 119 bytes
boolean g(char[]a){int i=1,l=a.length,b=1,d;for(;i<l;b*=i++>l/2?d==-1?1:0:d==1?1:0)d=a[i]-a[i-1];return b>0?l%2>0:0>1;}

Walks through the array, checking for a difference of 1 (or -1, depending on which half) between each digit. Then just checks to see the length is odd.
Whitespaced:
boolean g(char[]a){
    int i=1,l=a.length,b=1,d;
    for(;i<l;b*=i++>l/2?d==-1?1:0:d==1?1:0)
        d=a[i]-a[i-1];
    return b>0?l%2>0:0>1;
}

Why do you need to check to see if the first is the same as the last?

I have no idea what you mean >_>

Is this a valid answer considering the problem specifies that the function must take a positive integer? Of course a char array can represent a positive integer, but I think it's an important distinction.

@Hypino The problem says input can be taken as a string or integer, and char[] counts as a string here, so I'd say it's valid.

@Geobits Ah I did miss the part where it said it could be taken as a String.

Can you compile it to the equivalent of C#'s Func<long, bool> to save bytes or is that a JavaScript thing? I don't really know Java or JavaScript...

Gotcha by 3 now ;)

You can use an lambda func like n->{...} or use int as return type and apply ?1:0 to the return.

@Roman No lambdas in Java 7, and the int thing isn't considered a truthy return here for Java.

JavaScript (ES6), 46 45 42 41 bytes
f=([c,...s])=>s+s&&c-s.pop()|c-~-f(s)?0:c

Takes input as a string and returns a single-digit string for truthy, 0 for falsy.
The basic idea is to check for a few things:

If the string is one char long, OR
the first char is the same as the last char, and
the middle section is also a Giza number, and
the second char is one more than the first char here.

Sorry, I misread the question.

PowerShell v3+, 147 108 67 bytes
$args[0]-in(1..9+(1..8|%{$i=$_;++$_..9|%{-join($i..$_+--$_..$i)}}))

Radically changed approach. Generates all possible Giza numbers, and then checks whether the input $args[0] is -in that collection. Below is how the collection of Giza numbers is formed:
1..9+(1..8|%{$i=$_;++$_..9|%{-join($i..$_+--$_..$i)}})
      1..8|%{                                       }  # Loop from 1 up to 8
             $i=$_;                                    # Set $i to the current number
                   ++$_..9|%{                      }   # Loop from one higher up to 9
                                   $i..$_+--$_..$i     # Build two ranges and concatenate
                                                       # E.g., 2..5 + 4..2
                             -join(               )    # Join into a single string
1..9+(                                               ) # Array concatenate with 1 to 9

Example runs:
PS C:\Tools\Scripts\golfing> 12321,5678765,121,4,123321,1232,5678,13631|%{"$_ --> "+(.\giza-numbers.ps1 "$_")}
12321 --> True
5678765 --> True
121 --> True
4 --> True
123321 --> False
1232 --> False
5678 --> False
13631 --> False

108 -> 67... looks like you win this time (and probably most of the time) :P

05AB1E, 9 8 bytes
Truthy is 1, falsy is 0.
9LŒ€ûJ¹å

Uses the CP-1252 encoding. Try it online!

I think that 2ä¬û¹Q would work as well and saves two bytes.

@Osable 12521 isn't a giza number, this fails for the middle element.

I realize now that i skipped the third point (consecutive digits). Nevermind!

Ahhhh... I was using prefixes, I'll keep substrings in mind for future efforts, neat little hack.

Python 2, 77, 76, 64, 63 bytes
f=lambda s:2>len(s)or(s[0]==s[-1]==`int(s[1])-1`and f(s[1:-1]))

A simple recursive solution. Checks to see if the first and last digits equal each other and the second digit minus one. Then checks if the middle is also a Giza number. Returns true once it gets down to a single digit.
One byte saved thanks to @Rod, a ton of bytes saved thanks to DLosc and ETHProductions!

you can swap len(s)==1 with 1==len(s) to save 1 byte on the space, also, the ands could be replaced with * to save 3 bytes

Just to add to Rod's comment: 1or works too. (As long as it's not a 0 preceding the o--then Python thinks it's an octal number.)

@Rod Ooh, good idea. I thought the same thing about *, but that throws some weird indexing errors with even length strings. Not sure why

You generally can't replace and with * when short-circuiting behavior is required, as it is in a recursive function. The first and should be replaceable, but it needs two sets of parentheses, which negates any savings. (cc: @Rod)

I don't know much Python, but could you 1) remove the int() around s[0] or 2) use s[0]==`int(s[1])-1` ?

Building on @ETHproductions suggestion: s[-1]==s[0]==\int(s[1])-1`` (requires Python 2 specifically).

@DLosc That's genius. Thanks!

One more byte, since empty string is an invalid input ("non-number"): 2>len(s). (Originally thought this wouldn't work because of the recursive case, but the s[1] check prevents the recursion from ever getting down to an empty string.)

Python 2, 68 73 66 bytes
lambda n:n==`int('1'+len(n)/2%9*'1')**2+int(len(n)*`int(n[0])-1`)`

abusing the fact that 11^2=121, 111^2=12321 and so on, I calculate this and add 1111.. enough times as offset.Examples:
23432=111^2+11111*1
676=11^2+111*5

Since you are not calling f, you don't need to actually name it. You can save two bytes by removing f=

You should set a cap on this. Input 1234567900987654321 returns true, when it should be false.

@Geobits ooops, fixed (I guess?)

Python 3, 65 bytes
lambda x:len(x)<18and x[:len(x)//2+1]in'0123456789'and x[::-1]==x

I'm not entirely sure, but I think this works.

There are no Giza numbers that start with 0, you can remove that :) There also won't be any numbers longer than 17 that satisfy that condition so you don't need that either. It's essentially the same solution Dennis has :)

@Shebang but this one was posted first...

@Rod I wasn't claiming he copied or anything :)

@Shebang Neither am I c:

Perl, 41 bytes
40 bytes of code + -p flags.
s/(.)(?=(.))/$1-$2/ge;$_=/^(-1(?1)1|).$/

Outputs 1 if the input is a Giza number, nothing otherwise. Supply the input without final newline to run it :
echo -n '123456787654321' | perl -pe 's/(.)(?=(.))/$1-$2/ge;$_=/^(-1(?1)1|).$/'

Explanations : first, s/(.)(?=(.))/$1-$2/ge replace each digit $1 (followed by $2) by $1-$2. If it's a Giza number, then each digits being one less than the next in the beginning, and one more in the end, then the string should contain only -1 in the first part, and 1 in the second (except the last that is left unchanged). That's what the second part /^(-1(?1)1|).$/ checks : looks for a -1 followed by recursion followed by a 1.
-1 byte thanks to Martin Ender.

My previous version 15 bytes longer (quite different so I'll let it here) :
echo -n '123456787654321' | perl -F -pe '$\=$_ eq reverse;$\&=$F[$_-1]+1==$F[$_]for 1..@F/2}{'

The only part of this I don't understand is the purpose of the | in the second regex.

@GabrielBenamy That's the base case of the recursive block (ie. it matches nothing and stops the recursion).

C#, 120 86 108 102 92 bytes
x=I=>{var Z=I.Length;return Z<2?1>0:I[0]==I[Z-1]&I[1]-0==I[0]+1?x(I.Substring(1,Z-2)):0>1;};

Full program with some test cases:
class a
{
    static void Main()
    {
        Func<string, bool> x = null;

        x = I=>
        {
            var Z=I.Length;
            return Z==1?                           // length == 1?
                     1>0:                          // return true (middle of #)
                     I[0]==I[Z-1]&I[1]-0==I[0]+1?  // else start == end and the next number is 1 above the current?
                       x(I.Substring(1,Z-2)):      // recursive call on middle
                       0>1;                        // else false
        };

        Console.WriteLine("1 -> " + (x("1") == true));
        Console.WriteLine("9 -> " + (x("9") == true));
        Console.WriteLine("121 -> " + (x("121") == true));
        Console.WriteLine("12321 -> " + (x("12321") == true));
        Console.WriteLine("4567654 -> " + (x("4567654") == true));
        Console.WriteLine("12345678987654321 -> " + (x("12345678987654321") == true));
        Console.WriteLine("12 -> " + (x("12") == false));
        Console.WriteLine("1221 -> " + (x("1221") == false));
        Console.WriteLine("16436346 -> " + (x("16436346") == false));
        Console.WriteLine("123321 -> " + (x("123321") == false));
        Console.WriteLine("3454321 -> " + (x("3454321") == false));
        Console.WriteLine("13631 -> " + (x("13631") == false));
        Console.WriteLine("191 -> " + (x("13631") == false));
        Console.Read(); // For Visual Studio
    }
}

Hooray for single line conditionals, now beating the Java answer :)!  Also got to write my first explaining comments, though it's probably self explanatory.  Thanks to @Dada for finding a problem with my algorithm (was true for numbers that were mirrored like 13631).  Now sub 100 since apparently checking for length%2 is redundant.

Wouldn't this return true for numbers like 13631 ? Also since you make a recursive call to x, I think you need to include x= in your byte count.

@Dada Heh good point, knew I was missing something...  And alright, I'll add those to the count.

Wait, you're beating what now? ;)

@Geobits Dangit!  I'll see what I can do tomorrow :P

><> FISH 57 52 49 48 bytes
i:1+?!vi00.;n1<
%?v0n;>~l:1-?!^2
{:<11 ^?:=@:$+=

Edit 1: = returns 0 or 1 if true so removed a check and used this value to increment, then it checks equality after anyway. (saved 6 bytes, lost 1 for new line).
Edit 2: 3 directional markers removed and 11 placed into gap to offset the stack to an even length to force false ( 3 bytes saved).,
Edit 3: Duplicate the length of the stack for checking MOD by 2 and len(1), this was done by putting the length on twice before but this now filled an empty space on line 2 ( 1 byte saved).

Bash, 111 bytes
UPDATE
Note that input number normalization can probably be skipped completely, if you just add the first digit back to your generated GIZA number, like that:
01210 + 6 => 67876

and then just compare it with the input directly.
Disclaimer:  this one is not really optimized, so it is more a proof of concept than a real contender
Golfed
G() { I=`sed "s/./\0-${1::1}\n/g"<<<$1|bc`;Z=`seq 0 $((${#1}/2))`;A=`rev <<<$Z`;cmp -s <(echo $I) <<<$Z${A:1}

Algorithm
Any GIZA number can be normalized to its canonical form, by substracting its first digit from the rest:
67876 - 6 => 01210
78987 - 7 => 01210

and there is only one canonical GIZA number of a particular length.
Knowing this we can easily generate a canonical GIZA number based on the input number length:
 Z=`seq 0 $((${#1}/2))`;A=`rev <<<$Z` => $Z${A:1}

then normalize the input number:
 I=`sed "s/./\0-${1::1}\n/g"<<<$1|bc`

and compare
 cmp -s <(echo $I) <<<$Z${A:1};

Test
for i in `seq 0 1000`; do G $i && echo $i; done

0
1
2
3
4
5
6
7
8
9
121
232
343
454
565
676
787
898

...

G 12345678987654321 && echo "OK" || echo FALSE
OK

G 123456789987654321 && echo "OK" || echo FALSE
FALSE

I hope you don't mind, I implemented a part of this algorithm in my answer :)

Mathematica, 56 bytes
This is a little shorter:
MatchQ[Differences@IntegerDigits@#,{a:1...,b__}/;b==-a]&

Racket 292 bytes
(let*((s(number->string n))(sn string->number)(st string)(lr list-ref)(sl(string->list s))(g(λ(i)(-(sn(st(lr sl(add1 i))))
(sn(st(lr sl i)))))))(cond[(even?(string-length s))#f][(not(equal? s(list->string(reverse sl))))#f][(andmap identity
(for/list((i(floor(/(length sl)2))))(= 1(g i))))]))

Ungolfed:
(define(f n)
  (let* ((s (number->string n))
         (sn string->number)
         (st string)
         (lr list-ref)
         (sl (string->list s))
         (g (λ (i) (- (sn(st(lr sl (add1 i))))
                      (sn(st(lr sl i)))))))
    (cond
      [(even? (string-length s))
       #f]
      [(not(equal? s (list->string (reverse sl))))
       #f]
      [else
       (andmap identity
               (for/list ((i (floor(/(length sl)2))))
                 (= 1 (g i))))]
      )))

Testing:
(f 12321)
(f 123321)  ; only this should be false;

(f 9)
(f 787)
(f 67876)
(f 4567654)
(f 123454321)
(f 12345654321)
(f 1234567654321)
(f 123456787654321)
(f 12345678987654321)

Output:
#t
#f
#t
#t
#t
#t
#t
#t
#t
#t
#t

Retina, 55 54 36 bytes
Byte count assumes ISO 8859-1 encoding.
.
$*1:
+`^(1+:)(1\1.*)\b\1$
$2
^1+:$

Try it online
Convert each digit to unary, separated by colons. Loop, removing matching outer digits if the next digit is one more. Match a single remaining digit.

This accepts 12312

This works in 36 bytes.

Octave, 56 bytes
@(n)nnz(n)<2||~(abs(diff(+n))-1)&&diff(+n(1:1+end/2))==1

Check out all test cases here.
This would be two less bytes in MATLAB, since diff(n) works for strings. In Octave, you need diff(+n).
Explanation:
@(n)                  % Anonymous function taking a string `n` as argument
    nnz(n)<2          % True if there is only one element in n
            ||        % Short circuit or operator. Expression will be true if this is true
~(abs(diff(+n))-1)    % Takes the absolute value of the difference between adjacent numbers
                      % which should always be 1. Subtracts 1, to get 0
                      % and negates it to get 1 (true)
diff(+n(1:1+end/2))==1   % Checks if the difference between the first half of the numbers
                         % is 1.
                      % If either the first, or both the second and third argument is true
                      % then the function will return 1, otherwise 0.

Actually, 22 bytes
9uR;∙`xR;RdX+εj`M;░#íu

Try it online!
Takes input as a quoted string (e.g. "12321"). Output is a positive integer for true, and 0 for false.
Explanation:
9uR;∙`xR;RdX+εj`M;░#íu
9uR;∙                   cartesian product of [1,2,3,4,5,6,7,8,9,10] with itself
     `xR;RdX+εj`M       for each pair:
      x                   construct the half-open (end-exclusive) range ([1, 5] -> [1, 2, 3, 4])
       R                  reverse
        ;RdX+             duplicate, reverse, remove first element, prepend ([1, 2, 3, 4] -> [1, 2, 3, 4, 3, 2, 1])
             εj           concatenate into a string
                 ;░     filter out empty strings
                   #íu  test for membership

Haskell, 62 bytes
(`elem`[[j..pred i]++[i,pred i..j]|i<-['1'..'9'],j<-['1'..i]])

The input is taken as a string.
Creates a list of all Giza numbers an checks if the number is in it. The list is created by looping i through '1'..'9' and then j through '1'..i and creating the elements j .. i-1 , i , i-1 .. j.

Java 7, 129 119 109 bytes
boolean e(char[]a){int l=a[0]-1,f=0,b=a.length-1;for(;f<b&&a[f]==++l&a[f++]==a[b--];);return f==b&l==a[b]-1;}

Old Recursive Method, 119
boolean b(char[]a){int b=a.length;return b>1&&a[0]==a[b-1]&a[0]+1==a[1]?b(java.util.Arrays.copyOfRange(a,1,b-1)):b==1;}

-10 bytes thanks to Geobits. We are were tied...
Try it online!

I think you could save 1 byte with bitwise and, I think you used it once but didn't the other time?  Or I'm reading it wrong.

@Yodle I only used it once because I need to short circuit for the first condition.

It looks like you're only using the import once, so you should be able to shorten this by using java.util.Arrays.copyOfRange(...) to skip the import line.

@Geobits good catch... I derp

Mathematica, 62 61 60 bytes
Saved 2 bytes due to @MartinEnder.
MatchQ[{a:1...,b___}/;{b}==-{a}]@*Differences@*IntegerDigits

Composition of functions. Takes a number as input and returns True or False as output.

><>, 62 bytes
i:0(   ?v
v!1&!~{!<:=$:@&-1=+2=*>l!-3!1(!:?
>l!;2!n=!0?!<-1=n;

Try it online!
Outputs 1 for a Giza number; 0 otherwise. Works by pushing the input into a dequeue (ok, technically a reversible stack) and repeatedly testing both ends for equality, as well as making sure they are exactly one larger than the previous value.

CJam, 20 19 bytes
l_$_W=),\ci>_W<W%+=

Test suite.
Explanation
The basic idea is to find the minimum and maximum digit, then create a Giza number from those and then check that it's equivalent to the input.
l       e# Read input.
_$      e# Get a sorted copy of the input.
_W=     e# Get its last character, i.e. the maximum digit M.
),      e# Get a string with all characters from the null byte up to M.
\c      e# Get the first character of the sorted string, i.e. the minimum
        e# character m.
i>      e# Convert to its character code and discard that many leading
        e# characters from the string we generated before. Now we've got
        e# a string with all digits from m to M, inclusive.
_W<W%+  e# Palindromise it, by appending a reversed copy without M.
=       e# Check that it's equal to the input.

Instead of the minimum character, we can also use the first character, for the same byte count:
l_:e>),1$ci>_W<W%+=

PHP, 71 bytes
for($t=$i=max(str_split($s=$argv[1]));$t!=$s&&--$i;)$t="$i$t$i";echo$i;

fetches the largest digit from input and counts down, adding the new digit to a comparison string until input and comparison string are equal - or $i is 0.
prints the lowest digit for a Timmy Number, 0 else.

Pushy, 30 15 bytes
I woke up this morning and realise I could half the length of my answer...
s&K-kL2/OvhXwx#

(non-competing as the language postdates challenge)
Input is given on the command line: $ pushy gizas.pshy 3456543. Outputs 1 for truthy and 0 for falsy. Here's the breakdown:
s                  % Split the number into its individual digits
 &K-               % Subtract all digits by the last
    kL2/  h        % Get the halved length of the stack (+1)
        Ov X       % In stack 2, generate range (0, halved length)
            w      % Mirror the range
             x#    % Check stack equality and output

The algorithm was inspired by the bash answer: first, normalize the number, (45654 -> 01210), then generate the normalized giza number of the same length (there is only one), and compare.

Old Solution
s&K-Y?kL2%?L2/:.;&OvhXx#i;;;0#

Java 8, 162 + 19 bytes
19 for import java.util.*;
s->{List f=new ArrayList();for(int i=0;i<9;){String l=String.valueOf(++i);for(int j=i;j>0;){f.add(l);String k=String.valueOf(--j);l=k+l+k;}}return f.contains(s);}

Different approach to the other Java answer, I wanted to try and use the method of creating all the possible Timmy numbers and checking to see if our string was contained in them.

Perl 6, 43 34 bytes
Thanks to Jo King for -9 bytes.
{!/0/==set comb $_- S:g/..?/1/²:}

Port of Gabriel Benamy's Perl solution.
Try it online!

Haskell, 61 bytes
g[a,b]=0>1
g(a:b:c)=a==last c&&b==succ a&&g(b:init c)
g _=1>0

VBA, 175 bytes
Function e(s) As Boolean
Dim f As Long
For i=1 To Int(Len(s)/2)+1
x=Mid(s,i,1)
If f<>0 And ((f+1)<>x) Or (x<>Mid(s,Len(s)-i+1,1)) Then Exit Function
f=x
Next
e=1
End Function

You do not need to declare the types of your variables, meaning that you can drop the as boolean, and  dim f as long, and further reduce this solution down to Sub e(s):For i=1To Int(Len(s)/2)+1:x=Mid(s,i,1):If f<>0 And ((f+1)<>x)Or(x<>Mid(s,Len(s)-i+1,1)) Then d=1:Exit For:f=x:Next:Debug.?0 ^ d:End Sub

Cjam, 35 bytes
Probably very suboptimal... I'm a little out of practice!
q__W%=\_,_2%@@2/)<2ew{:-}%e`,1=]:e&

Try it online!

Python 2, 50 82 81 80 bytes
def f(a):b=len(a)/2+1;print(1,0)[a[:b-1]!=a[b:][::-1]or a[:b]not in'123456789']

Simple approach. Just splits the string in half (missing out the middle character or one after the middle character if it is of even length), reverses the second half then compares the two and compares the first half with a string of 1 to 9.
Edit
Reposted after constructive feedback from fellow golfers and realising and correcting my mistakes.
-1 for losing a (waste of) space
-1 for reading the question again and realising that we don't need to take 0 into account. Really must stop golfing after a long day at work.

This doesn't check if numbers are strictly increasing by one. For example, 13531, and 6543456 both incorrectly return True.

Also, the strings '0' and '1' are both truthy.

Absolutely right. It's been a long day. Will delete as invalid.

Thanks for the comments and not just downvoting.

R, 100 bytes
l=length(x<-el(strsplit(scan(,""),"")));all(x==rev(x))&all(diff(as.numeric(x[1:((l+1)/2)]))==1)&l%%2

Unfortunately, the last Giza number (12345678987654321) is too large to be represented using R's 32-bit integers. Consequently we need to treat input as a string which makes this program slightly longer and we can't effectively rely on calculations.

Read input as string and split into character vector: x<-el(strsplit(scan(,""),""))
Calculate length: l=length(x)
Check if x is equal to itself revered: all(x==rev(x))
and if the difference between the numbers 1...middle are all equal to one: &all(diff(as.numeric(x[1:((l+1)/2)]))==1)
and if number of characters is odd: &l%%2


text:
Finding The nth Prime such that the prime - 1 is divisible by n
Problem
The goal is as the title says to find the \$n\$th prime such that \$\text{the prime}-1\$ is divisible by \$n\$.
Explanation
Here is an example so you understand the question, this is not necessarily the way it ought to be solved. It merely as a way to explain the question
given \$3\$ as an input we would first look at all the primes
 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 ...

Then we select the primes such that \$\text{the prime}-1\$ is divisible by \$n\$ (3 in this case)
 7 13 19 31 37 43 61 67 73 79 97 103 107 109 127 ...

We then select the \$n\$th term in this sequence
We would output \$19\$ for an input of \$3\$
Note
We can also think of this as the \$n\$th prime in the sequence \$\{1, n + 1, 2n + 1, 3n + 1 ...kn + 1\}\$ where \$k\$ is any natural number
Test Cases
  1 --> 2
  2 --> 5
  3 --> 19
  4 --> 29
100 --> 39301
123 --> 102337

You say Nth prime [...] divisible by n. Are N and n the same number?

Sorry, Yeah, they are the same, I should have fixed it now

A077317

You might want to add 1 -> 2 to the test cases. One of my answers got it wrong at some point.

Another way to phrase this is "find the nth prime in the arithmetic sequence 1,n+1,2n+1,...,kn+1,... (which sequence is guaranteed to have infinitely many primes by Dirichlet's Thm.).

@hardmath thanks, the question should be a edited now

Since no one else has said it -- Welcome to PPCG! Great first challenge!

05AB1E, 9 8 bytes
05AB1E uses CP-1252 encoding.
Saved a byte thanks to Osable
µN¹*>Dp½

Try it online!
Explanation
µ          # for N in [1 ...] loop until counter == input
 N¹*>      # N*input+1 (generate multiples of input and increment)
     D     # duplicate
      p½   # if prime, increase counter
           # implicitly output last prime

Instead of bruteforcing I would suggest generating multiples of N first and then checking if they are primes. I came up with µN¹*>Dp½ which saves one byte and accelerates the computation.

@Osable: Ah of course! That is indeed a much better approach. Thanks :)

Python 2, 58 bytes
n=N=input();m=k=1
while N:m*=k*k;k+=1;N-=m%k>~-k%n
print k

Haskell, 59 47 bytes
f n=[p|p<-[1,n+1..],all((<2).gcd p)[2..p-1]]!!n

Usage example: f 4 -> 29.
How it works:
[p|p<-[1,n+1..]                     ]    -- make a list of all multiples of n+1
                                         -- (including 1, as indexing is 0-based)
           ,all((<2).gcd p)[2..p-1]      -- and keep the primes
                              !!n       -- take the nth element

Edit: Thanks @Damien for 12 bytes by removing the divisibility test and only looking at multiples in the first place.

f n=[p|p<-[1,n+1..],all((<2).gcd p)[2..p-1]]!!n

@Damien: wow, a byte save of 20%. Thanks a lot!

Mathematica, 48 bytes
Select[Array[Prime,(n=#)^3],Mod[#-1,n]==0&][[n]]&

Unnamed function taking a single argument, which it names n. Generates a list of the first n^3 primes, selects the ones that are congruent to 1 modulo n, then takes the nth element of the result. It runs in several seconds on the input 123.
It's not currently known if there's always even a single prime, among the first n^3 primes, that is congruent to 1 modulo n, much less n of them. However, the algorithm can be proved correct (at least for large n) under the assumption of the generalized Riemann hypothesis!

Jelly, 9 bytes
‘ÆP>%ð#Ṫ‘

Try it online!
How it works
‘ÆP>%ð#Ṫ‘  Main link. Argument: n

     ð#    Call the dyadic chain to the left with right argument n and left
           argument k = n, n+1, n+2, ... until n of them return 1.
‘          Increment; yield k+1.
 ÆP        Test k+1 for primality, yielding 1 or 0.
    %      Compute k%n.
   >       Compare the results to both sides, yielding 1 if and only if k+1 is
           prime and k is divisible by n.
       Ṫ   Tail; extract the last k.
        ‘  Increment; yield k+1.

Nasm 679 bytes (Instruction Intel 386 cpu 120 bytes)
isPrime1:
push ebp
mov ebp,dword[esp+ 8]
mov ecx,2
mov eax,ebp
cmp ebp,1
ja .1
.n: xor eax,eax
jmp short .z
.1: xor edx,edx
cmp ecx,eax
jae .3
div ecx
or edx,edx
jz .n
mov ecx,3
mov eax,ebp
.2: xor edx,edx
cmp ecx,eax
jae .3
mov eax,ebp
div ecx
or edx,edx
jz .n
inc ecx
inc ecx
jmp short .2
.3: xor eax,eax
inc eax
.z: pop   ebp
ret 4
Np:
push esi
push edi
mov esi,dword[esp+ 12]
xor edi,edi
or esi,esi
ja .0
.e: xor eax,eax
jmp short .z
.0: inc esi
jz .e
push esi
call isPrime1
add edi,eax
dec esi
cmp edi,dword[esp+ 12]
jae .1
add esi,dword[esp+ 12]
jc .e
jmp short .0
.1: mov eax,esi
inc eax
.z: pop edi
pop esi
ret 4

this is ungolfed one and the results
;0k,4ra,8Pp
isPrime1:
          push    ebp
          mov     ebp,  dword[esp+  8]
          mov     ecx,  2
          mov     eax,  ebp
          cmp     ebp,  1
          ja      .1
.n:       xor     eax,  eax
          jmp     short  .z
.1:       xor     edx,  edx
          cmp     ecx,  eax
          jae     .3
          div     ecx
          or      edx,  edx
          jz      .n
          mov     ecx,  3
          mov     eax,  ebp
.2:       xor     edx,  edx
          cmp     ecx,  eax
          jae     .3
          mov     eax,  ebp
          div     ecx
          or      edx,  edx
          jz      .n
          inc     ecx
          inc     ecx
          jmp     short  .2
.3:       xor     eax,  eax
          inc     eax
.z:
          pop     ebp
          ret     4

; {1, n+1, 2n+1, 3n+1 }
; argomento w, return il w-esimo primo nella successione di sopra
;0j,4i,8ra,12P
Np:
          push    esi
          push    edi
          mov     esi,  dword[esp+  12]
          xor     edi,  edi
          or      esi,  esi
          ja      .0
.e:       xor     eax,  eax
          jmp     short  .z
.0:       inc     esi
          jz      .e
          push    esi
          call    isPrime1
          add     edi,  eax
          dec     esi
          cmp     edi,  dword[esp+  12]
          jae     .1
          add     esi,  dword[esp+  12]
          jc      .e
          jmp     short  .0
.1:       mov     eax,  esi
          inc     eax
.z:
          pop     edi
          pop     esi
          ret     4

00000975  55                push ebp
00000976  8B6C2408          mov ebp,[esp+0x8]
0000097A  B902000000        mov ecx,0x2
0000097F  89E8              mov eax,ebp
00000981  81FD01000000      cmp ebp,0x1
00000987  7704              ja 0x98d
00000989  31C0              xor eax,eax
0000098B  EB28              jmp short 0x9b5
0000098D  31D2              xor edx,edx
0000098F  39C1              cmp ecx,eax
00000991  731F              jnc 0x9b2
00000993  F7F1              div ecx
00000995  09D2              or edx,edx
00000997  74F0              jz 0x989
00000999  B903000000        mov ecx,0x3
0000099E  89E8              mov eax,ebp
000009A0  31D2              xor edx,edx
000009A2  39C1              cmp ecx,eax
000009A4  730C              jnc 0x9b2
000009A6  89E8              mov eax,ebp
000009A8  F7F1              div ecx
000009AA  09D2              or edx,edx
000009AC  74DB              jz 0x989
000009AE  41                inc ecx
000009AF  41                inc ecx
000009B0  EBEE              jmp short 0x9a0
000009B2  31C0              xor eax,eax
000009B4  40                inc eax
000009B5  5D                pop ebp
000009B6  C20400            ret 0x4
68

000009B9  56                push esi
000009BA  57                push edi
000009BB  8B74240C          mov esi,[esp+0xc]
000009BF  31FF              xor edi,edi
000009C1  09F6              or esi,esi
000009C3  7704              ja 0x9c9
000009C5  31C0              xor eax,eax
000009C7  EB1D              jmp short 0x9e6
000009C9  46                inc esi
000009CA  74F9              jz 0x9c5
000009CC  56                push esi
000009CD  E8A3FFFFFF        call 0x975
000009D2  01C7              add edi,eax
000009D4  4E                dec esi
000009D5  3B7C240C          cmp edi,[esp+0xc]
000009D9  7308              jnc 0x9e3
000009DB  0374240C          add esi,[esp+0xc]
000009DF  72E4              jc 0x9c5
000009E1  EBE6              jmp short 0x9c9
000009E3  89F0              mov eax,esi
000009E5  40                inc eax
000009E6  5F                pop edi
000009E7  5E                pop esi
000009E8  C20400            ret 0x4
000009EB  90                nop
120

[0, 0] [1, 2] [2, 5] [3, 19] [4, 29] [5, 71] [6, 43] [7, 211] [8, 193] [9, 271] [1
0, 191] [11, 661] [12, 277] [13, 937] [14, 463] [15, 691] [16, 769] [17, 1531] [18
, 613] [19, 2357] [20, 1021] [21, 1723] [22, 1409] [23, 3313] [24, 1609] [25, 3701
] [26, 2029] [27, 3187] [28, 2437] [29, 6961] [30, 1741] [31, 7193] [32, 3617] [33
, 4951] [34, 3877] [35, 7001] [36, 3169] [37, 10657] [38, 6271] [39, 7879] [40, 55
21] [41, 13613] [42, 3823] [43, 15137] [44, 7349] [45, 9091] [46, 7499] [47, 18049
] [48, 6529] [49, 18229] [50, 7151] [51, 13159] [52, 10141] [53, 26501] [54, 7669]
 [55, 19801] [56, 11593] [57, 18127] [58, 13109] [59, 32569] [60, 8221] [61, 34649
] [62, 17981] [63, 21799] [64, 16001] [65, 28081] [66, 10429] [67, 39799] [68, 193
81] [69, 29947] [70, 14771] [71, 47713] [72, 16417] [73, 51539] [74, 25013] [75, 2
9101] [76, 26449] [77, 50051] [78, 16927] [79, 54037] [80, 23761] [81, 41149] [82,
 31489] [83, 68891] [84, 19237] [85, 51341] [86, 33713] [87, 45589] [88, 34057] [8
9, 84551] [90, 19531] [91, 64793] [92, 42689] [93, 54499] [94, 41737] [95, 76001]
[96, 27457] [97, 97583] [98, 40867] [99, 66529] [100, 39301] [101, 110899] [102, 2
9989] [103, 116803] [104, 49297] [105, 51871] [106, 56711] [107, 126047] [108, 385
57] [109, 133853] [110, 42901] [111, 76369] [112, 53089] [113, 142607] [114, 40129
] [115, 109481] [116, 63337] [117, 83071] [118, 67733] [119, 112337] [120, 41281]
[121, 152219] [122, 70639] [123, 102337]

Java 7, 106 bytes
int c(int n){for(int z=1,i=2,j,x;;i++){x=i;for(j=2;j<x;x=x%j++<1?0:x);if(x>1&(i-1)%n<1&&z++==n)return i;}}

Ungolfed:
int c(int n){
  for(int z = 1, i = 2, j, x; ; i++){
    x = i;
    for(j = 2; j < x; x = x % j++ < 1
                           ? 0
                           : x);
    if(x > 1 & (i-1) % n < 1 && z++ == n){
      return i;
    }
  }
}

Test code:
Try it here (last test case results in a Time limit exceeded on ideone)
class M{
  static int c(int n){for(int z=1,i=2,j,x;;i++){x=i;for(j=2;j<x;x=x%j++<1?0:x);if(x>1&(i-1)%n<1&&z++==n)return i;}}

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

Output:
2
5
19
29
39301
102337

Nice to see the ungolfed code for comparison, but the tests would need to be on the golfed code to be meaningful...

@trichoplax Well, I always post the full test program at the Ungolfed & test code part of my answers. The System.out.println are mostly added so you see what input I've used to give the shown output, and everything is also given in case anyone wants to copy-paste it in their IDE to play around with.

My comment wasn't intended terribly seriously - it just might make some people think you had only tested the code before golfing. You could always have three sections: Golfed, Ungolfed, and Golfed with test code, if you wanted to head off that assumption...

@trichoplax Ah ok, In that case it's indeed a justified and good comment. :) I'll edit this one, and keep it in mind for future challenges.

Actually, 13 bytes
Golfing suggestions welcome! Try it online!
;╗`PD╜@%Y`╓NP

Ungolfing
         Implicit input n.
;╗       Save a copy of n to register 0.
`...`╓   Push first n values where f(x) is truthy, starting with f(0).
  PD       Get the x-th prime - 1.
  ╜@%      Push (x_p - 1) % n.
  Y        If x_p-1 is divisible by n, return 1. Else, return 0.
NP       Get the n-th prime where n_p-1 is divisible by n.
         Implicit return.

Common Lisp, 162 bytes
(defun s(n)(do((b 2(loop for a from(1+ b)when(loop for f from 2 to(1- a)never(=(mod a f)0))return a))(a 0)(d))((= a n)d)(when(=(mod(1- b)n)0)(incf a)(setf d b))))

Usage:
* (s 100)

39301

Ungolfed:
(defun prime-search (n)
  (do ((prime 2 (loop for next from (1+ prime) when
                 (loop for factor from 2 to (1- next) never
                      (= (mod next factor) 0)) return next))
       (count 0) (works))
      ((= count n) works)
    (when (= (mod (1- prime) n) 0)
      (incf count)
      (setf works prime))))

Some of those loop constructs can probably be shortened into do loops, but this is what I've got for now.

MATL, 12 bytes
1i:"`_YqtqG\

Try it online!
(For input 123 it times out in the online compiler, but it works offline.)
Explanation
1          % Push 1
i:         % Input n and push [1 2 ... n]
"          % For each (that is, do the following n times)
  `        %   Do...while
    _Yq    %     Next prime
    tq     %     Duplicate, subtract 1
    G      %     Push n again
    \      %     Modulo
           %   End (implicit). Exit loop if top of stack is 0; else next iteration
           % End (implicit)
           % Display (implicit)

Perl, 77 76 + 1 = 77 bytes
for($p=2;@a<$_;$p++){push@a,$p if(1 x$p)!~/^(11+?)\1+$/&&($p%$_<2)}say$a[-1]

Uses the prime-testing regex to determine if $p is prime, and makes sure that it's congruent to 1 mod the input (the only nonnegative integers below 2 are 0 and 1, but it can't be 0 if it's prime, so it has to be 1.  saves 1 byte over ==1).

This appears to print 3 for input 1 (should be 2).

You can save 10 byte by doing (1 x++$.)!~/^(11+?)\1+$/&&($.%$_<2)&&push@a,$.while@a<$_;say$a[-1] (it's what I was talking about in my previous comment). However the output (of either version) seems wrong for at least 2 and 3...

Perl 6,  46 39  37 bytes
->\n{(2..*).grep({.is-prime&&($_-1)%%n})[n-1]}

->\n{(1,n+1...*).grep(*.is-prime)[n-1]}

{(1,$_+1...*).grep(*.is-prime)[$_-1]}

Mathematica 44 Bytes
   Pick[x=Table[i #+1,{i,# #}],PrimeQ/@x][[#]]&

Very fast. Uses the idea from the "Note"
% /@ {1, 2, 3, 4, 100, 123} // Timing

Output
{0.0156001, {2, 5, 19, 29, 39301, 102337}}

JavaScript (ES6), 65 bytes
f=(n,i=n,j=1)=>i?f(n,i-!/^(..+?)\1+$/.test('.'.repeat(j+=n)),j):j

Uses the regexp primality tester, since it's a) 8 bytes shorter and b) less recursive than my pure recursive approach.

Axiom  64 bytes
f(n)==(n<0 or n>150=>0;[i*n+1 for i in 0..2000|prime?(i*n+1)].n)

does someone know how to write above using Axiom streams?... some example
-> f(i)  for i in 1..150
   Compiling function f with type PositiveInteger -> NonNegativeInteger

   [2, 5, 19, 29, 71, 43, 211, 193, 271, 191, 661, 277, 937, 463, 691, 769,
    1531, 613, 2357, 1021, 1723, 1409, 3313, 1609, 3701, 2029, 3187, 2437,
    6961, 1741, 7193, 3617, 4951, 3877, 7001, 3169, 10657, 6271, 7879, 5521,
    13613, 3823, 15137, 7349, 9091, 7499, 18049, 6529, 18229, 7151, 13159,
    10141, 26501, 7669, 19801, 11593, 18127, 13109, 32569, 8221, 34649, 17981,
    21799, 16001, 28081, 10429, 39799, 19381, 29947, 14771, 47713, 16417,
    51539, 25013, 29101, 26449, 50051, 16927, 54037, 23761, 41149, 31489,
    68891, 19237, 51341, 33713, 45589, 34057, 84551, 19531, 64793, 42689,
    54499, 41737, 76001, 27457, 97583, 40867, 66529, 39301, 110899, 29989,
    116803, 49297, 51871, 56711, 126047, 38557, 133853, 42901, 76369, 53089,
    142607, 40129, 109481, 63337, 83071, 67733, 112337, 41281, 152219, 70639,
    102337, 75641, 126001, 42589, 176531, 85121, 107071, 62791, 187069, 55837,
    152419, 94873, 104761, 92753, 203857, 62929, 226571, 72661, 144103, 99401,
    193051, 69697, 168781, 112859, 133183, 111149, 250619, 60601]

                                               Type: Tuple NonNegativeInteger

Java 8, 84 bytes
Golfed
(n)->{for(int s=n,i=1;;i+=n)for(int j=2;i%j>0&j<i;)if(++j==i&&--s<1)return n>1?i:2;}

Ungolfed
(n) -> {
for (int s = n,      // Counting down to find our nth prime.
    i = 1;           // Counting up for each multiple of n, plus 1.
    ;                // No end condition specified for outer for loop.
    i += n)          // Add n to i every iteration.
for (int j = 2;      // Inner for loop for naive primality check.
     i % j > 0)      // Keep looping while i is not divisible by j
                     // (and implicitly while j is less than i).
     if(++j==i       // Increment j. If j has reached i, we've found a prime
     &&              // Short-circutting logical AND, so that we only decrement s if a prime is found
     --s < 1)        // If we've found our nth prime...
     return n>1?i:2; // Return it. Or 2 if n=1, because otherwise it returns 3.
}

Explanation
Solution inspired by several other answers. Function is a lambda that expects a single int.
The n>1?i:2 is a cheap hack because I couldn't figure out a better way to consider the case of n=1.
Also, this solution times out on Ideone, but has been tested for all test cases. It times out because in order to shave a couple bytes off, I took out the explicit j<i check in the inner loop. It's mostly implied by i%j>0... except in the case of i=1 and j=2 (the very first iteration), in which case the loop runs until j overflows (I'm assuming). Then it works fine for all iterations afterwards.
For a version that doesn't time out that's a couple bytes longer, see here!

Racket 109 bytes
(let p((j 2)(k 0))(cond[(= 0(modulo(- j 1)n))(if(= k(- n 1))j(p(next-prime j)(+ 1 k)))][(p(next-prime j)k)]))

Ungolfed:
(define (f n)
  (let loop ((j 2)
             (k 0))
    (cond
      [(= 0 (modulo (sub1 j) n))
       (if (= k (sub1 n))
           j
           (loop (next-prime j) (add1 k)))]
      [else (loop (next-prime j) k)]  )))

Testing:
(f 1)
(f 2)
(f 3)
(f 4)
(f 100)
(f 123)

Output:
2
5
19
29
39301
102337

Ruby 64 bytes
require'prime';f=->(n){t=n;Prime.find{|x|(x-1)%n==0&&(t-=1)==0}}

Called like this:
f.call(100)
# 39301

Also, this command-line app works:
n=t=ARGV[0].to_i;p Prime.find{|x|(x-1)%n==0&&(t-=1)==0}

called like this
ruby -rprime find_golf_prime.rb 100

but I am not so sure how to count the characters. I think I can ignore the language name, but have to include the -rprime and space before the script name, so that is slightly shorter, at 63 . . .

R, 72 bytes
n=scan();q=j=0;while(q<n){j=j+1;q=q+1*(numbers::isPrime(j)&!(j-1)%%n)};j

Terribly inefficient and slow but it works. It reads input from stdin and then uses the isPrime function from the numbers package to find the primes. The rest is just checking whether prime - 1 is divisible by n.

Husk, 9 8 bytes
!⁰fṗ¡+⁰1

Try it online!
!⁰         # get the input-th element of
  fṗ       # the elements that are primes among
    ¡      # the list formed by repeatedly
     +⁰    # adding the input to the last result
       1   # starting with 1.

source: Stack Exchange

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

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

sort: votes


text:
Helicopter challenge
There is a helicopter flying 500 meters from the ground. It can fly up 100 meters, which takes 1.0 secs. Or if it doesn't fly up it will fall 200 meters, which also takes 1.0 secs - This means if the instruction is anything other than "Fly" the helicopter falls. Build a program that takes input of a list of instructions, telling the helicopter when to fly and when not to. When the helicopter falls it should output the time counter.
INPUT:

Fly Dance Fly Golf Fly Fly

OUTPUT:

8.5 secs

Walkthrough:

1) Fly == Fly so +100 = 600m
2) Dance != Fly so -200 = 400m
3) Fly == Fly so +100 = 500m
4) Golf != Fly so -200m = 300m
5) Fly == Fly so +100 = 400m
6) Fly == Fly so +100 = 500m
7) NO INSTRUCTIONS so -200 = 300m
8) NO INSTRUCTIONS so -200 = 100m
9) NO INSTRUCTIONS so -100 = 0m (This takes 0.5 seconds)

Each instruction should be separated by a space, and if the instuction isn't fly, then automatically fall. When the program runs out of instructions automatically fall. Your program must output in (float)secs, and if it takes  => 60.0 seconds display in mins and seconds eg. 1 mins 32.0 secs
Seconds are float decimal values, minutes are whole interger values. Also note capitalization does not matter your program should work for capitals or no capitals.
This is code-golf so the least NO bytes wins!

Could you clarify this? Perhaps a step by step walk through of the example. Is the word "fall" being used both for dropping 200 meters, and for reaching 0 meters? Perhaps using a different word for reaching 0 meters would make this clearer. Is the output the time when the helicopter reaches 0 meters?

Can we assume that if the helicopter is at 100m, and falls, it still takes 1 second to reach 0m, even though it usually takes 1 second to drop by 200m?

I think this could be a good question is it is asked more clearly maybe with some examples. May I suggest the Sandbox to get some feedback prior to posting next time?

if it dosen't fly up, it will fall 200m does that mean heli can crash and after crashing it should not fly anymore which means rest of the instructions should be ignored? Example : please tell me output if the input is this : fly fall fall fall fall fly fly fly fly

The string "M min S secs" specifically, or are normal output formats like a list of [M,S] and other reasonable formats like "M:S" OK? If specifically, then can less than one minute output "0 min S secs"?

Thankyou all for your feedback, I have edited the question and hope it will be more clear.

Does input capitalization matter? Can a non-fly instruction contain the string "fly"?

Still not clear : Mukul's question is important : what is the expected result of "a b c Fly" ? Considering physics, it should be 2.5 cause the helicopter touch the ground before being instructed to fly. Is correct, some answer are already wrong.

Plus, format constaint does not add fun to the challenge : 61.5 should be acceptable IMHO.

Cumbersome IO formats are a thing to avoid when writing challenges.

Python, 100 92 89 bytes
lambda I:sum(reduce(lambda(a,s),i:(a+(a>0)*(-1,.5)[i=='Fly'],s+(a>0)),I.split(),(2.5,0)))

try it online

This doesn't output minutes though.

05AB1E, 31 bytes
l#ā«'¤†Q3*Í5šηO.γd}нRć;sg+60‰0Û

Follows the challenge to the letter. Input as a space-delimited string, and output as a list [sec] or [min,sec], where sec is a float and the potential min is an integer.
If taking the input as a list of strings is allowed, the # could be removed.
If outputting as [min,sec] even if min is 0 is allowed, the tailing 0Û can be removed.
Try it online or verify a few more test cases.
Explanation:
l                             # Convert the (implicit) input-string to lowercase
                              #  i.e. "Fly Dance Fly Golf FLY fLy"
                              #   → "fly dance fly golf fly fly"
 #                            # Split it on spaces
                              #  → ["fly","dance","fly","golf","fly","fly"]
  ā                           # Push a list in the range [1, length]
                              # (without popping the list itself)
                              #  → [1,2,3,4,5,6]
   «                          # Merge it to the list of words
                              #  → ["fly","dance","fly","golf","fly","fly",1,2,3,4,5,6]
    '¤†                      '# Push dictionary string "fly"
       Q                      # Check for each word (or integer) if it's equal to "fly"
                              # (1 if truthy; 0 if falsey)
                              #  → [1,0,1,0,1,1,0,0,0,0,0,0]
        3*                    # Multiply each by 3
                              #  → [3,0,3,0,3,3,0,0,0,0,0,0]
          Í                   # Decrease each by 2 (so 1 if truthy; -2 if falsey)
                              #  → [1,-2,1,-2,1,1,-2,-2,-2,-2,-2,-2]
           5š                 # Prepend a 5 to this list
                              #  → [5,1,-2,1,-2,1,1,-2,-2,-2,-2,-2,-2]
             η                # Get all prefixes of this list
                              #  → [[5],[5,1],...[[5,1,-2,1,-2,1,1,-2,-2,-2,-2,-2,-2]]
              O               # Sum each prefix
                              #  → [5,6,4,5,3,4,5,3,1,-1,-3,-5,-7]
               .γ }           # Consecutive group the values by:
                 d            #  Where the value is >= 0
                              #   → [[5,6,4,5,3,4,5,3,1],[-1,-3,-5,-7]]
                }н            # After the group-by, only leave the first group
                              #  → [5,6,4,5,3,4,5,3,1]
                  Rć          # Reverse and extract the head,
                              # so we've extracted the last item loose to the stack
                              #  → [3,5,4,3,5,4,6,5] and 1
                    ;         # Halve that last item
                              #  → [3,5,4,3,5,4,6,5] and 0.5
                     sg       # Swap to get the list, and pop and push its length
                              #  → 8
                       +      # Add it to the halved last item
                              #  → 8.5
                        60‰   # Take the divmod-60
                              #  → [0,8.5]
                           0Û # And remove a potential leading 0
                              #  → [8.5]
                              # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why '¤† is "fly".

Perl, 90 bytes
$a=5;
$_++,$a+=shift=~/Fly/?1:-2 while$a;
$==$_/60;
$_%=60;
say+($=?"$= mins ":"")."$_ secs"

Accepts input as command-line parameters.  Run as
perl -E '$a=5;$_++,$a+=shift=~/Fly/?1:-2 while$a>0;$==$_/60;$_%=60;say+($=?"$= mins ":" ")."$_ secs"' Fly Dance Fly Fly Golf

Starts $a at 5, and increases it by 1 every time it finds "Fly", decrements by 2 otherwise.  Keeps going until $a is non-positive, and counts how many iterations it took to get there.  $= is special and forces its value to be an integer, so $==$_/60 only takes the integer portion of the division, ignoring the rest.  Everything else is self-explanatory, I feel.

C 93
Thanks to @ceilingcat for finding a much shorter version
i,h=5;main(c,v)int**v;{for(;h>0;)h+=*v[(++i<c)*i]-'ylF'?-2:1;printf("%f secs\n",i-(h<0)*.5);}

Try it online!

Burlesque, 64 bytes
wdm{"Fly"=={1}{-2}IE}@5+]q++pa{0.>}TWsa-.j[~2./.+J60./foJ60.*j.-

Try it online!
wd         # Split into words
m{         # Map
 "Fly"==   # word is "Fly"?
 {1}{-2}IE # If fly 1 else -2
}
@5+]       # Prepend 5.0
q++pa      # Calculate partial sums
{0.>}TW    # Take until 0 or less
sa-.       # Length of this -1 (to account for pushed 5.0)
j[~2./     # Take the remaining height /2
.+         # Add this time
############ Mins Secs ##############
J60./fo    # Calc number of mins
J60.*      # N mins * 60
j.-        # Calc seconds over

If we don't have to deal with the mins/secs rule:
Burlesque, 49 bytes
wdm{"Fly"=={1}{-2}IE}@5+]q++pa{0.>}TWsa-.j[~2./.+

Try it online!

Incorrect. Consider case Eat Play Love Fly Fly Fly Fly Fly Fly. Correct answer is 2.5.

PHP, 55 54 bytes
for($h=5;$h>0;)$h+='Fly'==$argv[++$i]?:-2;echo$h/2+$i;

Loops through command line arguments; run with -r.
Height is divided by 100 to simplify output and calculation: If height is below zero (i.e. -100m),
adding half of it (-50 divided by 100: -.5) to the time removes half a second from the result.
That combined with the magic of Elvis golfed 5 6 bytes from my initial program.

Mathematica 211 bytes
(s=ToString;t=Length[#[[;;(FirstPosition[#,x_/;x<=0,1]-1/. 0->Length@#)]]]&[x=500+Accumulate[If[#=="Fly",100,-200]&/@(StringSplit@#)]];
If[#>=60,s@Floor[#/60]~~" min ",""]~~s@Mod[#,60]~~ " sec"&[t+x[[t]]/200.])&

This algorithm assumes the flight ends when the altitude reaches 0 for the first time.  Looking at some of the other answers, I think people have the helicopter flying below ground level. I don't allow "touch and go" either.
Ungolfed:
in="Fly Dance Fly Golf Fly Fly";
s=ToString;StringSplit@in
If[#=="Fly",100,-200]&/@%
altList=500+Accumulate@%
l=Length@altList
(* find last positive before first nonpositive *)
FirstPosition[altList,x_/;x<=0,1]-1
t=Length[altList[[;;(%/. 0->l)]]]
t+altList[[t]]/200.
If[%>=60,s@Floor[%/60]~~" min ",""]~~s@Mod[%,60]~~ " sec"

APL (Dyalog Classic), 80 bytes
Caveat: case sensitive.
This will return (minutes, seconds) if the flight takes more than 59 seconds, otherwise – only seconds.
{(1+⍵≥60)⌷⍵(⍵(⌊÷,⊢|⊣)60)},{(⍵⍳0)⌊¯0.5+⍵⍳¯1}{5++\¯2@~(4×≢⍵)↑{⍵≡'Fly'}¨' '(≠⊆⊢),⍵}

Try it online!
Without conversion to minutes it's 54 bytes:
{(⍵⍳0)⌊¯0.5+⍵⍳¯1}{5++\¯2@~(4×≢⍵)↑{⍵≡'Fly'}¨' '(≠⊆⊢),⍵}

Javascript, 137
a=>{for(s=5,i=0,a=a.toLowerCase().split(" ");s>=0;){s+=a[i]&&a[i++]=="fly"?1:-2}return parseInt(i/60)+"min "+(i%60+s/2).toFixed(1)+"sec"}

Try it online!
Test:
"Fly fly fly fly fly fly fly fly hi test flu fly fly Fly fly fly fly fly flu flu FLY fly fly Fly fly fly fly fly fly fly fly dance again now fly fly fly fly fLy fly fly flu flu fly Fly fly flY flY fly fly fly fly go flu flu fly fly fly fly fly fly fly win flu fly "

Result:
1min 17.5sec

Python 2, 85 91 bytes
t=2.5+input().upper().split().count('FLY')*1.5
print('%d mins'%(t/60))*(t>59),`t%60`,'secs'

Takes input on STDIN, surrounded by quotes (single or double). Simply counts the number of Flys there are in the input, performs some path to calculate the number of seconds, then formats it.
Now case-insensitive!
Fixed a bug with the same bytecount thanks to Jonathan Allan!
Saved 2 bytes thanks to Shebang!

Bit of a nitpick, but "Marty McFly went to the future" would print 4.0 secs rather than 2.5 secs. Fixable for one byte with t=(5+input().split().count('Fly')*3)/2.

...but you can golf that cost off with t=2.5+input().split().count('Fly')*1.5.

Since I don't think leading spaces matter, this print statement should work: print('%d mins'%(t/60))*(t>59),``t%60``,'secs' (replace double ticks with single ticks). It only has a leading space if t < 60.

Also this would return a float for the minutes if it's a float above 60, i.e. 80.5 secs -> 1.3416666 minutes.

@Shebang It doesn't return a float for the minutes. The %d implicitly casts to an int -- http://ideone.com/JKOS0H. Thanks for the tip though!

This doesn't work correctly. Consider the test case Eat Play Love Fly Fly Fly Fly Fly Fly. Correct answer is 2.5.

AWK, 150 bytes
Below is a rather straightforward implementation in AWK,
the nice thing about it is that you can run it interactively and
feed it by typing commands by hand (just don't forget to remove RS=" ", if you want one command per line).
Golfed
awk 'BEGIN{RS=" ";h=500;t=0}toupper($0)~/FLY/{h+=100;t+=1;next}{h-=200;t+=1;}END{t+=h/200;F=(t>59?"%d mins ":"%.0d") "%.1f secs";printf F,t/60,t%60;}'

Test
echo "Fly Dance FLy Golf Fly Fly" |\
awk 'BEGIN{RS=" ";h=500;t=0}toupper($0)~/FLY/{h+=100;t+=1;next}{h-=200;t+=1;}END{t+=h/200;F=(t>59?"%d mins ":"%.0d") "%.1f secs";printf F,t/60,t%60;}'

8.5 secs

Incorrect. Consider case Eat Play Love Fly Fly Fly Fly Fly Fly. Correct answer is 2.5 sec.

Scala, 88 bytes
s=>{val n=s.split(" ").count("Fly"==)*1.5+2.5
(if(n<60)""else n/60+"min ")+n%60+" secs"}

Ungolfed:
s=>{
  val n=s.split(" ").count("Fly"==)*1.5+2.5
  (
    if(n<60)
      ""
    else
      (n/60)+"min "
  )
  +(n%60)
  +" secs"
}

Uses the same formula as Copper's python answer.

It's incorrect. Consider the test case Eat Play Love Fly Fly Fly Fly Fly Fly. Correct answer is 2.5.

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/


text:
Create Fluffy Blocks
(randomly inspired by this question)
Let's make a drawing from some pipes | and hyphens -. Choosing a subset, if chosen carefully, you can form a rectangular box or block shape (meaning that the corners are formed by |- or -|). For this challenge, we're concerned only with identifying the corners -- the vertical and horizontal pieces of the block shape can be made of either | or -, and the block may be hollow.
Here's the original drawing, and the subset showing a block shape.
|--|---|     |--|---|
|-|||-|| --> |      |
|------|     |------|

However, note that the following subsets from this same example do not make a block, because the corners are not all -| or |-
|--|
|-||

||-||
----|

|-|
---

Each combination of -| or |- can only form one corner. This means that the smallest possible block shape is these eight characters
|--|
|--|

and that these six characters do not form a block shape, since the corners are being "doubled up."
|-|
|-|

The challenge here is to turn these blocks fluffy. How? Replace every hard-edged straight character that forms the block edges (both corners and sides) with a much rounder, fluffier character, in this case, an o. But, don't fill in the block - we only want to get rid of the hard edges and sharp corners.
|--|---|     oooooooo
|-|||-|| --> o-|||-|o
|------|     oooooooo

Input
A 2D string representation of the pipe/hyphen diagram. Input can be as a multiline string, an array of strings, etc., however is convenient for your language. The input is guaranteed to be rectangular (i.e., every row will be the same length), and will only contain | and -.
Output
The same diagram, with the "block" characters replaced with o as described above and the remaining characters unchanged. The result can be printed to the screen or STDOUT, returned from a function, etc.
Rules

Note that blocks can overlap (see example #8) and blocks can share corners (see example #5).
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Examples
#1
-|--|
|--|-
|--||

-|--|
oooo-
oooo|

#2
|--|---|
|-|||-||
|------|

oooooooo
o-|||-|o
oooooooo

#3
|||||

|||||

#4
|-----|
||---|-
||---|-
|-----|

ooooooo
ooooooo
ooooooo
ooooooo

#5
-|--|--|
|||-|--|
-|-----|

-ooooooo
|o|-oooo
-ooooooo

#6
|-||-|
|----|

oooooo
oooooo

#7
--|--|-
|-----|

--|--|-
|-----|

#8
|-----|---
||--||-|--
||||--|--|
|-|-||||-|
|--|--|-||
---||---||
---|-----|

ooooooo---
o|--||o|--
o||ooooooo
o-|o||o|-o
ooooooo-|o
---o|---|o
---ooooooo

Perl, 448 bytes
$_=<>;$o=$_;~y/-|/Aa/;$N=$_;while($n ne $N){$n=$N;$c=$N;$M=$c;while($c=~s/^(.*?;)??([aA]*?)aA([aA]*)Aa(.*;(?i)\2)aA((?i)\3)Aa(.*)$/\L\1\2\UAA\3AA\L\4\UAA\5AA\L\6/){if($N eq $n){substr($N,(length $1)+(length $2),1)="X"}substr($M,-(length $6)-1,1)="X";$c=~s/^([xa;]*;)?(a*)A(A*)A(a*;)\2a((?i)\3)a/\1\2A\3A\4\2A\5A/;1 while $c=~s/(^|;)(a*)A(a*)A(a*;)\2a((?i)\3)a/\1\2A\3A\4\2A\5A/;while($c=~/A/g){substr($o,(pos $c)-1,1)="o"}$c=$M}}$o=~y/;/\n/;print$o

I haven't used perl before so there's going to be massive room for improvement here (especially since I was mostly glad to get it working, so haven't tried to optimise it yet). I was a bit disappointed that the regular expression language didn't have some of the features I wanted, but I think it does pretty well.
Usage
Takes input on stdin, with lines semicolon-separated (optionally add a semicolon to the end to make the final printed output end with a newline). Outputs to stdout. Example command:
printf -- "-|--|--|;|||-|--|;-|-----|;" | perl boxes.perl

Breakdown
$_=<>; # Load input
$o=$_; # Create output variable
~y/-|/Aa/; # Replace - and | with A and a so that we can use case insensitive tricks later
$N=$_;
# For each distinct top-left corner...
while($n ne $N){
    $n=$N;
    $c=$N;
    $M=$c;
    # For each distinct box...
    while($c=~s/^(.*?;)??([aA]*?)aA([aA]*)Aa(.*;(?i)\2)aA((?i)\3)Aa(.*)$/\L\1\2\UAA\3AA\L\4\UAA\5AA\L\6/){
        if($N eq $n){
            # mark top-left corner used (x)
            substr($N,(length $1)+(length $2),1)="X"
        }
        # mark bottom-right corner used (x)
        substr($M,-(length $6)-1,1)="X";

        # Fill in sides of identified box
        $c=~s/^([xa;]*;)?(a*)A(A*)A(a*;)\2a((?i)\3)a/\1\2A\3A\4\2A\5A/;
        1 while $c=~s/(^|;)(a*)A(a*)A(a*;)\2a((?i)\3)a/\1\2A\3A\4\2A\5A/;

        # Replace output chars with "o" where box was found
        while($c=~/A/g){
            substr($o,(pos $c)-1,1)="o"
        }

        # Continue to next box
        $c=$M
    }
}

# Convert to nice output & print
$o=~y/;/\n/;
print$o

If anybody knows how to make perl loop through all possible matching groups (as opposed to just the non-overlapping matches), it would save the need for both while loops and all the "x" logic.


text:
Choose the last card in a poker hand
Poker hands are ranked from best to worst as follows:

Straight flush - five cards of sequential rank, all of the same suit
Four of a kind - four cards of the same rank and one card of another rank
Full house - three cards of one rank and two cards of another rank
Flush - five cards all of the same suit
Straight - five cards of sequential rank
Three of a kind - three cards of the same rank and two cards of two other ranks
Two pair - two cards of the same rank, two cards of another rank and one card of a third rank
One pair - two cards of the same rank and three cards of three other ranks
High card - five cards not all of sequential rank or of the same suit, and none of which are of the same rank

Rank = The number on the card (A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3, 2). You may choose to use T instead of 10.
Suit = hearts (h), spades (s), clubs (c) and diamonds (d).

Note that the Ace, A, can both be the highest and the lowest number (1 or 14).
A card can be identified by two letters As (Ace of spades), Jc (Jack of clubs), 7h (7 of hearts)  and so on.

Challenge:
You get four cards from the dealer (four input strings). Find and output the best possible last card you can get.
If there are cards that are equally good then you can choose which to pick.
Input and output formats are optional, but the individual cards must identified as shown above Jc and 2h.

Test cases:
Ah Kh Jh 10h
Qh

7d 8h 10c Jd
9d (or 9h, 9c, 9s)

Js 6c 10s 8h
Jc (or Jh, Jd)

Ac 4c 5d 3d
2h (or 2d, 2c, 2s)

5s 9s Js As
Ks

2h 3h 4h 5h
6h

Js Jc Ac Ah
As (or Ad)  <- Note that AAAJJ is better than AAJJJ because A is higher than J

10d 9d 5h 9c
9h (or 9s)

Ah Ac Ad As
Ks (or Kd, Kh, Kc)

4d 5h 8c Jd
Jc (or Js, Jh)

This is code golf, so the shortest submission in bytes win.

Pyth, 73 bytes
eo_S+*-5l@\AN}SPMJ+NZSM.:+\AT5+-4l{eMJlM.gPkJ-sM*=T+`M}2Tc4"JQKA""hscd"=Zc

This is pretty terrible. Parsing cards, sorting the values, ... Everything takes so many chars. But the approach is interesting.
Try it online: Demonstration or Test Suite
Explanation:
I generate all 52 cards, remove the four cards of the input, generate a score for each card (score of the hand), and print the card with the maximal score.
The score is a little bit odd. If I compare the score of two completely different hands, it may pick the wrong winner. E.g. a straight would beat 4 aces. But it works, if the first 4 cards are the same in both hands. And my computed score is actually not a value, but a list of values:

G: First I group the 5 cards by rank and take the lengths: 5h 5d 6c 5s Jd -> [3, 1, 1]
F: Then I append 4 minus the number of different suites to this list. Flush -> 3 gets appended, not flush -> 2/1/0 gets appended.
S: Add another number. 0 if it is not a straight, 4 if it is the straight A2345, or 5 if it is a higher straight.

These lists of 4-7 numbers get sorted in decreasing order and the list with maximal value is picked.
Why does this work? Here you see the possible configurations for all types. The letter beside the numbers, tell you with which rule this number got generated.

Straight flush: [5S, 3F, 1G, 1G, 1G, 1G, 1G] or [4S, 3F, 1G, 1G, 1G, 1G, 1G]
Four of a kind: [4G, 1G, 0F, 0S]
Full house: [3G, 2G, 1F, 0S] or [3G, 2G, 0F, 0S]
Flush: [3F, 1G, 1G, 1G, 1G, 1G, 0S]
Straight: [5S, 2F, 1G, 1G, 1G, 1G, 1G], [5S, 1F, 1G, 1G, 1G, 1G, 1G], [5S, 1G, 1G, 1G, 1G, 1G, 0F], [4S, 2F, 1G, 1G, 1G, 1G, 1G], [4S, 1F, 1G, 1G, 1G, 1G, 1G], [4S, 1G, 1G, 1G, 1G, 1G, 0F]
Three of a kind: [3G, 1G, 1G, 1F, 0S], [3G, 1G, 1G, 0F, 0S]
Two pair: [2G, 2G, 2F, 1G, 0S], [2G, 2G, 1F, 1G, 0S], [2G, 2G, 1G, 0F, 0S]
One pair: [2G, 2F, 1G, 1G, 1G, 0S], [2G, 1G, 1G, 1G, 1F, 0S], [2G, 1G, 1G, 1G, 0F, 0S]
High card: [2F, 1G, 1G, 1G, 1G, 1G, 0S], [1F, 1G, 1G, 1G, 1G, 1G, 0S], [1G, 1G, 1G, 1G, 1G, 0S, 0F]

Pyth compares lists element-wise. So it's obvious that a Straight flush will always beat Four of a kind. Most of the typical poker rules are obvious with these lists. Some seem conflicting.

A Straight will win against Four of a kind or a Full house: Not a problem. If you have a chance to get Four of a kind / Full house with the river card, than you can't reach a straight at the same time (since you already have 2 or 3 different suites in your hand).
A Straight will win against a flush. If you can reach a flush and a straight with the river card, then you also can reach a straight flush. And the straight flush has a better score than both the straight and the flush.
One pair [2G, 2F, 1G, 1G, 1G, 0S] will win against some two pair hands. Also no problem. If you get a two pair with the river card, than you had at least one pair before the river. But this means, that you can improve to three of a kind, which is better. So a two pair will actually never be the answer.
High card [2F, 1G, 1G, 1G, 1G, 1G, 0S] will win against some one pair hands. If this is the best score you can reach, before the river you will have 3 cards of one suite and one card of a different suite. But then you can choose the card with one of these two suites and with a value that already appears, and you'll end up with the score [2F, 2G, ...], which is also better.

So this chooses the correct type of solution. But how do I get the best one-pair (out of 4 possibilities), how do I choose the best straight, ...? Because two different one-pair solutions can have the same score.
That's easy. Pyth guaranties stable sorting (when taking the maximum). So I simple generate the cards in the order 2h 2s 2c 2d 3h 3s ... Ad. So the card with the highest value will automatically be the maximum.
Implementation details
=Zc splits the input string and stores the list of cards in Z.
=T+`M}2Tc4"JQKA" generates the list of ranks ['2', ..., '10', 'J', 'Q', 'K', 'A'] and stores them in T. -sM*T..."hscd"Z generates each combination of rank with the suites, and removes the cards of Z.
o... orders these remaining cards by: lM.gPkJ the lenght of the groups of the ranks, +-4l{eMJlM appends 4 - length(suites), +*-5l@\AN}SPMJ+NZSM.:+\AT5 appends 0/4/5 depending on suite (generate each substring of length 5 of "A"+T, check if the hand one of them (requires sorting the hand and sorting all subsets), multiply by 5 - number of "A"s in the card), _S sorts the list decreasing.
e pick the maximum and print.

Very creative, and great explanation!

JavaScript (ES6), 329 324 317 312 309 bytes
H=>[..."cdhs"].map(Y=>[...L="AKQJT98765432"].map(X=>~H.indexOf(X+=Y)||([...H,X].map(([R,S])=>a|=eval(S+'|=1<<L.search(R)',F|=S!=H[0][1]),F=a=c=d=h=s=0),x=c|d,y=h|s,c&=d,h&=s,p=c|x&y|h,t=c&y|h&x,(S=a-7681?((j=a/31)&-j)-j?F?c&h?2e4+a:t?t^p?3e4+t:7e4:p?8e4+p:M:4e4+a:F?5e4+a:a:F?6e4:1e4)<M&&(R=X,M=S))),M=1/0)&&R

How it works
For each remaining card in the deck, we compute a hand score S. The lower the score, the better the hand.
Variables used to compute the score

F: falsy if the hand is a flush
c: bitmask of Clubs
d: bitmask of Diamonds
h: bitmask of Hearts
s: bitmask of Spades
x = c | d: bitmask of Clubs OR Diamonds
y = h | s: bitmask of Hearts OR Spades
a: bitmask of all combined suits
p = c & d | x & y | h & s: pair bitmask (1)
t = c & d & y | h & s & x: three of a kind bitmask (1)

(1) I wrote these formulas some years ago and used them in several poker engines. They do work. :-)
Other formulas

c & d & h & s: four of a kind bitmask
a == 7681: test for the special straight "A, 2, 3, 4, 5" (0b1111000000001)
((j = a / 31) & -j) == j: test for all other straights

Score chart
Value    | Hand
---------+--------------------------------------------
0   + a  | Standard Straight Flush
1e4      | Special Straight Flush "A, 2, 3, 4, 5"
2e4 + a  | Four of a Kind
3e4 + t  | Full House
4e4 + a  | Flush
5e4 + a  | Standard Straight
6e4      | Special Straight "A, 2, 3, 4, 5"
7e4      | Three of a Kind
8e4 + p  | Pair
Max.     | Everything else

NB: We don't have to care about Two-Pair which can't possibly be our best option. (If we already have one pair, we can turn it into a Three of a Kind. And if we already have two pairs, we can turn them into a Full House.)
Test cases

let f =

H=>[..."cdhs"].map(Y=>[...L="AKQJT98765432"].map(X=>~H.indexOf(X+=Y)||([...H,X].map(([R,S])=>a|=eval(S+'|=1<<L.search(R)',F|=S!=H[0][1]),F=a=c=d=h=s=0),x=c|d,y=h|s,c&=d,h&=s,p=c|x&y|h,t=c&y|h&x,(S=a-7681?((j=a/31)&-j)-j?F?c&h?2e4+a:t?t^p?3e4+t:7e4:p?8e4+p:M:4e4+a:F?5e4+a:a:F?6e4:1e4)<M&&(R=X,M=S))),M=1/0)&&R

console.log(f(["Ah", "Kh", "Jh", "Th"]));   // Qh
console.log(f(["7d", "8h", "Tc", "Jd"]));   // 9d (or 9h, 9c, 9s)
console.log(f(["Js", "6c", "Ts", "8h"]));   // Jc (or Jh, Jd)
console.log(f(["Ac", "4c", "5d", "3d"]));   // 2h (or 2d, 2c, 2s)
console.log(f(["5s", "9s", "Js", "As"]));   // Ks
console.log(f(["2h", "3h", "4h", "5h"]));   // 6h
console.log(f(["Js", "Jc", "Ac", "Ah"]));   // As (or Ad)
console.log(f(["Td", "9d", "5h", "9c"]));   // 9h (or 9s)
console.log(f(["Ah", "Ac", "Ad", "As"]));   // Ks (or Kd, Kh, Kc)
console.log(f(["4d", "5h", "8c", "Jd"]));   // Jc (or Js, Jh)

JavaScript (ES6), 307 349
This is quite bulky and I'm not sure it's the best approach. Still a little golfable perhaps.
h=>(r='_23456789TJQKAT',R=x=>r.search(x[0]),M=i=>[...'hcds'].some(s=>h.indexOf(j=h[i][0]+s)<0)&&j,[u,v,w,y]=h.sort((a,b)=>R(a)-R(b)).map(x=>R(x)),[,,d,e,f,g,k]=[...new Set(h+h)].sort(),q=10-u-v-w,s=(z=y>12)&q>0?q:y-u<5&&u*5+q-y,d>r?z?'Kh':'Ah':f>r?M((e>r?v<w:u<v)+1):s?r[s]+g:k?M(3):r[13-z-(w>11)-(v>10)]+g)

Less golfed
h=>(
  // card rank, 1 to 13, 0 unused
  // fake rank 14 is T, to complete a straight JQKA?
  // as I always try to complete a straight going up
  r = '_23456789TJQKAT',

  // R: rank a card
  R = x => r.search(x[0]),

  // M: find a missing card (to complete a same-rank set like a poker)
  // look for a card with the same rank of the card at position i
  // but with a suit not present in the hand
  M = i => [...'hcds'].some(s => h.indexOf(j=h[i][0]+s) < 0) && j,
  h.sort((a, b) => R(a)-R(b) ), // sort hand by rank
  [u,v,w,y] = h.map(x=>R(x)),   // rank of cards 0..3 in u,v,w,y

  // Purpose: look for duplicate rank and/or duplicate suits
  // Put values and suits in d,e,f,g,k, with no duplicates and sorted
  // suits are lowercase and will be at right end
  [,,d,e,f,g,k] = [...new Set(h+h)].sort(),

  // Only if all ranks are different: find the missing value to get a straight
  // or 0 if a straight cannot be obtained
  // The first part manages the A before a 2
  q = 10-u-v-w, s = y>12&q>0 ? q : y - u < 5 && u * 5 + q - y,

  d > r // d is lowercase -> all cards have the same rank
    ? u < 13 ? 'Ah' : 'Kh' // add a K to a poker of A, else add an A
    : e > r // e is lowercase -> 2 distinct ranks
      ? M(v<w ? 2 : 1) // go for a poker or a full house
      : f > r // f is lowercase -> 3 distinct ranks, we have a pair
        ? M(u<v ? 2 : 1) // find the pair and go for 3 of a kind
        : s // all different ranks, could it become a straight?
          ? r[s] + g // if there is only a suit, it will be a flush straight too
          : k // if there are 2 or more different suits
            ? M(3) // go for a pair with the max rank
            : r[13-(y>12)-(w>11)-(v>10)]+g // flush, find the max missing card
)

Test

F=
h=>(r='_23456789TJQKAT',R=x=>r.search(x[0]),M=i=>[...'hcds'].some(s=>h.indexOf(j=h[i][0]+s)<0)&&j,[u,v,w,y]=h.sort((a,b)=>R(a)-R(b)).map(x=>R(x)),[,,d,e,f,g,k]=[...new Set(h+h)].sort(),q=10-u-v-w,s=(z=y>12)&q>0?q:y-u<5&&u*5+q-y,d>r?z?'Kh':'Ah':f>r?M((e>r?v<w:u<v)+1):s?r[s]+g:k?M(3):r[13-z-(w>11)-(v>10)]+g)

output=x=>O.textContent+=x+'\n'

;`Ah Kh Jh Th -> Qh
7d 8h Tc Jd -> 9d 9h 9c 9s
Js 6c Ts 8h -> Jc Jh Jd
Ac 4c 5d 3d -> 2h 2d 2c 2s
5s 9s Js As -> Ks
2h 3h 4h 5h -> 6h
Js Jc Ac Ah -> As Ad
Td 9d 5h 9c -> 9h 9s
Ah Ac Ad As -> Ks Kd Kh Kc
4d 5h 8c Jd -> Jc Js Jh`
.split('\n')
.forEach(s=>{
  var o = s.match(/\w+/g) // input and output
  var h = o.splice(0,4) // input in h, output in o
  var hs = h+''
  var r = F(h)
  var ok = o.some(x => x==r)

  output((ok?'OK ':'KO ')+ hs + ' -> ' + r)
})

Funny to see that our both approaches seem to converge towards very similar sizes. :-) Performance wise, you're definitely faster, though.

@Arnauld I managed to shave some more 4 bytes. Your turn


text:
Build me a brick road!
I need help making a brick road to go beside my brick wall!
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \

This road is 10 characters long and 70 characters wide, seems familiar right?
We have to stay efficient with this road as well, no input and lowest byte count in some code that produces this pattern in an output wins!
This code-golf puzzle isn't the same as the predecessor mentioned above, as the output requires a different approach rather than just simply outputting what it asks (because the pattern is offscured and not exactly the same). It was purposefully included like this for the puzzle to match the theme of my page and also include a higher difficulty for the user (the original was very simple for some). This was mentioned below in the comments.

I thought this was a dupe at first, but it's trickier because the "repeat 175 times and split into strings of length 40" technique won't work as in the last question.

@ETHproductions It's not that far away. You just split into strings of length 74 and then discard the last 4 columns.

it's not quite repeating

This is a lot nastier than the brick wall. nice question.

Personally I thought this was a bit more challenging than the brick wall and wouldn't have voted a dupe but then I'm still pretty new here and it looks like the rules are getting tighter. Was going to look at a Pyth solution as well but obviously won't bother now.

@MartinEnder True, but for most languages this will be shorter in a loop than in a single expression. And there are shorter ways to solve this.

PHP, 65 bytes for(;$i<10;)echo"\n",substr(str_repeat("\\  \\__",15),2*$i++,70);. Pyhton 2, 51 bytes for i in range(0,20,2):print('\\  \\__'*15)[i:70+i]

Looking at the answers we've had, they're very similar to on the previous problem. The problem isn't quite the same but I don't think adapting solutions from one to the other will be very difficult. As such, I'm of the opinion that it should probably be left closed.

Pyke, 19 bytes
"\  \__"w�*Tf70L<_X

where � is the literal byte 156.
Try it here!

apparently so. I've given up trying to work it out with encodings and stuff

V, 20 bytes
123i\  \__ò70|lé
4x

Try it online!
As usual, here is a hexdump:
0000000: 3132 3369 5c20 205c 5f5f 1bf2 3730 7c6c  123i\  \__..70|l
0000010: e90a 3478                                ..4x

Explanation:
123                     " 123 times:
   i                    " Insert the following:
    \  \__              " '\  \__'
          <esc>         " Return to normal mode
               ò        " Recursively:
                70|     "   Move to the 70th column
                   l    "   Move one char over
                    é   "   Insert a single newline
4x                      "   Delete 4 characters

Retina, 32 31 bytes

123$*_

\  \_
S_`(.{70}).{0,4}

Try it online!

PowerShell v2+, 58 38 bytes
'\  \__'*123-split"(.{70}).{0,4}"-ne''

Basically the same as my Build me a brick wall answer, just with additional logic to take the appropriate portions. Thanks to @MartinEnder for saving 20 bytes.
PS C:\Tools\Scripts\golfing> .\build-me-a-brick-road.ps1
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \

Python 2, 79 78 bytes
for x in range(10):a='\\  \\__';b=a*11+a[:4];print b[x*2:70]+b[4:x*3+4-x]

Got there in the end. Just builds a big string, cuts off the beginning and kind of adds the beginning to the end (if that makes sense).
-1 for an unneeded 0
Output:
python follow-the-yellow-brick-road.py
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \
 \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__
__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\
\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \__\  \


text:
Alphabetically permute a string
Task
Your goal, should you choose to accept it, is to write a program, that, given an input string (or array of characters), outputs every possible permutation of the letters in that string. I'm finicky with my output, so it should be sorted alphabetically, with no duplicates.
Example:
Input: buzz
Output:
buzz
bzuz
bzzu
ubzz
uzbz
uzzb
zbuz
zbzu
zubz
zuzb
zzbu
zzub

Rules

This is code-golf so the shortest code wins.
Trailing spaces on each/any line are ok
A single newline after the last line is allowed (but no more)

Can output format be ["buzz" "bzuz" "bzzu" "ubzz" "uzbz" "uzzb" "zbuz" "zbzu" "zubz" "zuzb" "zzbu" "zzub"]?

Sorry, as I mentioned, I'm finicky ;) output must be on separate lines, rather than in a list format

Yes, that makes sense. I just wanted to see if I could remove one byte from my CJam answer (N* to p) :-)

Can the input be an array of characters instead of a string?

Hmmm......I'll allow it

A solid first challenge!

So many builtins!

Jelly, 5 bytes
ṢŒ!QY

Try it online!
Explanation
Ṣ         Sort
 Œ!       All permutations
   Q      Unique
    Y     Join by linefeeds

And... we have 100000 posts! Congrats!

@ETHproductions Heh! Thanks! :-)

Congrats from my side as well :) @ETHproductions how did you get to that result? I am just curious...

@geisterfurz007 Click the "share" link at the bottom of the post. That has ID of the post in the URL.

Oh so it is the 100000th post of ppcg! I thought Luis Mendo was at that number already. My bad. Thanks for the explanation!

It's quite fitting for the 100000th post to solve "print sorted unique permutations of x" with code sort(unique(permutations(x)))

+1 only for being the 100'000th post! :)

Wait, @LuisMendo, did you just made it to PGCC history and you were not using MATL??? :( :( :( :( :P

@AnderBiguri :-D The truth is I had no idea about the post number. Anyway, MATL is 99999

05AB1E,  4  3 bytes
Updated, since an update to œ broke the old version,
which also saved a byte as suggested by Magic Octopus Urn.
œê»

Try it online!
Explanation
œ     # get all permutations of input
 ê    # sort and remove duplicates
  »   # join list by newlines

œê» is fine for non-legacy.

@MagicOctopusUrn: It is actually required for both versions as œ now returns a list of string in both.

MATL, 4 bytes
Y@Xu

Try it online!
Explanation
Y@    % Implicit input. Push 2D array of all permutations, each on a row, sorted
Xu    % Unique rows. Implicitly display

CJam, 5 bytes
Thanks to @EriktheOutgolfer for a correction (q instead of r)
qe!N*

Try it online!
Explanation
q        e# Read input as a string
 e!      e# Unique permutations, sorted
   N*    e# Join by newline. Implicitly display

Python 3.5, 79 bytes
def f(s,w=''):
 s or print(w)
 for c in sorted({*s}):t=s*1;t.remove(c);f(t,w+c)

A function that takes input as a list of characters and outputs by printing.
Recursively makes every distinct permutation by taking each possible next character alphabetically out of the remaining distinct characters, and appending it to the output in progress w. Then, we recurse with this character removed. Once the input is emptied, we print w.

Take in a list of chars, not a string.

Pyth - 5 bytes
jS{.p

Try it online here.
j        Join. Implictly joins on newlines.
 S       Sort
  {      Uniquify
   .p    All permutations, implicitly run on input.

Is S really needed?

@LuisMendo It's needed if the input isn't already sorted.

@isaacg Thanks! I just realized I need that in my Jelly answer as well

@LuisMendo whoops.

Haskell, 46 bytes
import Data.List;unlines.sort.nub.permutations

2 bytes saved thanks to nimi

You don't need a name for the function, so you can drop the f=.

J, 19 bytes
/:~@~.@:{~!@#A.&i.#

Test case
   f =: /:~@~.@:{~!@#A.&i.#
   f 'buzz'
buzz
bzuz
bzzu
ubzz
uzbz
uzzb
zbuz
zbzu
zubz
zuzb
zzbu
zzub

Explanation
This is a 4-train:
                     /- ~ --- /:
               /- @ -^- ~.
  /- ~ --- @: -^- {
  |
  |            /- !
--<     /- @ --^- #
  |     |
  \-----<      /- A.
        >- & --^- i.
        \- #

Basically:
/:~@~.@:{~!@#A.&i.#
          !  A.&     get permutations
           @#   i.#  of range (0..length)
        {~           map indices to chars in string
      @:             then
    ~.               unique
   @                 then
/:~                  sort

I think [:~.i.@!@#A./:~ should save you a few bytes

JavaScript (Firefox 30+), 129 124 bytes
f=(a,i=-1)=>a[1]?[for(x of a.sort())if(a.indexOf(x)==++i)f([...a.slice(0,i),...a.slice(i+1)]).replace(/^/gm,x)].join`
`:a[0]

Not too bad for a language with no permutation built-ins...

I converted this to operate on strings; despite taking 23 bytes just to sort the characters into order I still got the job done in 120 bytes.

Python 3.5, 81 bytes:
from itertools import*;lambda i:'\n'.join(sorted({*map(''.join,permutations(i))}))

Really...81 bytes when the next longest answer is 48 bytes...sigh. Well, I will try this golf this more as much as I can, but golfing tips are still very much appreciated.
Also, here is the shortest solution I could get in Python 2 at 86 bytes:
from itertools import*;lambda f:'\n'.join(sorted({''.join(i)for i in permutations(f)}))

Apparently in Python 2, [*...] returns a Syntax Error, and since permutations returns itertools.permutations object at 0x..., the next shortest way (that I know) of extracting the unique permutations is using {''.join(i)for i in permutations(f)} where f is the input string.
Finally, note that these are both lambda functions and thus must be called in the format print(<Function Name>(<Input String>)).

Brachylog, 9 bytes
:pfdo~@nw

Try it online!
Explanation
:pf         Find all outputs of p - Permute with the main Input as input
   d        Remove Duplicates
    o       Order
     ~@n    Concatenate into a single string with linebreaks as separator
        w   Write to STDOUT

Perl 6,  49  44 bytes
String as input
*.comb.permutations.sort».join.squish.map: *.put

List of characters as input
*.permutations.sort».join.squish.map: *.put

Expanded
*\              # Whatever lambda
# .comb\        # split into a list of characters
.permutations\  # returns a list of lists
.sort\
».join\         # join the second level lists
.squish\        # remove adjacent repeated values
.map: *.put     # print each on its own line

every time I see perl 6 code I wonder why I haven't installed it yet

@GabrielBenamy There is an irc bot that runs Perl 6 code on the freenode.net #perl6 channel.

You can do ».say instead of .map: *.put

@JoKing Technically ».say is allowed to do them in any order, and at one time it was purposely done out of order.

Brachylog (v2), 5 bytes
pᵘoẉᵐ

Try it online!
Find ᵘnique permutations of input, sort them, ᵐap ẉriteln (write with newline) over that array.

Mathematica, 34 23 bytes
Print@@@Permutations@#&

The input must be a list of characters.
Explanation
Permutations@

Find all permutations of the input, sorted and duplicate-free.
Print@@@

Print them one by one.

Python 3, 77 85 bytes
Now sorts!
import itertools as i
for a in sorted(set(i.permutations(input()))):print("".join(a))

To shorten this, you could do from itertools import* as opposed to import itertools as i. You'd be able to save a byte by replacing i.permutations by permutations.

Using {*...} instead of set(...) saves you two more bytes.

PowerShell v3+, 171 bytes
param([char[]]$x)$a,$b=$x;$a=,$a;while($b){$z,$b=$b;$a+=$a|%{0..($y=($c="$_").Length)|%{-join($c[0..$_]+$z+$c[++$_..$y])};"$z$c";"$c$z"}}$a|?{$_.length-eq$x.count}|sort -u

PowerShell v3 introduced the -Unique flag on the Sort-Object cmdlet, so it's a few bytes shorter than the below v2 version, since we don't need to Select first.
v2 version, 178 bytes:
param([char[]]$x)$a,$b=$x;$a=,$a;while($b){$z,$b=$b;$a+=$a|%{0..($y=($c="$_").Length)|%{-join($c[0..$_]+$z+$c[++$_..$y])};"$z$c";"$c$z"}}$a|?{$_.length-eq$x.count}|select -u|sort

PowerShell doesn't have any built-in permutations, so I borrowed my code from Prime Factors Buddies and slightly tweaked it for use here.
This is essentially three portions, which I'll expand on below.
param([char[]]$x)$a,$b=$x;$a=,$a Takes input $x, casts it as a char-array, strips off the first letter into $a and the rest into $b, and then recasts $a as an array with the comma-operator.
while($b){$z,$b=$b;$a+=$a|%{0..($y=($c="$_").Length)|%{-join($c[0..$_]+$z+$c[++$_..$y])};"$z$c";"$c$z"}} Loops through the remaining letters ($b), each iteration  taking the next letter and storing it into $z and leaving the remaining in $b, then array-concatenating onto $a the result of sending $a through its own loop -- each item of $a (temporarily stored into $c) is looped over its own .length, and then $z is inserted into every position, including prepending and appending with $z$c and $c$z. For example, for $c = '12' and $z = '3', this will result in '132','312','123' being concatenated back into $a.
The final portion $a|?{$_.length-eq$x.count}|select -u|sort takes each element of $a and uses Where-Object clause to filter out only those that have the same length as the input string, then selects only the -unique items, and finally sorts those alphabetically. The resulting strings are all left on the pipeline, and output via implicit Write-Output happens at program completion.
PS C:\Tools\Scripts\golfing> .\alphabetically-permute-a-string.ps1 'PPCG'
CGPP
CPGP
CPPG
GCPP
GPCP
GPPC
PCGP
PCPG
PGCP
PGPC
PPCG
PPGC

If you are willing to go 3.0 You can change |select -u|sort to |sort -u. Pretty sure 2.0 does not have that.

@Matt Thanks - you're correct. That was introduced in v3.

JavaScript (ES6), 119 bytes
f=(s,t=[...s].sort().join``,p=``)=>t?t.replace(/./g,(c,i)=>t.indexOf(c)==i?f(s,t.slice(0,i)+t.slice(i+1),p+c):``):p+`\n`

Where \n represents the literal newline character. Port of @ETHproduction's answer to use strings instead of arrays. Reversing the output, or moving the trailing newline to the beginning, saves 3 bytes.

R, 113 bytes
x=scan(,"");cat(sort(unique(apply(matrix(x[permute:::allPerms(l<-length(x))],,l),1,paste,collapse=""))),sep="\n")

Reads input from stdin. The permute package is assumed to be installed in order to call the allPerms function.
Will add an explanation as I get home from work.

Java 302 300 bytes
import java.util.*;class M{public static void main(String[]a){for(Object s:p(new TreeSet(),"",a[0]))System.out.println(s);}static Set p(Set l,String p,String s){int n=s.length(),i=0;if(n>1)for(;i<n;p(l,p+s.charAt(i),s.substring(0,i)+s.substring(++i,n)));else if(!l.contains(p+=s))l.add(p);return l;}}

Ungolfed & test code:
Try it here.
import java.util.*;
class M{
  static Set p(Set l, String p, String s){
    int n = s.length(),
        i = 0;
    if(n > 1){
      for(; i < n; p(l, p + s.charAt(i), s.substring(0, i) + s.substring(++i, n)));
    } else if(!l.contains(p+=s)){
      l.add(p);
    }
    return l;
  }

  public static void main(String[] a){
    for(Object s : p(new TreeSet(), "", a[0])){
      System.out.println(s);
    }
  }
}

Input: test
Output:
estt
etst
etts
sett
stet
stte
test
tets
tset
tste
ttes
ttse

The permutations are supposed to be alphabetically sorted

@Ikaros Thanks, should be fixed now.

Racket 82 bytes
(sort(remove-duplicates(map list->string(permutations(string->list s)))) string<?)

Ungolfed:
(define(f s)
 (sort
  (remove-duplicates
   (map
    list->string
    (permutations
     (string->list s))))
  string<?))

Testing:
(f "buzz")

Ouput:
'("buzz" "bzuz" "bzzu" "ubzz" "uzbz" "uzzb" "zbuz" "zbzu" "zubz" "zuzb" "zzbu" "zzub")

Husk, 3 bytes
uOP

Try it online!
No Unicode!

Groovy, 69 Bytes
{(it as List).permutations().unique().sort().each{println it.join()}}

Ruby, 51 bytes
->s{puts s.chars.permutation.map(&:join).uniq.sort}

how to we can run it?

puts s.chars.permutation().map(&:join).uniq 43 Byte

That doesn't work. You need to sort the output, and you can't refer to s without prior definition.

Actually, 8 bytes
Golfing suggestions welcome! Try it online!
;l@╨♂Σ╔i

Ungolfing
     Implicit input s.
;l   Get len(s).
@╨   Get all len(s)-length permutations of s.
♂Σ   Sum them all back into strings.
╔    uniq() the list of strings.
i    Flatten the list of strings.
     Implicit print the stack, separated by newlines.

Pip, 8 bytes
7 bytes of code, +1 for -n flag.
SSUQPMa

Takes a string as a command-line argument. Try it online!
Pip's scanner breaks runs of uppercase letters into two-letter chunks. So this code is SS UQ PM a--i.e. SortString(UniQue(PerMutations(a))), with a being the command-line arg. The -n flag ensures the result list is newline-separated. That's all there is to it.

K (oK), 14 bytes
Solution:
?x@<x@:prm@#x:

Try it online!
Explanation:
Use the built-in permutation function, prm, to generate permutations of length of the input, apply these permutations to the input, sort alphabetically and then take distinct values.
?x@<x@:prm@#x: / the solution
            x: / store input as x
           #   / count length of x
       prm@    / apply (@) function prm
    x@:        / apply indices to x and save result back into x
   <           / indices to sort ascending
 x@            / apply to x
?              / take distint

Perl 5 -MList::Util=uniq -F, 68 bytes
$"=',';@b=sort@F;map{say if"@b"eq join$",sort/./g}uniq glob"{@b}"x@b

Try it online!

C++ (gcc), 132 128 bytes
#include<bits/stdc++.h>
using namespace std;int main(){string s;for(cin>>s;cout<<s<<endl,next_permutation(s.begin(),s.end()););}

Try it online!

Japt v2.0a0 -R, 5 bytes
á â n

Try it

û is the centre pas method; I think you meant n ;)

@Shaggy I just put sort in the searchbar in your interpreter and clicked the first one I found. But á seems to give each permutation in alphabetic order already

Oop, that's a typo; should be ü. I'll fix it tomorrow. The permutations of "buzz" happen to be sorted because the word itself is - try it with "zzub" instead, for example.

@Shaggy, I see, updated answer with n (it's easier to type)

Clam, 9 bytes
p_D`Sq@~Q

Explanation
          - Implicit Q = first input
p         - Print...
 _        - Sorted ascending value (alphabetical order)
  D       - Distinct from...
   `Sq    - Joined (map(q=>q.join(""))
      @~Q - Permutations of Q