text:
Finding all-but-one matches
This challenge is about writing code to solve the following problem.
Given two strings A and B, your code should output the start and end indices of a substring of A with the following properties.

The substring of A should also match some substring of B with up to one substitution of a single character in the string.
There should be no longer substring of A that satisfies the first property.

For example:
A = xxxappleyyyyyyy

B = zapllezzz

The substring apple with indices 4 8 (indexing from 1) would be a valid output.
Score
The score of your answer will be the sum of length of your code in bytes + the time in seconds it takes on my computer when run on strings A and B of length 1 million each.
Testing and input
I will run your code on two strings of length 1 million taken from the strings in http://hgdownload.cse.ucsc.edu/goldenPath/hg38/chromosomes/
The input will be on standard in and will simply be two strings, separated by a new line.
Languages and libraries
You can use any language which has a freely available compiler/interpreter/etc. for Linux and any libraries which are also open source and freely available for Linux.
My machine
The timings will be run on my machine. This is a standard ubuntu install on an AMD FX-8350 Eight-Core Processor. This also means I need to be able to run your code. As a consequence, only use easily available free software and please include full instructions how to compile and run your code.

You need more absolute scoring definition. Running time on your computer doesn't sound like a good scoring method.

@mbomb007 It's the only sensible way to measure code speed and is the one always used in fastest code competitions on PPCG! People normally post their score on their own computer in their answer and wait for the OP to then produce a definitive score. It is 100% unambiguous at least.

@mbomb007 that is a very widely used scoring method for fastest code.

if(hash(str1 == test1 && str2 == test2)) print("100,150") else .. -- thoughts?

@FryAmTheEggman  In the very unlikely event of a tie, the first answer wins.  appley needs two substitutions to match apllez. Maybe you missed that it is apll in B and not appl ?

C++ time: O(n^2), extra space: O(1)
It takes 0.2s to complete the 15K data on my machine.
To compile it, use:
g++ -std=c++11 -O3 code.cpp -o code

To run it, use:
./code < INPUT_FILE_THAT_CONTAINS_TWO_LINES_SPERATED_BY_A_LINE_BREAK

Explaination
The idea is simple, for string s1 and s2, we try to offset s2 by i:
s1: abcabcabc
s2: bcabcab

When offset is 3:
s1: abcabcabc
s2:    bcabcab

Then, for each offset i, we perform a dynamic programing scan on s1[i:] and s2. For each j, let f[j, 0] be the maximum length d such that s1[j - d:j] == s2[j - i - d: j - i]. Similarly, let f[j, 1] be the maximum length d such that strings s1[j - d:j] and s2[j - i - d:j - i] differ by at most 1 character.
So for s1[j] == s2[j - i], we have:
f[j, 0] = f[j - 1, 0] + 1  // concat solution in f[j - 1, 0] and s1[j]
f[j, 1] = f[j - 1, 1] + 1  // concat solution in f[j - 1, 1] and s1[j]

Otherwise:
f[j, 0] = 0  // the only choice is empty string
f[j, 1] = f[j - 1, 0] + 1  // concat solution in f[j - 1, 0] and s1[j] (or s2[j - i])

And:
f[-1, 0] = f[-1, 1] = 0

Since we only need f[j - 1, :] to calculate f[j, :], only O(1) extra space is used.
Finally, the max length will be:
max(f[j, 1] for all valid j and all i)

Code
#include <string>
#include <cassert>
#include <iostream>

using namespace std;

int main() {
    string s1, s2;
    getline(cin, s1);
    getline(cin, s2);
    int n1, n2;
    n1 = s1.size();
    n2 = s2.size();
    int max_len = 0;
    int max_end = -1;
    for(int i = 1 - n2; i < n1; i++) {
        int f0, f1;
        int max_len2 = 0;
        int max_end2 = -1;
        f0 = f1 = 0;
        for(int j = max(i, 0), j_end = min(n1, i + n2); j < j_end; j++) {
            if(s1[j] == s2[j - i]) {
                f0 += 1;
                f1 += 1;
            } else {
                f1 = f0 + 1;
                f0 = 0;
            }
            if(f1 > max_len2) {
                max_len2 = f1;
                max_end2 = j + 1;
            }
        }
        if(max_len2 > max_len) {
            max_len = max_len2;
            max_end = max_end2;
        }
    }
    assert(max_end != -1);
    // cout << max_len << endl;
    cout << max_end - max_len + 1 << " " << max_end << endl;
}

Sorry, I've been looking at the code and I can't find how it takes into account the possibility of strings matching except for one character, as in the example "apple" and "aplle". Could you explain?

@rcrmn That's what the dynamic programing part doing. To understand, it's helpful to try calculating the f[j, 0] and f[j, 1] manually for some simple cases. The previous code has some bugs so I updated the post.

Thank you for this. Do you think there might be an O(n log n) solution too?

R
Seems I was over complicating the problem with the previous solution.  This is about 50% quicker (23 secs on 15k strings) than the previous one and pretty simple.
rm(list=ls(all=TRUE))
a="xxxappleyyyyyyy"
b="zapllezzz"
s=proc.time()
matchLen=1
matchIndex=1
indexA = 1
repeat {
    i = 0
    repeat {
        srch = substring(a,indexA,indexA+matchLen+i)
        if (agrepl(srch,b,max.distance=list(insertions=0,deletions=0,substitutions=1)))
            i = i + 1
        else {
            if (i > 0) {
                matchLen = matchLen + i - 1
                matchIndex = indexA
            }
            break
        }
    }
    indexA=indexA+1
    if (indexA + matchLen > nchar(a)) break
}
c(matchIndex, matchLen + matchIndex)
print (substring(a,matchIndex, matchLen + matchIndex))
print(proc.time()-s)

This will never be a contender due to the language, but I did have a bit of fun doing it.
Not sure of the complexity of it, but over a couple of ~15k strings it takes 43 secs using a single thread.  The largest portion of that was the sorting of the arrays.  I tried some other libraries, but without significant improvement.
a="xxxappleyyyyyyy"
b="zapllezzz"
s=proc.time()
N=nchar
S=substring
U=unlist
V=strsplit
A=N(a)
B=N(b)
a=S(a,1:A)
b=S(b,1:B)
a=sort(a,method="quick")
b=sort(b,method="quick")
print(proc.time()-s)
C=D=1
E=X=Y=I=0
repeat{
    if(N(a[C])>E && N(b[D])>E){
        for(i in E:min(N(a[C]),N(b[D]))){
            if (sum(U(V(S(a[C],1,i),''))==U(V(S(b[D],1,i),'')))>i-2){
                F=i
            } else break
        }
        if (F>E) {
            X=A-N(a[C])+1
            Y=X+F-1
            E=F
        }
        if (a[C]<b[D])
            C=C+1
            else
            D=D+1
    } else
        if(S(a[C],1,1)<S(b[D],1,1))C=C+1 else D=D+1
    if(C>A||D>B)break
}
c(X,Y)
print(proc.time()-s)

Method:

Create a suffix array for each string
Order the suffix arrays
Step through each of the arrays in a staggered sort of way comparing the beginning of each

Of course, the easiest solution in R is to use Bioconductor.

@archaephyrryx A bioconductor solution would be fun.

It would be ... But my quick read of the docs was way over my head.  Maybe if I understood the terms:-)

I deleted my first comment. You can of course use any open source library you like for this challenge.

C++
I tried thinking of a good algorithm to do this, but I'm a bit distracted today and couldn't think of anything that would work well. This runs at O(n^3) time, so it's veeeery slow. The other option I thought of could have been theoretically faster but would have taken O(n^2) space, and with inputs of 1M, it would have been worse even.
It's shameful, it takes 190 seconds for inputs of 15K. I'll try to improve it.
Edit: Added multiprocessing. Now takes 37 seconds for 15K input on 8 threads.
#include <string>
#include <vector>
#include <sstream>
#include <chrono>
#include <thread>
#include <atomic>
#undef cin
#undef cout
#include <iostream>

using namespace std;

typedef pair<int, int> range;

int main(int argc, char ** argv)
{
    string a = "xxxappleyyyyyyy";
    string b = "zapllezzz";

    getline(cin, a);
    getline(cin, b);

    range longestA;
    range longestB;

    using namespace std::chrono;

    high_resolution_clock::time_point t1 = high_resolution_clock::now();

    unsigned cores = thread::hardware_concurrency(); cores = cores > 0 ? cores : 1;

    cout << "Processing on " << cores << " cores." << endl;

    atomic<int> processedCount(0);

    vector<thread> threads;

    range* longestAs = new range[cores];
    range* longestBs = new range[cores];
    for (int t = 0; t < cores; ++t)
    {
        threads.push_back(thread([&processedCount, cores, t, &a, &b, &longestBs, &longestAs]()
        {
            int la = a.length();
            int l = la / cores + (t==cores-1? la % cores : 0);
            int lb = b.length();
            int aS = t*(la/cores);

            for (int i = aS; i < aS + l; ++i)
            {
                int count = processedCount.fetch_add(1);
                if ((count+1) * 100 / la > count * 100 / la)
                {
                    cout << (count+1) * 100 / la << "%" << endl;
                }
                for (int j = 0; j < lb; ++j)
                {
                    range currentB = make_pair(j, j);
                    bool letterChanged = false;
                    for (int k = 0; k + j < lb && k + i < la; ++k)
                    {
                        if (a[i + k] == b[j + k])
                        {
                            currentB = make_pair(j, j + k);
                        }
                        else if (!letterChanged)
                        {
                            letterChanged = true;
                            currentB = make_pair(j, j + k);
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (currentB.second - currentB.first > longestBs[t].second - longestBs[t].first)
                    {
                        longestBs[t] = currentB;
                        longestAs[t] = make_pair(i, i + currentB.second - currentB.first);
                    }
                }
            }
        }));
    }

    longestA = make_pair(0,0);
    for(int t = 0; t < cores; ++t)
    {
        threads[t].join();

        if (longestAs[t].second - longestAs[t].first > longestA.second - longestA.first)
        {
            longestA = longestAs[t];
            longestB = longestBs[t];
        }
    }

    high_resolution_clock::time_point t2 = high_resolution_clock::now();

    duration<double> time_span = duration_cast<duration<double>>(t2 - t1);

    cout << "First substring at range (" << longestA.first << ", " << longestA.second << "):" << endl;
    cout << a.substr(longestA.first, longestA.second - longestA.first + 1) << endl;
    cout << "Second substring at range (" << longestB.first << ", " << longestB.second << "):" << endl;
    cout << b.substr(longestB.first, longestB.second - longestB.first + 1) << endl;
    cout << "It took me " << time_span.count() << " seconds for input lengths " << a.length() << " and " << b.length() <<"." << endl;

    char c;
    cin >> c;
    return 0;
}

I'm really sorry it's such a bad solution. I've been searching for an algorithm to accomplish this in better time, but didn't find anything for now...

Well, the complexity of the task required should be around O(n^4) to O(n^5), so long run times are a given

I believe it should be more like O(n^3) at worst case, at least with my algorithm it is. Anyway, I'm sure something can be done to improve it, like some kind of tree search, but I'm not sure how it would be implemented.

Oh yeah, O(n^3) it is... had a different approach in mind that would've taken O(n^4), but that one is kinda useless by now xD

you could save a small amount of time if you change the check in the two outer for loops from i < a.length() to i < a.length - (longestA.second - longestA.first) (same for j and b.length()) since you won't need to process any matches smaller than your current longest one

Maybe, but for 15K I found a longest match of only 40 characters, so it is a very small improvement. Thank you anyway, I'll take it into account when trying a new version.

Was the faster method dynamic programming? That could take O(n^2) time.

Yes, but a lot more memory than it would be manageable, the naive approach. I'll look for something that could simplify it.


text:
Topping the Charts
Topping the Charts
You are a record label company.  Your goal is to get 4 of your signed bands in the top 4 positions in the charts.  However, its recently been noted that bands currently in the charts influence who is going to be in the charts the next day.
In this challenge, each player will control 5 bands (instances of your code), each of them placed in alternating order in one of the 11 spots of the scoreboard, with the 11th spot open.  Each band will have a unique, hidden ID (from 0-9), and a unique, visible name (a randomly generated integer).
Each turn, the band with the open spot below them in the charts will call an ID.  The bot instance with that ID will move to that spot, creating a new open spot.  If spot #1 is open, then the 11th bot will be the one to name an ID.
The game is over when spots 1-4 are all held by your bands, giving you 3 points.  If a particular band ordering is created more than 3 times, then both labels will tie and be given 1 point.  The player with the most points after facing each other player twice (to ensure both labels start with a band in the #1 position) wins.
I/O
Bots will be stay alive between turns.  Information will be passed back and forth via STDIO.  When multiple pieces of information is passed, it will be comma separated.  Each instance of your bot MUST NOT communicate with each other (nor with the other team).
At the beginning of the game, your will be passed three integers, your ID, position, and name, and then you will be passed a list of names of the current positions, with 0 being the open position.
On your turn, you will be passed a list of names of the current positions, with 0 being the open position.  You must return the ID you wish to place in the spot below you.
If you get switched, you will be be passed two integers, the name of the person that switched you, and your new position (from 0-10).
If you win, you will be passed 0, at which, you must end your program
The controller can be found here: https://github.com/nathanmerrill/ScoreboardKoTH

I should return an ID, but only know mine and the names of the other bands... That doesn't make sense to me, as I can't say Move bot on position 3 to the empty spot, since I don't know his ID.

@Manu You can figure out the IDs by trial.

How? If I swap a band to the empty spot, I don't get notified which one moved.

But every time you see the state of the chairs.  On the turn after you moved somebody, you get to see who was different than last time.

Random Bot
If you couldn't guess, this bot picks a number randomly.  Run with python random_bot.py
import sys
import random

def get_data():
    data = sys.stdin.readline().strip()
    if data == "0":
        exit()
    return [int(x) for x in data.split(",")]

def startup():
    global _id, position, name
    all_data = get_data()
    player_names = all_data[3:]
    _id, position, name = all_data[:3]

def switched(switcher, new_position):
    global position
    position = new_position

def call_id(player_names):
    return random.randrange(10)

_id = -1
position = -1
name = -1
startup()
while True:
    data = get_data()
    if len(data) == 1:
        break
    elif len(data) == 2:
        switched(*data)
    else:
        print str(call_id(player_names=data))
        sys.stdout.flush()

Self Mover Bot
This bot always moves itself. Run with:
javac SelfMover.java
java SelfMover

Code:
import java.util.Scanner;

public class SelfMover {

    private Scanner stdIn;
    private final int id, name;
    private int position;

    public static void main(String[] args) {
        new SelfMover();
    }

    public SelfMover() {
        stdIn = new Scanner(System.in);
        Integer[] data = getData();
        id = data[0];
        position = data[1];
        name = data[2];
        mainLoop();
    }
    private void mainLoop() {
        while(true){
            Integer[] data = getData();
            if (data.length == 1){
                return;
            } else if (data.length == 2){
                switched(data[0], data[1]);
            } else {
                System.out.println(callID(data));
            }
        }
    }
    private Integer[] getData(){
        String data = stdIn.nextLine().trim();
        if (data.equals("0")){
            System.exit(0);
        }
        String[] strData = data.split(",");
        Integer[] intData = new Integer[strData.length];
        for (int i = 0; i < strData.length; i++){
            intData[i] = Integer.parseInt(strData[i]);
        }
        return intData;
    }
    private void switched(int switcher, int newPosition){
        position = newPosition;
    }
    private int callID(Integer[] players){
        return id;
    }

}

Unswitcher bot
This bot mistakenly assumes that its new position is the ID of the bot that switched it, and tries to unswitch.
Run with python unswitcher_bot.py
import sys

last_switched = -1

def get_data():
    data = sys.stdin.readline().strip()
    if data == "0":
        exit()
    return [int(x) for x in data.split(",")]

def startup():
    global _id, position, name
    try:
        all_data = get_data()
    except:
        raise NameError
    player_names = all_data[3:]
    _id, position, name = all_data[:3]

def switched(switcher, new_position):
    global position, last_switched
    position = new_position
    last_switched = switcher

def call_id(player_names):
    return min(position, 9)

_id = -1
position = -1
name = -1
startup()
while True:
    data = get_data()
    if len(data) == 1:
        break
    elif len(data) == 2:
        switched(*data)
    else:
        print call_id(player_names=data)
        sys.stdout.flush()

source: Stack Exchange

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

sort: votes


text:
Solve a Date Shift Cipher
Introduction
In this challenge you will be solving date shift ciphers. Here is a general overview of what a date shift cipher is. To encode a message, you first must make a key. A key in a date shift cipher is any date converted into the form of MMDDYYYY (Adding zeros at the beginning of each part to keep the key 8 long). For example:
Date - January 23, 1785 (01/23/1785)
 Key - 01231785

Date - April 1, 1999 (04/01/1999)
 Key - 04011999

You must then take your message to encode and write it out.
Hello World!

Write the key under it, repeating if it is too short and ignoring spaces, punctionation, etc.:
Hello World!
04011 99904

Then you shift each letter forward in the alphabet by the number of times of the number below it, looping to A if you pass Z:
Hello World!
04011 99904
Hilmp Fxalh!

Your encoded message is Hilmp Fxalh!. To decode, do the opposite. First, line up the day above the above the letters (it does not need to be above, just personal preference):
04011 99904
Hilmp Fxalh!

Now, shift each letter backward in the alphabet by the number of times above it, looping to Z if you pass A:
Hello World!
04011 99904
Hilmp Fxalh!

And now you have decoded the cipher!
Challenge
Your challenge is to write either two programs, functions, one of each, or one that does both jobs. However, both must use the same language. The first program will accept a string and date in the format of MM/DD/YYYY as input via STDIN, program arguments, or function parameters and encode it using this method. The second program will accept a string and date in the format of MM/DD/YYYY as input via STDIN, program arguments, or function parameters and decode it using this method.
Requirements
First Program/Function

Allow input of a string and date in the format MM/DD/YYYY using any method listed above.
Must encode the string using a date shift cipher style.

Second Program/Function

Allow input of a string and date in the format MM/DD/YYYY using any method listed above.
Must decode the string using a diagonal date shift style.

Constraints

You cannot use any built-in or external functions that accomplish this task.
Standard loopholes are not allowed.
Both programs/functions must be in the same language.

Scoring
This is code golf, so shortest program in bytes wins. Bonus -10 bytes for creating a single program/function that accomplishes both tasks.
If I need to add more information, leave a comment!

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


text:
Check whether letters of word are in alphabetical order
Write a function/program that accepts a string of lower/uppercase letters [A-Za-z] as input, that checks whether the occuring letters are unique and in alphabetical order (ignoring lower and uppercase) or not. The output must be truthy if they are unique and in alphabetical order and falsy if not.
Here some testcases
a                           true
abcdefGHIjklmnopqrSTUVWXyz  true
aa                          false
puz                         true
puzz                        false
puzZ                        false
puZ                         true
PuZ                         true
pzu                         false
pzU                         false
abcdABCD                    false
dcba                        false

If you want, run your program on all words of a wordlist like this one and and post some interesting ones =).
Score
Lowest number of bytes wins.

Weak test cases. (See my comment on Richard A's PHP answer.)

Does the alphabet loop? Should za be a truthy value?

No, the alphabet begins with a and ends with z.

You should have some test cases that aren't in alphabetical order

@JoKing I added some.

@manatwork I don't really know PHP, can you suggest some explicit examples?

Your freshly added test cases are Ok, they make it obvious that the PHP solution lacks the order check part of the task.

@manatwork Great, thanks for the rapid answer after you had to wait four years for mine:)

Is it guaranteed that input consist of a single word? Do we need to filter input for alphabetic characters?

Yes, the string only consists of letters in [a-zA-Z].

CJam, 8 bytes
lel_$_&=

Here is a test harness for all examples in the challenge. This returns 0 or 1 (which are falsy and truthy, respectively, in CJam).
And here is a script to filter the word list in the question (takes a few seconds to run). You'll have to copy the word list into the input field manually, because it's too long for a permalink.
Explanation
l        "Read input.";
 el      "Convert to lower case.";
   _$    "Get a copy and sort it.";
     _&  "Remove duplicates (by computing the set intersection with itself).";
       = "Check for equality with original (lower case) word.";

Regex (any flavor), 55 bytes
Some people don't consider regex to be a programming language, but it's been used before, and it's not close to being the shortest.
^a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s?t?u?v?w?x?y?z?$

I've added one byte for the i (case-insensitive) flag. This is very straightforward and might be shorter to generate on the fly.
If regex alone are not allowed, you can use this 56-byte Retina program suggested by Martin Büttner:
i`^a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s?t?u?v?w?x?y?z?$

Running this on the wordlist linked above yielded 10 6-letter words in alphabetical order.

["abhors", "almost", "begins", "begirt", "bijoux", "biopsy", "chimps", "chinos", "chintz", "ghosty"]

You can use Retina instead of ES6 if someone complains that regex is not a language: i`^a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s?t?u?v?w?x?y?z?$

@MartinBüttner I'd forgotten about Retina. Thanks!

@MartinBüttner According to the META (http://meta.codegolf.stackexchange.com/questions/2028/what-are-programming-languages/2073#2073) Regexes can be 'seen' somewhat as a programming language.

@IsmaelMiguel I know. And in fact that definition was specifically chosen to make sure it doesn't rule out regex. But some people still regularly complain, because you can't use regex like any other language.

@MartinBüttner Those who complain can go to a place called META and look for it. Why no one visits such a beautiful place full of questions that solve most issues?

If you want a dynamically generated version, there's a decently short and readable Haskell version with '^':concatMap(:"?")['a'..'z']++"$" (34 bytes) or a somewhat golfed Ruby version with ?^+(?a..?z).to_a.join(??)+?$ (28 bytes).

(Correction to my last comment: Ruby code should end with +"?$". Use /#{?^+(?a..?z).to_a.join(??)+"?$"}/ to put it in a Regexp if needed.)

Looks like 54 bytes to me. (26*2+2)

@Eric I added a byte for the i flag.

@hsl Oh, duh, you even wrote that. I feel smrt.

Python 3, 44 bytes
*s,=input().lower()
print(sorted(set(s))==s)

A simple approach - check uniqueness, check sortedness.

Can you explain what *s,=... does?

@flawr This is called 'starred assignment'. In this code, it simply converts the right side into a list. It's the same as s=list(input().lower()).

@flawr As Jakube says, here it's just converting input into a list of chars. In general it's a special assignment syntax which lets you do things like x,*y = [1, 2, 3, 4], which assigns 1 to x and [2, 3, 4] to y.

@mbomb007 *s,= is list(s)... link

You can do {*s} instead of set(s) to save 2 bytes.

@mbomb007 Python 3.5.0 came after this answer

Ah, right. Nevermind.

><>, 52 42 39 bytes
0>i:1+?v1n;
? )'`':/'@'v
0v?){:-<'`'/;n

This type of question is one of the few types that ><> is pretty comfortable with, since we only need to deal with one char at a time.
Explanation
Don't get lost! There's a lot of wrapping here.
0            Push 0. We'll be mapping a-z to 1-26, so 0 will be smaller than everything

(loop)
i            Read a char of input
:1+? 1n;     If there's no more input, print 1
:'`')?       If the char is bigger than backtick...
  '`'          Push backtick  (which is one before 'a'), else...
  '@'          Push an @ sign (which is one before 'A')
-            Subtract, mapping a-z to 1-26
:{)?         If the new char is bigger than the previous char...
               Repeat from the beginning of the loop, else...
  0n;          Print 0

Previous solution, 42 bytes
0i:1+?v1n;n0/\!
?)'`':/'@'v
? ){:-<'`'/ vv

The interesting thing is that, despite appearing to have the same functionality, the alternative
0i:1+?v1n;n0\/!
?)'`':/'@'v
? ){:-<'`'/ ^^

(The change is in the arrows and mirrors on the far right)
actually gives incorrect results, due to ><>'s interpreter using a Python defaultdict. What happens is that, by traversing through the empty space at the end of the second row, 0s are implicitly placed into the blank spaces when ><> tries to access the cell. This then messes with the ? conditional trampoline at the beginning of the same row, as the newly placed 0s are skipped rather than the v at the end.

I feel like you could save some bytes by only substracting 32 from lowercase letters rather than getting alphabetic index for all letters

Haskell, 52 Bytes
import Data.Char
and.(zipWith(>)=<<tail).map toLower

Usage: (and.(zipWith(>)=<<tail).map toLower) "abcd" which outputs True.

C, 67 65 57 54 (52) characters
f(char*s){int c,d=0;for(;(c=*s++)&&(c&~32)>(d&~32);d=c);return!c;}

a little shorter:
f(char*s){int c,d=0;for(;(c=*s++)&&(c&~32)>d;d=c&~32);return!c;}

and even shorter:
f(char*s){int d=32;for(;(*s|32)>d;d=*s++|32);return!*s;}

Here's a little test: http://ideone.com/ZHd0xl
After the latest suggestions here are still two shorter versions:
// 54 bytes
f(char*s){int d=1;for(;(*s&=95)>d;d=*s++);return!*s;}

// 52, though not sure if valid because of global variable
d;f(char*s){d=1;for(;(*s&=95)>d;d=*s++);return!*s;}

Also this code relies on the fact, that in ASCII lowercase and uppercase only differ by the 5th bit (32) which I filter out. So this might not work with other encodings obviously.
EDIT: The latest version always sets the 5th bit as |32 is shorter than &~32.

Good use of domain knowledge to handle the case sensitivity issue.

Save 2 by replacing the for loop with for(;(*s&=95)>d;d=*s++);.  And you can initialize d to 1 without changing the result, saving 1 more.  See.

I'm not sure if this is considered legal in code golf, but d;f(char*s){d=32;for...} works, declaring d implicitly as a global int (which, in GCC, is a warning—"data definition has no type or storage class"—but not an error). This saves two bytes.

AShelly hm, didn't consider that. Your suggestion changes the original string though. But whatever, it's code golf :D
Also I'm not sure about WChargin's hint as d as a global variable would not really be part of the function.

I think the problem with the global is that it won't work the 2nd time the function is called.

Why not initialize d in the for loop rather than its own statement?  That way you save a ;.

Ruby, 33
->s{c=s.upcase.chars
c==c.sort|c}

Checks to see if the sorted unique characters are the same as all the characters.

Think you can get it a little shorter with c==c.sort|c

Ooh, I like that, that's clever. Thanks.

Javascript (ES5), 101
function i(s){b=0;l=''.a
s.toUpperCase().split('').forEach(function(c){if(c<=l)b=1
l=c})
return!b}

Improved to 87 by edc95:
upvote his comment :)
function i(s){return!s.toUpperCase().split(l='').some(function(c){return(u=l,l=c)<=u})}

Btw, the test cases currently in OP are fulfilled if a program is only checking uniqueness, disregarding order.

I cant write comments yet, so I'll answer some remarks here:
@edc65: Thanks! I tried rewriting it using some(), but I couldn't get a shorter solution, because even though it looks like it would enable me to get rid of the superflous b variable, you need to type "return" twice (same with reduce()), and you can't just return the comparison's result directly, because the last character needs to be saved after the comparison with it.
@edc65: That's a nice use of the comma operator for 87! I edited it into my answer for more visibility.

That's a better idea than mine. Using .some could be even better (52 with ES6)

You can remove the space between return and !b to save a char.

As is, just caring white space,96:function i(s){b=0;l='';s.toUpperCase().split('').forEach(function(c){if(c<=l)b=1;l=c});return!b}

The same, golfed more,92:function i(s){s.toUpperCase(b=0).split(l='').forEach(function(c){if(c<=l)b=1;l=c});return!b}

Using some(or every, same score),87:function i(s){return!s.toUpperCase().split(l='').some(function(c){return(u=l,l=c)<=u})}

Wolfram Mathematica, 49 37 bytes
f[x_]:=(l=Characters[ToLowerCase[x]];Union[l]==l)

P.S. Shorter solution by Martin Büttner:
Union[l=Characters@ToLowerCase@#]==l&

#⋃#==#&@*Characters@*ToLowerCase

@alephalpha That is beautiful!

VBA (161 bytes)
Function t(s As String)
t = 0
For i = 2 To Len(s)
a = Left(LCase(s), i)
    If Asc(Right(a, 1)) <= Asc(Right(a, 2)) Then Exit Function
Next
t = 1
End Function

Compares ascii value with previous letter in lowercase, return 0 (false) when its value is smaller / equal and exit function

Haskell, 90 bytes
Supplies the function f :: String -> Bool
import Data.List
import Distribution.Simple.Utils
f l=g$lowercase l
g l=sort l==l&&l==nub l

Usage (assuming it is saved as golf.hs). ... is used to replace ghci's verbose loading messages.
$ ghci golf.hs
...
*Main> f "as"
...
True
*Main> f "aa"
False

If someone has a lowercase method shorter than import Distribution.Simple.Utils then please comment.

Use map toLower from Data.Char instead of lowercase

Also: you can remove the parameter l at f, i.e. f=g.lowercase (or f=g.map toLower if you switch to toLower). Within g one comparison is enough: g l=nub(sort l)==l.

Pure Bash 4.x, 37
[[ ${1,,} =~ ^`printf %s? {a..z}`$ ]]

Try it online!
Input taken as a command-line parameter.  As per standard shell semantics, exit code 0 means true (alphabetic) and exit code != 0 means false (not alphabetic).
The printf creates the regex as in @hsl's solution.  The input string is expanded to lowercase and compared against the regex.

Previous answer:
Bash + coreutils, 52
Straightforward solution:
a=`fold -1<<<${1,,}`
cmp -s <(sort -u<<<"$a")<<<"$a"

Note that this requires bash 4.x.

@MarkReed Yes. Noted.

I don't understand what the ${1,,} is for, why can't you just use $1?

@pxeger it makes all letters lowercase - search for ,, here

J, 17 bytes
Checks if the lowercase sorted /:~ string equals -: the lowercase nub ~. string.
   (/:~-:~.)@tolower

   NB. testing with the example inputs
   ((/:~-:~.)@tolower) every (1$'a');'abcdefGHIjklmnopqrSTUVWXyz';'aa';'puz';'puzz';'puzZ';'puZ';'PuZ'
1 1 0 1 0 0 1 1

As in J a 1-charater long "string" represented as a regular string (with quotes) is just a character atom not a real string I formatted the input appropriately so all input would be real strings. (In the example above I used 1$'a'.)

MATLAB, 29 27 bytes
Now for a one-liner which even makes sense outside of code-golf.
As an anonymous function (use as o('yourstring'))
o=@(s)all(diff(lower(s))>0)

I guess this function is pretty self-explanatory since it reads like a newspaper ad.
Previous version (29 bytes):

all(diff(lower(input('')))>0)

Input must be presented between ' marks, e.g. 'Potato'.

Golang (65 bytes)
Go is not a golf friendly language, also, i suck at golf...
func a(s[]byte)(bool){return len(s)<2||s[0]|32<s[1]|32&&a(s[1:])}

Run it here: http://play.golang.org/p/xXJX8GjDvr
edit 106->102
edit 102->96
edit 96->91
edit 91->87
edit 87->65
I beat the java version, I can stop for today

C (44 bytes)
f(char*s){return(*s&=95)?f(s+1)>*s?*s:0:96;}
Test it here: http://ideone.com/q1LL3E
Posting this because I can't comment yet, otherwise it would be a suggestion to improve the existing C answer because I completely stole the case-insensitive idea from the existing C answer.
Returns 0 if the string is not ordered, and a non-zero value if ordered.

Brachylog, 3 bytes
ḷ⊆Ạ

Try it online!
The predicate succeeds if the input meets the requirements outlined and fails if it does not, printing true. or false. if run as a program.
       The input,
ḷ      lowercased,
 ⊆     is a not-necessarily-contiguous sub-list of
  Ạ    "abcdefghijklmnopqrstuvwxyz".

The first version I came up with, not explicitly referencing the alphabet:
Brachylog, 4 bytes
ḷ≠.o

Try it online!
        The input,
ḷ       lowercased,
 ≠      in which every character is distinct,
  .     is the output variable,
   o    which sorted,
        is still the output variable.

Java 8 - 90 89 87 85 chars
The idea here is to use a 'reduce' function that tracks the last char and "gives up" when it detects the sequence is not strictly ascending.
golfed:
int f(String s){return s.toLowerCase().chars().reduce(0,(v,c)->(v<0)?v:(c>v)?c:-1);}

ungolfed:
int f(String s){
    return s.toLowerCase()
            .chars()
            .reduce(0, (v,c) -> (v<0)? v : (c>v)?c:-1);
}

example:
System.out.println(new Quick().f("abc"));
System.out.println(new Quick().f("aa"));
System.out.println(new Quick().f("abcdefGHIjklmnopqrSTUVWXyz"));
System.out.println(new Quick().f("puZ"));
System.out.println(new Quick().f("Puz"));
System.out.println(new Quick().f("cba"));

output:
99
-1
122
122
122
-1

JavaScript (ES6) 54
Convert to uppercase, then to array and sort. If during sort two element are in the wrong order or equal, return 0 (falsy) else 1 (truthy)
Edit Shortened thx to @Optimizer (but still 2 more than the @Tamas solution implemented in ES6: F=s=>[...s.toUpperCase()].every(c=>(u=l,l=c)>u,l=''))
F=s=>[...s.toUpperCase(x=1)].sort((a,b)=>a<b?1:x=0)&&x

Test in Firefox / FireBug console
;['a','abcdefGHIjklmnopqrSTUVWXyz','aa','puz','puzz','puzZ','puZ','PuZ']
.map(w=>w+' '+F(w))

["a 1", "abcdefGHIjklmnopqrSTUVWXyz 1", "aa 0", "puz 1", "puzz 0", "puzZ 0", "puZ 1", "PuZ 1"]

s= does not seem to be required...

@Optimizer right, it was a first try when at last i compared the original (uppercased) and the sorted

C# 6, 18 + 82 76 = 94 bytes
Requires (18 bytes):
using System.Linq;

Code (76 bytes):
bool a(string s)=>(s=s.ToLower()).Distinct().OrderBy(x=>x).SequenceEqual(s);

C# 6 supports lambdas to define a function, which is useful for golfing.
Non-C# 6 version:
bool a(string s){return (s=s.ToLower()).Distinct().OrderBy(x=>x).SequenceEqual(s);}

Ungolfed code:
bool IsInAlphabeticalOrder(string s)
{
    s = s.ToLower();
    return s.Distinct()
            .OrderBy(x => x)
            .SequenceEqual(s);
}

J, 21 characters
This is too long. The argument must have rank 1, i.e. it must be a string or vector.
*/@(<=~.;/:~)@tolower

tolower y – y in lower case.
/:~ y – y in lexical order.
~. y – the nub of y, that is, y with duplicates removed.
x ; y – x and y put into boxes and then concatenated.
< y – y put into a box.
x = y – x  compared element-wise with y.
(< y) = (~. y) ; (/:~ y) – a vector indicating if y is equal to its nub and itself sorted.
*/ y – the product of the items of y, or its logical and if the items are booleans.
*/ (< y) = (~. y) ; (/:~ y) – a boolean indicating the desired property for lowercase y.

Julia, 44 bytes
s->(l=lowercase(s);l==join(sort(unique(l))))

This creates an anonymous function that takes a single argument s, converts it to lower case, and compares it to the unique sorted version of the string. It returns a boolean, i.e. true or false. If you want to test it out, assign it like f=s->... and then call f("PuZ"), etc.

Amen to that, @flawr. Thanks for the support.

I'm slightly late but you can shave 3 bytes

k (6 bytes)
&/>':_

& returns true if both args are true
/ modifies & to apply "over" a list, like a fold in functional languages
> greater than
': modifies > to apply "each-prior", so returns a vector of booleans stating which elements are greater than their predecessor
_ makes it argument lower case
  _"puzZ"
"puzz"
  >':_"puzZ"
1110b
  &/>':_"puzZ"
0b

(0b means boolean false)
q (13 bytes)
all(>':)lower

q is just syntactic sugar on k. all is defined as &/, and lower is _

Can you explain how this works?

This almost feels like cheating on other languages... Who needs function names, parentheses and semicolons? :)

@sanchises k has all of those things and they work pretty much the same way as in C style languages. It's just that this problem happens to be expressible as a single statement.

Perl 6, 35 bytes
{my@c=.uc.comb;@c eq@c.sort.unique}

This produces a callable block; if I could just assume that $_ is already set to the desired word, I could delete the surrounding curly braces and lose two more bytes, but probably the only reasonable way to make that assumption would be to run it with -n and feed the word as standard input, which would add the two bytes right back.

Sure it does. .uc.comb doesn't rearrange anything, so if the uppercased and combed array is equal to the sorted uppercased and combed array, that means it started out in sorted order.

right, it's checking the size of the intersection, which ignores order. Ok, updated.

R, 37 bytes
all(diff(utf8ToInt(scan(,''))%%32)>0)

Try it online!
Posting since this is substantially different and shorter than Michal's R answer.
Converts the letters to ASCII codepoints with utf8ToInt, then takes modulo 32 so that lower and upper letters are converted to the same numbers 1...26. Computes the pairwise differences, and checks that they are all positive.

Perl, 27
@hsl's regexp dynamically build.
#!perl -p
$"="?";@x=a..z;$_=/^@x?$/i

Also we can do a reverse match: convert the input into a regexp: PuZ => .*p.*u.*z.* and then match this to a string of letters in alphabetical order. Result - also 27 characters.
#!perl -lp
$_=join(s//.*/g,a..z)=~lc

Python, 50 bytes
f=lambda x:sorted(set(x.lower()))==list(x.lower())

Try online here: http://repl.it/c5Y/2

PHP (89 76 72 63 bytes)
I'm pretty horrible at golfing, but I thought I'd give it a shot.
<?=(join(array_unique(str_split($a=strtolower($argv[1]))))==$a)+0;

I had to cast the output to an integer, since booleans aren't printed in php.
I was able to remove the echo by using <?=, I also removed the $b.
[edit]
Removed the space after <?= and followed manatwork's suggestion to cut 4 bytes.
Also, replacing the implode with join and omitting the glue parameter saved another 9 bytes. Thanks manatwork.

You can also force a boolean into integer by adding 0 to it. +0 is shorter than (int).

Though this passes successfully the test cases provided in the question, it definitely not checks for alphabetical order. For example it outputs 1 for “xa”.

There is an alias for implode(), with shorter name: join(). And the first parameter is optional, defaulting to empty string.

@manatwork There is too, completely missed it. Thank you.

@manatwork I see it doesn't do alphabetical order... which I find weird, array_unique should sort the array.

I count 63 bytes. Forgot to count the tag?

Python 2, 43 bytes
lambda s:eval('"%s"'%'"<"'.join(s.lower()))

Try it online!
Puts < symbols between all the letters (converted to lowercase), and then evals it. Python's chained comparison operators are perfectly happy to evaluate the whole thing as one big boolean expression.

Vyxal, 6 bytes
⇩¨=‡Us

Try it Online!
Explained
⇩¨=‡Us
⇩¨=    # is the lowercase version of the input invariant under:
  ‡Us  # uniquify and sort?

3 bytes: ⇩Þ⇧ (filler)

Posted my three-byter myself

Prolog (SWI), 36 bytes
\S:-maplist(to_lower,S,L),sort(L,L).

Try it online!
Ungolfed:
\S :-
  maplist(to_lower, S, L), % convert each character code in S to lowercase, putting that in a list called L
  sort(L, L). % Does L sorted and uniquified equal L?

PHP (52 bytes)
This is an answer based on @HSL's regex (sorry dude).
The idea is to grab the regex and generate it instead of having it hard-coded.
Here is the code:
echo preg_match("@^".join('?',range(a,z))."?$@",$s);

Since this answer isn't entirely of my authority, I have marked it as "Community Wiki".
To use this, simply add a line before with $s='String!';.

If the string to parse should be provided in variable $s, then that should be preg_match()'s 2nd parameter. Which is 2 characters shorter.

@manatwork Oh god! Sorry the stupidity! I was distracted and wrote it without thinking. I've fixed it now.

Erlang, 51
f(S)->G=string:to_lower(S),ordsets:from_list(G)==G.

Uses an ordered set (analogous to java.util.TreeSet) to sort the characters and discard any duplicates. The new list is then compared with the input string.
Test Function:
test() ->
    [io:format("~p ~p~n", [S, f(S)]) || S <- ["a","abcdefGHIjklmnopqrSTUVWXyz","aa","puz","puzz","puzZ","puZ","PuZ"]].

Java, 96
boolean a(char[]a){int i=-1,l=0;for(;++i<a.length;l+=i>0&&a[i]<=a[i-1]?1:0)a[i]|=32;return l<1;}

Pretty straightforward here. Just convert all to lower and compare each to the previous character.

PowerShell, 37
-join(($x="$input")[0..26]|sort)-eq$x

Can be shortened by another byte by using command-line arguments instead of stdin ($args instead of $input).
Tricks used:

PowerShell is case-insensitive by default, simplifying the check.
Getting a char[] from the input is a bit shorter if we know an upper bound for the length [0..x] instead of [char[]]

Rebol - 26 25
(s: input)= sort unique s

NB. Above works fine in Rebol 2.  However in Rebol 3 sort isn't case insensitive (yet) so for now it would need to be written has (s: input)= sort lowercase unique s

R, 62 Bytes
s=strsplit(tolower(word),"")[[1]]
all(s[order(unique(s))]==s)

This will throw a warning if there is a repeating character.
To avoid this, I inserted zeros to make both strings the same length. I assumed this is OK since we are only using letters and not numbers.
s <- strsplit(tolower(word), "")[[1]]
all(c(s[order(unique(s))],rep('0',length(s)-length(unique(s)) )) == s)

Clojure, 69
(let[s(seq(.toLowerCase (read-line)))](= s(seq(apply sorted-set s))))

Run in the REPL, enter a string and press return. Prints true or false.  E.g.
user=> (let[s(seq(.toLowerCase (read-line)))](= s(seq(apply sorted-set s))))
puZ
true
user=> (let[s(seq(.toLowerCase (read-line)))](= s(seq(apply sorted-set s))))
puzz
false

Javascript, 147 145 bytes
function(a){b=[];a=a.toLowerCase().split('');while(a.length)b.push(a.pop().charCodeAt(0));while(c=b.pop()){if(c>=b[b.length-1])return 0}return 1}

An anonymous function that converts to lowercase, creates an array of char codes, then checks them from right to left.

Retina, 33 bytes
Byte count assumes ISO 8859-1 encoding.
T`L`l
^
$_¶
O`\G.
D`\G.
^(.*)¶\1$

Try it online
Translate uppercase to lowercase, duplicate input, sort the first line, deduplicate first line, then check if the lines are equal.

C++14, 59 58 bytes
-1 byte for int instead of auto in range-based for-loop.
As unnamed lambda returning via reference parameter. 64 (>0) for true, 0 for false. Input s may be std::string or char[].
[](auto&s,int&r){int b=r=64;for(int c:s)r*=b<(c&=95),b=c;}

The &=95 is from this answer.
Ungolfed and usage:
#include<string>
#include<iostream>

auto f=
[](auto&s,int&r){
  int b=r=64;
  for(int c:s)
    r*=b<(c&=95),
    b=c;
}
;

int main(){
  std::string s;
  int r;
  s="ABC";
  f(s,r); std::cout << s << ", " << r << std::endl;
  s="AbC";
  f(s,r); std::cout << s << ", " << r << std::endl;
  s="ACB";
  f(s,r); std::cout << s << ", " << r << std::endl;
  s="AcB";
  f(s,r); std::cout << s << ", " << r << std::endl;
}

Python 2, 62 bytes (thank to Shaggy)
def a(w):
    v=w.lower()
    print v==''.join(sorted(set(v)))

I know I can not beat anyone but here is my solution.
PoC:
https://repl.it/repls/UnderstatedDecimalSales

Thank you so much for pointing the  missing part for me, I just updated my answer!

Japt, 6 bytes
v ä< e

Try it online!
Explanation:
v         #Convert to all lowercase
  ä  e    #For every pair of consecutive letters:
   <      # Check that the second letter is later in the alphabet than the first

MathGolf, 6 bytes
mδ_s▀=

Try it online!
Explanation
m        explicit map (per character)
 δ       capitalize string
         these two commands transforms the input string to uppercase
  _      duplicate the uppercase string
   s     sort(array)
    ▀    unique elements of string
     =   check if equal to the uppercased input

APL (Dyalog Extended), 6 bytesSBCS
Anonymous tacit prefix function.
(∧≡∪)⌊

Try it online!
(…)⌊ on the lowercase:
 ∧≡∪ does the ascending sort match the unique?

><>, 29 20 bytes
Saved 9 bytes thanks to Jo King
0\0=n;
!\i1+48*%:r)?

Try it online!

20 bytes

@JoKing: I was sure it could still be golfed, but 9 bytes is more than I'd thought was possible. I really like the 0=. Need to remember that one for future golfs :)

Bash+coreutils, 27 bytes
grep -Ei ^1`echo ?{a..z}?`$

Try it online!
There was an earlier answer with pure Bash, but this one is cool because it saves space by making a much "worse" regular expression. The command substitution expands to the regular expression
^1?a? ?b? ?c? ?d? ?e? ?f? ?g? ?h? ?i? ?j? ?k? ?l? ?m? ?n? ?o? ?p? ?q? ?r? ?s? ?t? ?u? ?v? ?w? ?x? ?y? ?z?$

which accepts many things that we don't care about (1's at the beginning and spaces almost anywhere) but that's okay because it selects correctly when limited to things in the input specification. This lets us avoid a printf %s and just accept the spaces that Bash gives when it expands ?{a..z}?

APL(NARS), 32 char, 64 bytes
{(k≡∪k)∧k≡k[⍋k←26∣¯1+(⎕A,⎕a)⍳⍵]}

how to use and test (note that "'a'" is a char type and ",'a'" is one type array chars):
  h←{(k≡∪k)∧k≡k[⍋k←26∣¯1+(⎕A,⎕a)⍳⍵]}
  h ,'a'
1
  h 'abcdefGHIjklmnopqrSTUVWXyz'
1
  h 'aa'
0
  h 'puz'
1
  h 'puzz'
0
  h 'puzZ'
0

Possible there is something more short.

Ruby, 29 bytes
->s{s=~/^#{[*?a..?z]*??}?$/i}

Try it online!
Returns 0 if in order, or false if not in order.

05AB1E, 4 bytes
lDêQ

Try it online or verify all test cases.
Explanation:
      #  i.e. input: "Test"
l     # Convert the (implicit) input-string to lowercase
      #  STACK: ["test"]
 D    # Duplicate it
      #  STACK: ["test", "test"]
  ê   # Uniquify and sort the characters in the duplicated string
      #  STACK: ["test", "est"]
   Q  # Check if both strings are equal
      #  STACK: [0]
      # (after which the top of the stack is output implicitly as result)

Husk, 7 5 bytes
ΠẊ>ma

Try it online!
Inspired by caird's Jelly answer
   m    # map over all letters of input:
    a   #  make lowercase
 Ẋ      # then for each pair
  >     #  test if R > L
Π       # and get the product of all the results.

Jelly, 5 bytes
Œu<ƝẠ

Try it online!
How it works
Œu<ƝẠ - Main link. Takes a string S on the left
Œu    - Uppercase
   Ɲ  - Over overlapping pairs [a, b]:
  <   -   Is a < b?
    Ạ - True for all?

x86 machine code, 15 bytes
Hexdump:
33 c0 ac 24 5f 3a e0 73 05 8a e0 e2 f5 f9 c3

A function which receives a pointer to the string in esi and its length in ecx. Returns in CF.
Disassembly:
10011860 33 C0                xor         eax,eax
10011862 AC                   lods        byte ptr [esi]
10011863 24 5F                and         al,5Fh
10011865 3A E0                cmp         ah,al
10011867 73 05                jae         bad (1001186Eh)
10011869 8A E0                mov         ah,al
1001186B E2 F5                loop        my+2h (10011862h)
1001186D F9                   stc
1001186E C3                   ret

I had arrange the comparison in such a way that for "bad" strings the carry flag gets set to 0.
Test program (works in Visual Studio):
#include <stdio.h>
#include <string.h>

__declspec(naked) char my()
{
    _asm
    {
        xor eax, eax;
    myloop:
        lodsb;
        and al, 0x5f;
        cmp ah, al;
        jae bad;

        mov ah, al;
        loop myloop;
        stc;
    bad:
        ret;
    }
}

__declspec(naked) bool __fastcall caller(const char*, size_t)
{
    _asm
    {
        push esi;
        mov esi, ecx;
        mov ecx, edx;
        call my;
        mov al, 0;
        adc al, 0;
        pop esi;
        ret;
    }
}

bool is_good(const char* s)
{
    printf("%s ", s);
    size_t l = strlen(s);
    return caller(s, l);
}

int main()
{
    printf("%d\n", is_good("abd"));
    printf("%d\n", is_good("a"));
    printf("%d\n", is_good("abcdefGHIjklmnopqrSTUVWXyz"));
    printf("%d\n", is_good("aa"));
    printf("%d\n", is_good("puz"));
    printf("%d\n", is_good("puzz"));
    printf("%d\n", is_good("puzZ"));
    printf("%d\n", is_good("puZ"));
    printf("%d\n", is_good("PuZ"));
    printf("%d\n", is_good("pzu"));
    printf("%d\n", is_good("pzU"));
    printf("%d\n", is_good("abcdABCD"));
    printf("%d\n", is_good("dcba"));
}

It contains a function caller which translates calling conventions.

Pyth, 8 bytes
qKrQ1S{K

Try it online!
qKrQ1S{K
qKrQ1S{KQ  // Implicit input
 KrQ1      // Assign uppercase input to K
q    S{K   // Deduplicate K and sort it
q          // Is original K == deduplicated and sorted

Excel ms365, 45 bytes
=CONCAT(SORT(UNIQUE(MID(A1,ROW(1:26),1))))=A1

The formula fails if you copy it to other cells. I think you have to change it to ...ROW($1:26)...,

@jdt one can assume input in cell A1. Since this is code-golf I'd not drag the formula down, a simple copy would do.

@JvdV sir, how are you getting to know about the bytes and is it necessary to mention while posting an answer?

@MayukhBhattacharya code-golf is not about making the most efficient answer. It's about the shortest answer in butes Each character is a byte in Excel. I usually count them here

Oh sounds good sir, really helpful.

Vyxal, 3 bytes
⇩Þ⇧

Try it Online!

Julia 1.0, 34 bytes
!x=all(diff(([x...].-'A').%32).>0)

Try it online!

C# (Visual C# Interactive Compiler), 44 bytes
n=>n.Aggregate((a,b)=>a>1&a%32<b%32?b:'')>1

Can be 42 bytes if I return a SOH char for non-alphabetic and anything else for alphabetic.
Try it online!

JavaScript (Node.js), 93 bytes
w=>new Set(w).size==w.length&&[...w.toLowerCase()].sort().join``==[...w.toLowerCase()].join``

Try it online!

Perl 6, 30 14 bytes
{[<] .uc.ords}

Try it online!
Gets the ordinal values of the uppercased string and checks if they are in strictly increasing order.

PHP, 42 bytes
for(;$c=_&$argn[$i++];$p=$c)$c<$p&&die(1);

exits with 1 (error) for falsy, exit code 0 for truthy.
Run as pipe with -nR or try it online.
If you absolutely need visible output, take these 51 bytes:
for(;$c=_&$argn[$i++];$p=$c)$c<$p&&die("0");echo 1;

Jelly, 6 bytes
ŒuQ⁼ṢƊ

Try it online!
Explanation
ŒuQ⁼ṢƊ Main link: takes string on the left
Œu     uppercase the input
     Ɗ fork: f(x) g h(x)
  Q    unique
   ⁼   equals
    Ṣ  sorted?

Clojure, 37 bytes
#(apply < 0(map int(.toLowerCase %)))

If it is okay to throw an error on empty strings, we can save 2 bytes by getting rid of the 0.
#(apply <(map int(.toLowerCase %)))

Thunno 2, 4 bytes
LDḳ=

Attempt This Online!
Explanation
LDḳ=  # Implicit input
L     # Lowercase the input
 D    # Duplicate this string
  ḳ   # Sort and uniquify
   =  # Are they equal?
      # Implicit output

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


text:
Analyzing Collatz-like sequences
We define a Collatz-like sequence s with 4 positive integers:

n starting value
d > 1 divisor
m > 1 multiplier
i increment

(In the original Collatz sequence d = 2 m = 3 and i = 1.)
Given these integers s will be created in the following manner:

s(0) = n
if k > 0 and s(k-1) mod d = 0 then s(k) = s(k-1) / d
if k > 0 and s(k-1) mod d != 0 then s(k) = s(k-1) * m + i

An example sequence with d = 2, m = 3, i = 5 and n = 80 will be s = 80, 40, 20, 10, 5, 20, 10, 5, 20, ....
Every sequence will either reach higher values than any given bound (i.e. the sequence is divergent) or get into an infinite loop if for some t and u (t!=u) the s(t) = s(u) equality will be true.
In our problem if the value of a sequence element is larger than 10^9 or there is no element repetition before the 1000th element the sequence is considered divergent.
The task
You should write a program or function which takes the positive integers d m and i as inputs and outputs all the different ending types of the sequences (infinite loops and divergence) which the starting values n = 1, 2, 3, ... 999, 1000 can produce.
Input details

The input is a string or list (or closest equivalent in your language) representing (in the common way) three positive integers d, m and i in that order. d and m are at least 2. Neither number is larger than 100.

Output details
The output specification is a bit wordy. Might worth to check out the examples first.

You should output to the standard output (or closest alternative) or return a string.
If divergent sequence is possible the first line should be DIVERGENT.
A unique representation of a sequence's loop is it's rotation where the smallest number is the last separated by spaces. E.g. if s = 2 1 4 2 1 4 2 1 the loop is 4 2 1.
In every following line you should output every unique loop exactly once preceded by the word LOOP. E.g. LOOP 4 2 1
The loops should be in ascending order in regard of their last element.
Trailing newline is optional.

Examples:
The first lines are the inputs and the following ones until a blank line are the outputs.
2 3 1
LOOP 4 2 1

2 2 6
LOOP 8 4 2 1
LOOP 12 6 3

3 7 8
DIVERGENT
LOOP 15 5 43 309 103 729 243 81 27 9 3 1
LOOP 22 162 54 18 6 2
LOOP 36 12 4

3 9 1
DIVERGENT

6 9 9
DIVERGENT
LOOP 18 3 36 6 1
LOOP 27 252 42 7 72 12 2
LOOP 45 414 69 630 105 954 159 1440 240 40 369 3330 555 5004 834 139 1260 210 35 324 54 9 90 15 144 24 4
LOOP 81 738 123 1116 186 31 288 48 8
LOOP 99 900 150 25 234 39 360 60 10
LOOP 126 21 198 33 306 51 468 78 13

10 10 10
LOOP 20 2 30 3 40 4 50 5 60 6 70 7 80 8 90 9 100 10 1

93 91 92
DIVERGENT
LOOP 2185 198927 2139 23
LOOP 4278 46

Reference implementation in Python 3 on Ideone.
This is code-golf so shortest entry wins.

Python 3, 269 254 252 246 bytes
d,m,i=eval(input())
S=set()
for n in range(1,1001):
 T=X=()
 while len(T)**3<1e9>=n:
  T=(n,)+T;n=[n//d,n*m+i][n%d>0]
  if n in T:I=T.index;L=T[:I(n)+1];M=I(min(L));X=L[M:]+L[:M]
 S|={X}
for x in sorted(S):print(x and"LOOP"or"DIVERGENT",*x[::-1])

(Now 10 times slower to save a few bytes. Typical code golf.)
Input a list via STDIN (e.g. [2, 3, 1]). I'm thinking that there's got to be a better way of standardising the cycles...
The approach is quite straightforward — test all 1000 numbers and take only the unique outputs. However, there are two little tricks in there:

Loops are represented by nonempty tuples, but more importantly divergence is represented by an empty tuple. This is good because:

It doesn't break sorted, and will even appear before all the loop tuples
It allows us to select a string via x and"LOOP"or"DIVERGENT"
*()[::-1] doesn't affect print

The loops are built backwards to turn "sort ascending by last element" into "sort ascending by first element", which removes the need to pass a lambda into sorted.

Previous submission, 252 bytes
d,m,i=eval(input())
def f(n,T=()):
 x=[n//d,n*m+i][n%d>0];I=T.index
 if x in T:L=T[:I(x)+1];M=I(min(L));return L[M:]+L[:M]
 return()if(T[1000:]or x>1e9)else f(x,(x,)+T)
for x in sorted(set(map(f,range(1,1001)))):print(x and"LOOP"or"DIVERGENT",*x[::-1])

This one's a lot faster.


text:
Shotgun Numbers
The Shotgun numbers are a sequence with a rather simple definition but some interesting structure. Start with the natural numbers:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...

Now take all numbers at indices divisible by 2, group them into pairs, and swap the numbers in each pair:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, ...
   ^     ^     ^     ^      ^       ^       ^
    <--->       <--->        <----->         <----
1, 4, 3, 2, 5, 8, 7, 6, 9, 12, 11, 10, 13, 16, ...

Now do the same with indices divisible by 3:
1, 4, 3, 2, 5, 8, 7, 6, 9, 12, 11, 10, 13, 16, ...
      ^        ^        ^           ^
       <------>          <--------->
1, 4, 8, 2, 5, 3, 7, 6, 10, 12, 11, 9, 13, 16, ...

And then for 4, 5, 6, and so on:
1, 4, 8, 2, 5, 3, 7, 6, 10, 12, 11, 9, 13, 16, ...
1, 4, 8, 6, 5, 3, 7, 2, 10, 12, 11, 14, 13, 16, ...
1, 4, 8, 6, 12, 3, 7, 2, 10, 5, 11, 14, 13, 16, ...
1, 4, 8, 6, 12, 14, 7, 2, 10, 5, 11, 3, 13, 16, ...
...

After k such steps, the first k+1 numbers will be fixed. So we can define the infinite sequence of Shotgun numbers as the limit of letting k go to infinity. The first 66 numbers are:
1, 4, 8, 6, 12, 14, 16, 9, 18, 20, 24, 26, 28, 22, 39, 15, 36, 35, 40, 38, 57, 34, 48, 49, 51, 44,
46, 33, 60, 77, 64, 32, 75, 56, 81, 68, 76, 58, 100, 55, 84, 111, 88, 62, 125, 70, 96, 91, 98, 95,
134, 72, 108, 82, 141, 80, 140, 92, 120, 156, 124, 94, 121, 52, 152, 145, ...

Fun fact: Despite being obtained by only permuting the natural numbers, this sequence does not contain any primes.
The Challenge
Given an integer n > 0, find the nth Shotgun number. You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and return the output or print it to STDOUT (or closest alternative).
This is code golf, so the shortest submission (in bytes) wins.
Leaderboards
This is getting more answers than I thought, as well as several people competing in the same language. So here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
# Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
# Ruby, <s>104</s> <s>101</s> 96 bytes

function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function getAnswers(){$.ajax({url:answersUrl(page++),method:"get",dataType:"jsonp",crossDomain:true,success:function(e){answers.push.apply(answers,e.items);if(e.has_more)getAnswers();else process()}})}function shouldHaveHeading(e){var t=false;var n=e.body_markdown.split("\n");try{t|=/^#/.test(e.body_markdown);t|=["-","="].indexOf(n[1][0])>-1;t&=LANGUAGE_REG.test(e.body_markdown)}catch(r){}return t}function shouldHaveScore(e){var t=false;try{t|=SIZE_REG.test(e.body_markdown.split("\n")[0])}catch(n){}return t}function getAuthorName(e){return e.owner.display_name}function process(){answers=answers.filter(shouldHaveScore).filter(shouldHaveHeading);answers.sort(function(e,t){var n=+(e.body_markdown.split("\n")[0].match(SIZE_REG)||[Infinity])[0],r=+(t.body_markdown.split("\n")[0].match(SIZE_REG)||[Infinity])[0];return n-r});var e={};var t=0,c=0,p=-1;answers.forEach(function(n){var r=n.body_markdown.split("\n")[0];var i=$("#answer-template").html();var s=r.match(NUMBER_REG)[0];var o=(r.match(SIZE_REG)||[0])[0];var u=r.match(LANGUAGE_REG)[1];var a=getAuthorName(n);t++;c=p==o?c:t;i=i.replace("{{PLACE}}",c+".").replace("{{NAME}}",a).replace("{{LANGUAGE}}",u).replace("{{SIZE}}",o).replace("{{LINK}}",n.share_link);i=$(i);p=o;$("#answers").append(i);e[u]=e[u]||{lang:u,user:a,size:o,link:n.share_link}});var n=[];for(var r in e)if(e.hasOwnProperty(r))n.push(e[r]);n.sort(function(e,t){if(e.lang>t.lang)return 1;if(e.lang<t.lang)return-1;return 0});for(var i=0;i<n.length;++i){var s=$("#language-template").html();var r=n[i];s=s.replace("{{LANGUAGE}}",r.lang).replace("{{NAME}}",r.user).replace("{{SIZE}}",r.size).replace("{{LINK}}",r.link);s=$(s);$("#languages").append(s)}}var QUESTION_ID=47338;var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";var answers=[],page=1;getAnswers();var SIZE_REG=/\d+(?=[^\d&]*(?:<(?:s>[^&]*<\/s>|[^&]+>)[^\d&]*)*$)/;var NUMBER_REG=/\d+/;var LANGUAGE_REG=/^#*\s*([^,]+)/
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
<link rel=stylesheet type=text/css href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	AuthorLanguageSize

Winners by Language

LanguageUserScore

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

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

That fun fact is crazy, this algorithm shuffles all the primes to the end? Or are there other natural numbers that also will not occur?

@DevonParsons Yes it shuffles all primes "to the end". But I think there are other numbers missing as well. It looks like 10, 21, 25 and 30 don't appear either, for example.

This sounds like a Project Euler question. I don't think it is... but maybe it should be.

Wow, interesting fun fact! Although after a while it becomes obvious that prime number will always get shifted upwards at steps p*2^k for any k >= 0 and so will not appear in the sequence.

In general, at the kth iteration, the kth element in the array gets transposed to the 2kth position, and won't get touched again until the 2kth iteration, at which time it gets transposed to the 4kth position, ad infinitum. A prime doesn't get transposed until its turn comes along, so to speak, so all primes get shuffled forward. But we can easily make a list of the innocent victims simply by printing off the first element to be transposed at iteration 2 and each odd iteration. The list goes: 2, 3, 5, 7, 10, 11, 13, 21, 17, 19, 30, 23, 27, 25, 29, 31, 45, 42, 37, 54, 41, 43, 65, ...

@Théophile You should submit your sequence to the OEIS, it doesn't seem to be listed currently

@aPaulT It is, in order: https://oeis.org/A064627

@MartinBüttner Ah, thanks, hadn't noticed that the list above was not in order when I searched on it...

@aPaulT Thèophile sorted them by the order in which they "disappear", whereas OEIS just has them sorted by value.

Does anyone know what the upper bound on this sequence is?

@AJMansfield You can show that the upper bound is at most N(N+3)/2 - 1, so N^2 would be a conservative but simple bound. However, I did run my Mathematica implementation systematically for a bit, and numbers that are greater than 4N are already quite rare (the first one being N = 3465 and the next ones all being multiples of that), and up to about N = 70,000 I haven't found any which exceeded 5N. However, I don't have a proof that a linear bound exists.

@Théophile You should still submit your method of determining oeis.org/A064627 to the OEIS.

@Sherlock9 Done! If approved, it will be https://oeis.org/A266679. Happy new year!

@Théophile Very cool! Happy new year!

@Théophile Ignore my last comment. You should probably also propose an edit to the existing sequence linking to your new one if it gets approved.

Pyth, 19 22
u-G*H^_!%GH/GHrhQ2Q

A fairly naive implementation of @PeterTaylor's golfscript answer.
Try it online here
This uses the same tricks to convert a while loop into a fold as the other Pyth program below does.

u+G**H!%GHty%/GH2rhQ2Q

A naive copy of @Sp3000's algorithm translated to Pyth.
You can try it online here
Uses reduce (python's name for fold) to emulate the while loop. It enumerates over the range(input, 2) which in Pyth works out to range(2, input)[::-1]. The other Pyth-related golfs involves using not instead of <2 and using y's hidden mode of doubling the value of numeric arguments.

><>, 52 45 bytes
Esolangs page for ><>
i:&&:&1-?vn;
2*1-*+20.>:&:&%1(&:&*{:}&:1-&,2%

There's a lot of copying and moving elements around, thanks to the several modulo and multiplications needed. The logic is exactly the same as my Python solution.
Takes input via a code point from STDIN, e.g. "!" = 33 -> 75.

And you got the award for the most awkward input format ever :P

+1 anyway, don't worry :)

@Sp3000 IMO it should only count as one

@SuperJedi224 Actually, according to this meta post apparently -v counts as three :/

Python 2, 58 bytes
i=n=input()
while~-i:n+=(n%i<1)*i*(n/i%2*2-1);i-=1
print n

Like most of the other answers, the idea is to work backwards.

Let's call step k+1 step i, so that on step i all the multiples of i are swapped. We need two simple observations:

Position n in the array is only swapped at step i if n is divisible by i,
To tell whether you're the lower number or the higher number in the swap, look at n/i mod 2. If this is 1 you're the lower number (and will swap up), otherwise you're the higher number (and will swap down).

This gives us an algorithm for working backwards. Let's try it with 6, starting from the last step (step i = 6):
Step 6: Position 6 swaps with position 12 (6 is divisible by 6, 6/6 = 1 == 1 mod 2)

So now we know the number came from position 12. Then:
Step 5: No swap (12 not divisible by 5)
Step 4: Position 12 swaps with position 16 (12 is divisible by 4, 12/4 = 3 == 1 mod 2)

So now we know it came from 16 before that. Finally:
Step 3: No swap (16 not divisible by 3)
Step 2: Position 16 swaps with position 14 (16 divisible by 2, 16/2 = 8 == 0 mod 2)

Since this is the first step (remember, k+1), we're done and the number that ends up in position 6 originally came from position 14, i.e. the 6th shotgun number is 14.
So now for the Python explanation:
i=n=input()             Read input, and store into i (step) and n (position)
while~-i:               while i-1 != 0:, or since we're descending with i this is just while i>1:
  n+=                   Add to the current position...
    (n%i<1)*            1* whatever's next if n is divisible by i, otherwise 0* (i.e. nothing)
    i*                  How many positions n might go up/down
    (n/i%2*2-1)         n/i%2 tell us higher/lower, *2-1 maps 0 or 1 to -1 (down) or +1 (up)
  i-=1                  Decrement the step number
print n                 Output

interesting way to write i-1 as ~-i

@mbomb007: Agreed. Clever though, as it has the same meaning but eliminates the need for a space after while. Nice work, Sp3000.

Shortest I could get this in pyth was by using reduce: u+G**H!%GHty%/GH2rhQ2Q

@FryAmTheEggman, Sp3000, is neither of you going to post that?

@MartinBüttner I didn't originally post it as I felt it was too much of a copy. I'll post it as a CW answer for now.

Note to self, update some day: xnor's suggestion

Haskell, 68 bytes
n#k|mod k(2*n)<1=k-n|mod k n<1=k+n|k>0=k
s n=foldr((.).(#))id[2..n]n

Probably further golfable, especially the first row. This defines a function s that takes n and returns the nth shotgun number.
map s [1..66]
[1,4,8,6,12,14,16,9,18,20,24,26,28,22,39,15,36,35,40,38,57,34,48,49,51,44,46,33,60,77,64,32,75,56,81,68,76,58,100,55,84,111,88,62,125,70,96,91,98,95,134,72,108,82,141,80,140,92,120,156,124,94,121,52,152,145]

Explanation
The helper function # takes in two numbers n and k, and returns the kth number in the list defined by applying the pair swap operation to every nth number. For example, applying it to the first 20 numbers with n = 4 yields this:
map (4#) [1..20]
[1,2,3,8,5,6,7,4,9,10,11,16,13,14,15,12,17,18,19,24]

The result of s n is obtained by reducing ("folding") the list [2..n] by the second-order function (.).(#), which takes in a number m and a function f (initially the identity function id), and returns a function that takes k and returns f (m # k). For example, in the case n = 4 the list [2,3,4] is reduced to a function that takes k and returns id (4 # (3 # (2 # k))). The id is only needed for the base case n = 1, where the list is empty. Finally, we give this function the input k = n, obtaining the nth shotgun number.

CJam, 32 bytes
Just following the spec to the point. Running the instructions on a larger set so as to not affect the nth number.
ri:N)2#,:)N{))/2/{:)~\@}%:+}/N(=

Try it online here

Python 2, 97 79 chars
g=lambda n,k:n>1and g(n-1,k-(k%n<1)*n*(-1)**(k/n%2))or k
n=input()
print g(n,n)

It determines for each index the correct value by recursively chasing the number backwards.
The algorithm was independent discovered.
edit: Now it only prints the nth number instead of the first n numbers. Of course an iterative approach would be shorter, but I don't want to copy Sp3000's code.

Yeah, I think everybody will converge on this. I found the g(i,i) part particularly annoying though...

The language should be marked as Python 2, because of the print statement.

@mbomb007 Corrected it.

Ruby, 92 bytes
def s(d,n)
d==1?n:s(d-1,n%d==0?n+(n%(d*2)==0?-d :d):n)
end
n=ARGV[0].to_i
print s(n,n).to_s

My first code golf effort.  Not based on any other answer.

Now that I've looked at some of the others though, I notice that most just define a function, not a complete program that accepts input and produces output.  The OP asked for a complete program with input and output.  Is it customary to ignore such requirements?

84 Bytes
n=ARGV[0].to_i
d=n
while d>1
n+=(n%d==0?(n%(d*2)==0?-d :d):0)
d-=1
end
print n.to_s

After looking at other answers and realizing that an iterative solution is possible.

A few improvements for your 84 byte solution: 1. Change ARGV to the $* magic global. 2. The to_s is unnecessary. 3. Instead of assigning d to n on a separate line, just do d=n=... to shave off a character. Nice work for your first golf! :)

Where am I asking for a complete program? "You may write a program or function..." ;) (This is also the default for [tag:code-golf] challenges, but I usually include it for completeness.)

To add to @Doorknob's suggestions, two sets of brackets on the n+= line are unnecessary, and both occurrences of ==0 can safely be changed to <1.

GolfScript, 27 chars
~.,(~%{):i\.@%!~)1$i/?i*-}/

Explanation
If f(i, n) is the value at position n after i-1 transformations, we have
f(1, n) = n
f(i, n) = f(i - 1, n % i == 0 ? (((n / i - 1) ^ 1) + 1) * i : n)  for i > 1

where ^ denotes bitwise xor; given input n, we want to compute f(n, n).
The conversion from a recursive function to a loop is uninteresting; what is interesting is the way in which
n % i == 0 ? (((n / i - 1) ^ 1) + 1) * i : n

can be rewritten. The more obvious approach is to say that it must be
n + (n % i == 0 ? i : 0) * g(n / i)

for some g. Obviously g alternates between 1 and -1, as the positions swap alternately up and down; since g(1) = 1 (because 1 swaps up to 2), we have
n + (n % i == 0 ? i : 0) * -1**(1 + n / i)

where ** denotes exponentiation. The final savings come from rewriting this as
n - i * (n % i == 0 ? -1 : 0)**(n / i)

Dissection
~             # Evaluate input to get n
.,(~%{        # For n-1 downto 1...
  ):i         #   Let i be that value + 1, so for i = n downto 2...
  \.@%!       #   Find n % i == 0 ? 1 : 0
  ~)          #   Negate
  1$i/?       #   Raise to the power of n/i
  i*-         #   Multiply by i and subtract
}/

Seeing as you have the shortest GS and CJam answers, why not also have the shortest Pyth answer? u-G*H^_!%GH/GHrhQ2Q If you don't want to post this yourself, tell me/add it to the CW answer.

@FryAmTheEggman, I may not be very practised at CJam, but I can at least more-or-less read it. I haven't a clue what the Pyth in your comment says, although from context I presume it's a port of this answer. So it's best that you post it, because you can answer questions about it.

CJam, 24 bytes
l~__(,f-{_Imd!~)\#I*-}fI

Online demo
This is a port of my GolfScript answer, borrowing the loop from Martin's CJam answer and exploiting CJam's divmod operator. (I said it would be useful!).

Common Lisp, 113 91
(iterative: 91)
(defun s(n)(do((r n(1- r)))((= r 1)n)(if(= 0(mod n r))(incf n(* r(if(oddp(/ n r))1 -1))))))

(original, recursive: 113)
(defun s(n &optional(r n))(cond((= r 1)n)((= 0(mod n r))(s(+ n(* r(if(oddp(/ n r))1 -1)))(1- r)))(t(s n(1- r)))))

Example
With the recursive version:
(trace s)
(s 10)

  0: (S 10)
    1: (S 20 9)
      2: (S 20 8)
        3: (S 20 7)
          4: (S 20 6)
            5: (S 20 5)
              6: (S 15 4)
                7: (S 15 3)
                  8: (S 18 2)
                    9: (S 20 1)
                    9: S returned 20
         ...
    1: S returned 20
  0: S returned 20

Tests
Checks and measures for iterative version:
(let ((list '(1 4 8 6 12 14 16 9 18 20 24 26 28 22 39 15 36 35 40 38 57 34 48 49 51 44
              46 33 60 77 64 32 75 56 81 68 76 58 100 55 84 111 88 62 125 70 96 91 98 95
              134 72 108 82 141 80 140 92 120 156 124 94 121 52 152 145)))
  (time
   (loop for r in list
         for n from 1
         always (= r (s n)))))

 => T

Evaluation took:
  0.000 seconds of real time
  0.000000 seconds of total run time (0.000000 user, 0.000000 system)
  100.00% CPU
  807,160 processor cycles
  32,768 bytes consed

Haskell, 79 bytes
1#i=i
s#i|i`mod`(2*s)==0=(s-1)#(i-s)|i`mod`s==0=(s-1)#(i+s)|1<2=(s-1)#i
p n=n#n

Usage: p 66 which outputs 145
Not much to explain: The function # recursively calculates the shotgun number at position i of step s. p n returns the number at position n of step n.

Oh, I didn't see your answer before submitting mine. Seems like we have quite different approaches.

k, 41 bytes
{{x+$[y!x;0;$[2!_x%y;y;-y]]}/[x;|2+!x-1]}
 / apply to an int
 {{x+$[y!x;0;$[2!_x%y;y;-y]]}/[x;|2+!x-1]} 42
111
 / apply to 1 through 66
 {{x+$[y!x;0;$[2!_x%y;y;-y]]}/[x;|2+!x-1]}'1+!66
1 4 8 6 12 14 16 9 18 20 24 26 28 22 39 15 36 35 40 38 57 34 48 49 51 44 46 33 60 77 64 32 75 56 81 68 76 58 100 55 84 111 88 62 125 70 96 91 98 95 134 72 108 82 141 80 140 92 120 156 124 94 121 52 152 145

{...} lambda, x and y are the implicit 1st and 2nd argument
$[b;t;f] ternary operator, evaluates b followed by t/f respectively
b!a a modulo b
_ floor, casts the result of the division to an int
% division
{...}/[x;y] prime {...} with x and apply over the list y, is equivalent to f[f[..f[f[x;y0];y1];..yn-1];yn]
| reverse
! iota function, generate list 0 through n-1

Mathematica, 53 49 bytes
(For[i=n=#,n>1,--n,If[n∣i,i+=Mod[i,2n]2-n]];i)&

I decided to golf my reference implementation. The ∣ is the Unicode symbol for "divides", and counts for 3 bytes. Otherwise, this uses the same algorithm as everyone else.
It defines an unnamed function which takes n as a single parameter and returns the nth Shotgun number.

Julia, 61 57 bytes
n->(i=n;while~-i!=0 n+=(n%i<1)*i*(n÷i%2*2-1);i-=1;end;n)

This creates an unnamed function which takes a single argument n and returns the nth shotgun number. To call it, give it a name, e.g. f=n->(...).
Examples:
julia> for i = 1:10 println(f(i)) end
1
4
8
6
12
14
16
9
18
20

Currently this is based on @Sp3000's awesome Python answer. I'll revisit this soon because there must be a shorter way to do this in Julia than what I've done here. Any input is welcome, as always.

CJam, 28 27 byte
So this is slightly embarrassing... before posting this, I tried golfing this myself and got to 30 bytes in CJam. None of the existing answers have beaten that yet. In the meantime I also managed to shave off three more bytes. There is a shorter Pyth solution in a comment, but nothing shorter has been posted in an answer, so here it is. Maybe it inspires the APL/J people to try a bit harder (or someone actually post the Pyth solution), before I have to accept my own answer. ;)
l~__(,f-{_I_+%_+I-_zI=*+}fI

Test it here.
Explanation
l~                          "Read input N and eval.";
  __(,                      "Duplicate twice, create range [0 1 2 ... N-2].";
      f-                    "Subtract each from N, giving [N N-1 N-2 ... 2].";
        {               }fI "For each element, storing the element in I.";
         _I_+%_+I-          "Compute 2(N % 2I)-I - the shuffling offset";
                  _zI=      "Check that this offset is ±I.";
                      *+    "Multiply the offset by this boolean and update to N.";

J, 34 32 bytes
   (]+[*(1-~2*2|%~)*0=|)/@(_1}2+i.)

   ((]+[*(1-~2*2|%~)*0=|)/@(_1}2+i.)) every 1+i.20  NB. running with inputs 1..20
1 4 8 6 12 14 16 9 18 20 24 26 28 22 39 15 36 35 40 38

Will try to golf it a bit more and add some explanation later.
Try it online here.

GML, 76 bytes
n=argument0;i=n;while~-1{n+=(n mod i<1)*i*(n/i mod 2*2-1)i--}show_message(n)

Information about GML

TI-Basic 83/84, 40 bytes
Input A:For(I,A,2,~1:A+(AfPart(I/2)-1)I(1>IfPart(A/I->A:End:A

Information about TI-Basic

Ruby, 57 47 bytes
This is essentially Sp3000's Python solution (with xnor's suggestion) translated to Ruby. I could probably golf it down in a few places though.
->n{n.downto(2).map{|i|n+=i*(n/i%2-~-n/i%2)};n}

Stax, 13 bytes
╠¼│σ╣Gp☺πΩ■φ├

Run and debug it
Same idea as Peter Taylor's answer, and almost the same code.

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