text:
Bob the Bowman!
Bob the Bowman
      o
    /( )\                                         This is Bob.
     L L                                          Bob wants to be an archer.
#############

    .
   / \          <--- bow                          So he bought himself a
  (c -)->       <--- arrow                        nice longbow and is about
  ( )/          <--- highly focused Bob           shoot at a target.
  L L
#############

___________________________________________________________________________________________
sky

                     Bob is a smart guy. He already knows what angle and
                     velocity his arrow has / will have. But only YOU know
                     the distance to the target, so Bob doesn't know if he
                     will hit or miss. This is where you have to help him.

     .                                                                                +-+
    / \                                                                                | |
   (c -)->                                                                              | |
   ( )/                                                                                +++
   L L                                                                                |
###########################################################################################

Task
Your task is to render an ASCII art picture of Bob hitting or missing the target. For the calculation:

Your program will receive arrow_x,angle,velocity,distance as comma-separated input in any order you wish.
One ASCII character equals 1m.
The first character in the last line has the coordinates (0,0), so the ground (rendered as #) is at y=0.
Bob always stands on the ground, his y position does not change.
There is no max y. However, the arrows apex should fit within the rendered picture.
All input is provided as decimal integer.
During calculation, assume the arrow is a point.
The arrow origin is the arrow head > of a shooting Bob (see above). So given arrow_x, you have to calculate arrow_y. The left foot of Bob in the output has to match the x coord. of the shooting Bob.
distance is the x coordinate of the target's foot. (ie. the middle of the target).
All measurements are supplied in meters and degrees respectively.
Attention: The shooting Bob is never rendered, only used for calculations! See below for the two valid output-Bobs
Hitting the target means the arrows path crosses either one of the two leftmost target walls (|) (That is either (distance-1,3) or (distance-1,4). If at some point the arrow is within those 2m², place the X instead of the wall it hits. The target is always the same height and only its x position can change.). Corner hits or an arrow falling from the sky onto the target does not count.
Standard earth g applies (9.81 m/s^2).
distance+1 is the end of the field, after that, everything is a miss and no arrow should be rendered.
If the arrow hits the target in any other way (distance-1 etc.), no arrow should be rendered.

Miss
This is an example rendering of Bob missing (arrow enters ground at 34m, angle is 45°, time in air is 10s, velocity is ~50 - but there are a lot more possible inputs to cause this output. Just show your program uses the usual formulas to calculate physically "accurate" results.):
                                                                                +-+
                                                                                | |
  c\                                                                                | |
/( )                              v                                                     +++
 L L                              |                                                      |
###########################################################################################

Hit
This is an example rendering of Bob scoring (arrow enters target (= crosses its path)):
                                                                                +-+
                                                                                >--X |
 \c/                                                                                | |
 ( )                                                                                +++
 L L                                                                                |
###########################################################################################

Example

arrow_x is 7. arrow_y is always 3.
angle is 30° or 0.523598776 radians.
velocity is 13m/s.
distance is 20.

So in order to hit the target, the arrow has to cross (19,3) or (19,4). Everything else will be a miss. In this case, the arrow will enter the ground (means y will be <1.0) at 12.9358m = ~13m after 1.149s.

Limits & Scoring

This is code-golf, so the shortest solution wins. There are no bonuses.
Your program (as in not function) must accept input in the format described above, additional input is not permitted.
You don't have to handle wrong/pointless/impossible inputs.
Print to whatever is the shortest reasonable output for your language (std, file, ...).
I don't care about trailing whitespace.
Tip: Width of output is distance+2. The height is apex+1.

Can you add the input used to generate the output given please?

Why can't you post a function?

@steveverrill Standard g applies.

Do we have to draw bob? or just the arrow?

@Mhmd You have to draw him, as stated in the task. The left foot of Bob in the output has to match the x coord. of the shooting Bob. and See below for the two valid output-Bobs

And for those of us who haven't taken physics further than GCSE (or have just forgotten?)

@muddyfish Just google for the trajectory equations.

Could you add more test cases input/output.

btw, in the exampe you say: the arrow will enter the ground (means y will be <1.0) shouldn't this be 0?

@Mhmd No, because the ground # is at y=0 and is 1m high.

@minxomat in the example above, it seems that you didn't take into account the initial height y0. Could you please elaborate? I'm getting a result of 18m.

@Mhmd Yes, I messed that up, you're right.

Ruby, 482
include Math
def f s,e,l
[s,' '*(l-s.size-e.size),e].join
end
alias p puts
X,o,V,d=$*[0].split(?,).map &:to_i
o*=PI/180
L=X+d
B='| |'
S=''
G=' L L'
p f S,'+-+',L
d.times{|x|y=3+x*tan(o)-(9.81*x**2)/(2*(V*cos(o))**2)
if x==d-1&&(3..5)===y
s='>--X |'
m=(3..4)===y
p f S,m ?B: s,L
p f ' \c/',m ?s: B,L
p f ' ( )',?+*3,L
p f G,'| ',L
elsif y<=1 || x==d-1
p f S,B,L
p f '  c\\',B,L
print f '/( )', y<1? 'V':' ',x
p f S,?+*3,L-x
print f G, y<1? '|':' ',x
p f S,'| ',L-x
break
end}
p ?#*L

Ungolfed
include Math
def fill s,e,l
   [s,' '*(l-s.size-e.size),e].join
end
arrow_x,angle,velocity,distance = $*[0].split(',').map(&:to_i)
angle *= PI/180
length=arrow_x+distance
loss = '| |'
puts fill '','+-+',length
distance.times { |x|
  y = 3 + x*tan(angle) - (9.81*x**2)/(2*(velocity*cos(angle))**2)
  if x == distance-1 && (3..5)===y
    puts fill '',(3..4)===y ? '| |':'>--X |',length
    puts fill ' \c/',(3..4)===y ? '>--X |':'| |',length
    puts fill ' ( )','+++',length
    puts fill ' L L','| ',length
  elsif y<=1 || x==distance-1
    puts fill '',loss,length
    puts fill '  c\\',loss,length
    print fill '/( )', y<1? 'v': ' ', x
    puts fill '','+++',length-x
    print fill ' L L', y<1? '|': ' ', x
    puts fill '',' | ',length-x
    break
  end
}
puts ?#*length

Method
The main equation here is:

Note: image taken from https://en.wikipedia.org/wiki/Trajectory_of_a_projectile
Where,
y0: initial height (of arrow)
Ө: the angle
x: the position of the arrow
g: gravity (9.81)
v: velocity

What I'm doing is to loop through numbers from 0 to (distance -1) and in every iteration check to see if the arrow hits the ground (or the target)


text:
Break tabs in half

Holy wars have been fought over spaces vs. tabs. (And of course spaces, being
  objectively superior, won.) —Alex A.

Some people still refuse to accept that
which is clearly supreme. You've just received
a file using the incorrect, bad, and inferior form
of whitespace, and now the contents of the file are
tainted and ruined.
You decide you might as well show the person who sent the file to you just how
wrong they are—violently.
Description
As the title suggests, your challenge is to take a file that contains one or
more tabs:
this is an evil tab    onoes

and ruthlessly shatter them into pieces:
this is an evil tab

                     o
                     n
                     o
                     e
                     s

Note that the Stack Exchange software turns literal tabs into four spaces
(because it's right), so tabs within this post will be displayed as four
spaces. The input to your program, however, will contain actual tabs.
Challenge
The solution should take a single string as input, which may contain printable
ASCII, newlines, and tabs. There will always be at least a single tab in the
input.
The output should be the same string, with the following rules applied:

Start the cursor at coordinates (0,0) and with a direction of right. The
coordinates are (column,row), zero-indexed, and the direction is which way
you should move the cursor after printing a character.
For each character in the string:

If it's a newline, move to coordinates (0,n), where n is the number of
newlines in the string so far (including this one), and reset the
direction to right.
If it's a tab, output two spaces, rotate the cursor direction 90 degrees
clockwise, and output two more spaces, effectively "breaking" the tab in
half. Here's a visual example, where a tab is represented as ---> and
spaces as ·:
foo--->bar--->baz

becomes
foo···
     ·
     b
     a
     r
     ·
     ·
 zab··

Otherwise, simply output the character at the cursor and move the cursor
one step in the current direction.

Since you are reading the string from start to end, it is possible that you
will have to write "on top" of existing characters—this is okay. For example,
the input
foo--->bar

spaces are superior

should result in an output of
foo

     b
spaces are superior
     r

You may choose whether "broken tabs" should overwrite other characters—the original intention was that they do not, but the spec was ambiguous, so this is your decision.
Furthermore, after applying these rules, you may also

add or remove as many trailing spaces as you would like.
add a maximum of a single trailing newline.

The input will never contain trailing spaces; it will also never contain
leading or trailing newlines. You may also always assume that you will never
need to write to a column or a row less than 0 (i.e. off the screen).
Test case
Tabs in this test case are represented as ---> because otherwise SE gobbles
them up.
Input:
Test case. Here's a tab--->there's a tab--->everywhere a tab--->tab--->this is some more text
blah
blah
blah blah blah blah blah blah--->blaah--->blaah--->blah--->blaaaaah--->blah--->blah--->blah--->blah--->blah

Output:
Test case. Here's a tab
blah
blah                     t
blah blah blah blah blah blah
                        blaablah
                         r     b
                         e     l  b
                      h  'h    a  l
                      a  sa    a  a
                      l   l    h  h
       this is some mobe tbxt

                         haalhalb
     b                   a
     a                   b
     t

        bat a erehwyreve

Fancy animation:

Rules

This is code-golf, so the shortest code in bytes will win!

When you say the cursor has to start at (0,0) do you mean we need to clear the console first, or do you just mean the default position of the cursor by that?

I'm voting to close this question as off-topic because it is full of hatred and blasphemy.

Your animation looks so much like the ><> interpreter that I now want to see a self-modifying ><> entry.

I liked the hidden message in the opening paragraph but I have to disagree.

@MartinBüttner That just means the default position.

What are the requirements if the cursor is going backwards or upwards and the bit of text is longer than there is space for before the first row or column is reached. For example the string this<tab>is a<tab>problematic<tab>string!! would not only go into negative columns, but also negative rows.

@TomCarpenter I already addressed that at the end of the Challenge section: "You may also always assume that you will never need to write to a column or a row less than 0 (i.e. off the screen)."

@Doorknob I missed that bit. ;)

MATLAB, 144 bytes
The weapon of choice for dealing with strings is of course a language designed for manipulating numbers [citation needed]. Kidding aside, the great thing about Matlab is that it doesn't care if you assign to an array 'out of bounds': it will simply make a larger matrix. Furthermore, the default matrix element, 0, is rendered as a space instead of a null character the ASCII spec prescribes.
Tabs are simply a jump in coordinates, so no spaces are outputted for a tab.
function o=q(t)
u=2;v=0;x=1;y=1;n=1;for s=t
if s==9 x=x+u-v;y=y+v+u;a=v;v=u;u=-a;elseif s<11
n=n+1;x=1;y=n;else
o(y,x)=s;x=x+u/2;y=y+v/2;end
end

I started out with 209 bytes, but some more careful golfing got rid of most of that; there's a lot of repetition in this code, so I did some trial-and-error which alternatives worked best. I don't think there's much space for more optimization with this code, but I'm always happy to be proven wrong. Edit: Tom Carpenter managed to prove me wrong; he managed to save 9 bytes which I optimized to save a whopping 29 bytes. Last byte saved by assuming there are no control characters (ASCII < 9) in the input - MATLAB strings aren't null-terminated.

Doesn't appear to work. I tried this q('hello<tab>my name<tab>is tom<tab>c'), but it something along the lines of Attempted to access o(11,-2); on line 7. Though this may be more to do with an issue in the question - if the cursor is heading backwards and goes beyond the first column what happens to the rest of the line.

Yep, my bad I missed that bit. I'll go away now ;)

You can save another 9 characters by removing the d variable and instead having 4 variables which for a loop to make the [1 0 -1 0] pattern as such: function o=q(t) u=1;v=0;w=-1;z=0;x=0;y=1;n=1;for s=t if s==9 x=x+2*u-2*v;y=y+2*v+2*u;a=z;z=w;w=v;v=u;u=a;elseif s==10 n=n+1;x=0;y=n;else x=x+u;y=y+v;o(y,x)=s;end end  (obviously being in the comments it removed all the lines, so you'll have to reformat it like yours to see what I did)

@TomCarpenter That's... really ugly. I love it.

Python 3, 272 270 266 262 255 253 244 bytes
I=[]
try:
 while 1:I+=[input()]
except:r=m=0
M=sum(map(len,I))
O=[M*[' ']for _ in[0]*M]
for l in I:
 x=b=0;y=r;a=1;r+=1
 for c in l:
  if'\t'==c:a,b=-b,a;x+=a+2*b;y+=b-2*a
  else:O[y][x]=c
  x+=a;y+=b;m=max(m,y)
for l in O[:m+1]:print(*l,sep='')

The \t should be an actual tab character.
The code works somewhat like Zach Gates' answer, first generating a M by M grid where M is the sum of the lengths of the lines. (That's a huge amount of excess, but makes the code shorter.) It then loops through the characters, placing them in the correct spots, keeping track of the bottommost visited row. Finally, it prints all the lines up to that row.
The output contains (usually a huge amount of) trailing spaces and 1 trailing newline.

Javascript (ES6), 264 245 bytes
Tried the "create a giant grid of spaces, fill and trim" approach, which ended up 19 bytes shorter than the other.
a=t=>(o=`${' '.repeat(l=t.length)}
`.repeat(l).split`
`.map(q=>q.split``),d=x=y=z=0,s=c=>o[d>2?y--:d==1?y++:y][d?d==2?x--:x:x++]=c,[...t].map(c=>c=='\t'?(s` `,s` `,++d,d%=4,s` `,s` `):c==`
`?(x=d=0,y=++z):s(c)),o.map(p=>p.join``).join`
`.trim())

By modifying the second-to-last line like so, you can remove the large amount of trailing spaces on every line:
...o.map(p=>p.join``.trimRight())...

Try it here:

a=t=>(o=`${' '.repeat(l=t.length)}
`.repeat(l).split`
`.map(q=>q.split``),d=x=y=z=0,s=c=>o[d>2?y--:d==1?y++:y][d?d==2?x--:x:x++]=c,[...t].map(c=>c=='\t'?(s` `,s` `,++d,d%=4,s` `,s` `):c==`
`?(x=d=0,y=++z):s(c)),o.map(p=>p.join``.trimRight()).join`
`.trim())

function submit(){ O.innerHTML = a(P.value.replace(/\\t|-+>/g,'\t')); }

Input: (Use \t or ---> for a tab.)

<textarea id=P rows="10" cols="40">this is an evil tab\tonoes</textarea>

<button onclick="submit()">Try it!</button>

Output: (Looks best in full-page mode.)

Explanation coming soon; suggestions welcome!

JavaScript (ES6), 180 183
Using template strings, there are some newlines that are significant and counted.
That's a function returning the requested output (padded with tons of trailing spaces)
There is little to explain: the rows are builded as neeeded. There is not a direction variable, just the 2 offset for x and y, as in clockwise rotation they are easily managed: dx <= -dy, dy <= dx
Test running the snippet below in Firefox

f=s=>[...s].map(c=>c<`
`?(x+=2*(d-e),y+=2*(e+d),[d,e]=[-e,d]):c<' '?(y=++r,e=x=0,d=1):(t=[...(o[y]||'')+' '.repeat(x)],t[x]=c,o[y]=t.join``,x+=d,y+=e),o=[r=x=y=e=0],d=1)&&o.join`
`

// TEST

// Avoid evil tabs even in this source
O.innerHTML = f(`Test case. Here's a tab--->there's a tab--->everywhere a tab--->tab--->this is some more text
blah
blah
blah blah blah blah blah blah--->blaah--->blaah--->blah--->blaaaaah--->blah--->blah--->blah--->blah--->blah`
 .replace(/--->/g,'\t'))

I wish all languages had [x,y]=[expr1,expr2]...

Python 2, 370 369 368 bytes
Thanks to @sanchises and @edc65 for saving me a byte each.
J=''.join
u=raw_input().replace('\t','  \t  ')
w=u[:]
G=range(len(u))
d,r=0,[[' 'for _ in G]for _ in G]
u=u.split('\n')
for t in G:
 x,y=0,0+t
 for c in u[t]:
  if c=='\t':d=(d+1)%4
  if c!='\t':
   if c.strip():r[y][x]=c
   if d<1:x+=1
   if d==1:y+=1
   if d==2:x-=1
   if d>2:y-=1
r=r[:max(i for i,n in enumerate(r)if J(n).strip())+1]
for i in r:print J(i).rstrip()

It generates the largest grid possible and then loops around, character by character, switching direction at each tab.

Hint: if !d and if d>2

!d is not valid syntax. @sanchises Thanks for the d>2 tip, though.

Sorry, I don't actually know python :) Just sort of assumed it would work like that.

I too don't understand python, but if d in 0...3, d==0 -> d<1

Yep, you're right. Thanks for the byte. @edc65

source: Stack Exchange

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

sort: votes


text:
The FizzBuzz-ish String matcher
Say that you have a string like this:
abaabbbbbaabba
Count the number of times that a specified character appears in the input string, but only if the character appears only once in a row. For example, if the character is a,
abaabbbbbaabba
^ x      x   ^

The total would be 2 (the aa's wouldn't count because the a appears two times in a row).
How is this related to FizzBuzz?
If the character appears 3 (or a multiple of 3) times in a row, or 5 (or a multiple of 5) times in a row, the counter is decremented instead. If it is a multiple of both 3 and 5 times, the counter is still incremented. Remember that the counter is also incremented if the character appears only once in a row, and it is ignored if the character appears any other number of times in a row (besides the situations described above).
To recap, if the string to match is a,
input            counter (explanation)

a                 1 (single occurence)
aaa               -1(multiple of 3)
aaaaa             -1(multiple of 5)
aaaaaaaaaaaaaaa   1 (multiple of 15)
aa                0 (none of the above)

aba               2 (two single instances)
aaba              1 (one single occurence(+1) and one double occurence(ignored))
aaaba             0 (one single occurence(+1) and one triple (-1)
aaaaaa            -1 (six is a multiple of three)

Reference (ungolfed) implementation in java:
import java.util.Scanner;
import java.util.regex.*;

public class StrMatcher {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in); //Scanner to get user input
        int total = 0;//Running total of matches

        System.out.println("Enter a string: ");
        String strBeingSearched = sc.nextLine(); //String that will be searched

        System.out.println("Enter string to match with: ");
        String strBeingMatched = sc.nextLine(); //Substring used for searching

        //Simple regex matcher
        Pattern pattern = Pattern.compile("(" + strBeingMatched + ")+");
        Matcher matcher = pattern.matcher(strBeingSearched);

        while(matcher.find()){  //While there are still matches

            int length = matcher.end() - matcher.start();
            int numberOfTimes = length/strBeingMatched.length();//Calculate how many times in a row the string is matched

            if((numberOfTimes == 1)||((numberOfTimes % 3 == 0) && (numberOfTimes % 5 == 0))){
                total++; //Increment counter if single match or divisible by 15
            } else if((numberOfTimes % 3 == 0)||(numberOfTimes % 5 == 0)) {
                total--; //Decrement counter if divisible by 3 or 5 (but not 15)
            }

            strBeingSearched = strBeingSearched.substring(matcher.end());
            matcher = pattern.matcher(strBeingSearched); //Replace string/matcher and repeat
        }

        System.out.println(total);
    }
}

The string that will be searched can be any length, but the pattern will only be a single character.
Neither string will have regex special characters.
This is code-golf; shortest program in bytes wins.
No standard loopholes.

It would be useful if you could provide a few more test examples. Particularly ones where the sequence has more than one letter.

I added a few cases- hopefully that helps. Tell me if I need more cases- it's my first time in PPCG.

I'll change the requirements so that the sequence is only a single character, as the implementation is pretty much the same, but less confusing.

This is like the 1-sparse question but with the FizzBuzz addition

Funciton, 1840 bytes
Damn, this language is ungolfable.
This program expects the first character of the input to be the character to search for, and the rest of the input to make the string to search through. This means that aaaba will search for a in the input aaba (and thus output 1). You can separate them with a newline or space (a aaba) but only because the extra newline/space makes no difference to the output.
As always, you can get a nicer-looking rendering (without the line spacing) if you execute $('pre').css('line-height',1) in your browser console.
      ┌───┐
      │╓─╖└─────────────┐
      └╢³╟┐    ┌─────┐ ┌┴┐╓─╖
┌─────┐╙─╜└────┤┌─╖ ┌┴╖│┌┘║¹║
│     ├───────┐└┤²╟─┤·╟┘│ ╙┬╜╔═══════╗
│    ┌┴╖╔═╗┌─╖├┐╘╤╝ ╘╤╝┌┘  └┬╢2097151║
│    │♭║║5╟┤%╟┘└─┴──┐│┌┘┌───┘╚═══════╝
│    ╘╤╝╚═╝╘╤╝╔═╗┌─╖│││┌┴┐┌────┐
│    ┌┴╖   ┌┘ ║3╟┤%╟┘││└┬┘│╔══╗└┐
│  ┌─┤·╟─┐ │  ╚═╝╘╤╝ │└┐  │║21╟┐│
│  │ ╘╤╝ ├─┘┌─────┘  └┐└┐ │╚══╝│└─┐
│ ┌┴╖┌┴╖┌┴╖┌┴╖┌─╖    ┌┴╖│ │┌─╖┌┴─╖│
│┌┤·╟┤?╟┤?╟┤?╟┤+╟────┤³║│ └┤²╟┤>>║└──┐
││╘╤╝╘╤╝╘╤╝╘╤╝╘╤╝    ╘╤╝│  ╘╤╝╘╤═╝╓─╖│
││ │ ┌┴╖┌┴╖┌┴╖┌┴╖╔═╗ ┌┴╖│  ┌┴╖ ├──╢²╟┤
││ └─┤·╟┤·╟┤?╟┤·╟╢1║┌┤·╟┘  │♯║┌┴╖ ╙─╜│
│└──┐╘╤╝╘╤╝╘╤╝╘╤╝╚═╝│╘╤╝   ╘╤╝│¹║┌───┘
└──┐│╔╧╗ └┬─┘ ┌┴╖   │┌┴─╖   │ ╘╤╝│
   ││║1║ ┌┴┐┌─┤?╟───┴┤>>╟┐ ┌┴╖┌┴╖│
   ││╚═╝ └┬┘│ ╘╤╝    ╘══╝│┌┤?╟┤=║│
   │└────┐│╔╧╗     ┌─────┘│╘╤╝╘╤╝│
╔═╗└────┐│├╢0║╔══╗┌┴╖┌─╖ ╔╧╗   └─┘
║ ║     │└┘╚═╝║21╟┤×╟┤♯╟┐║0║
╚╤╝     └──┐  ╚══╝╘═╝╘═╝│╚═╝
 │┌──┴────╖└────────────┘
 ││int→str║
 │╘══╤════╝
┌┴─╖┌┴╖┌─╖╔╗
│>>╟┤³╟┤¹╟╢║
╘═╤╝╘═╝╘═╝╚╝
╔═╧╗
║21║
╚══╝

(1840 bytes when encoded as UTF-16.)
Explanation

¹ returns the first character of a string.
² counts the number of occurrences of a character at the start of a given string. For example, given the character a and the string aaba, it returns 2. For a and baa, it returns 0.
³ calls ² to get the number of characters at the start, examines whether the number is divisible by 3 and 5 and whether it is equal to 1 and determines the proper increment/decrement. It also removes one extra character from the start of the string (e.g. given aaabba it removes 3+1=4 characters, giving ba). Then it calls itself recursively with the shorter string and adds the result.
The main program calls ¹ to remove the first character from the input and calls ³ with that character and the rest of the string as separate arguments.

I will never not upvote Funciton.

CJam, 40 36 35 32 30 bytes
0llcf=e`::*{(_g+Y13515Yb+=(+}/

Thanks to @MartinBüttner for golfing off 1 byte!
Thanks to @AndreaBiondo for golfing off 2 bytes and paving the way for 3 more!
Try it online in the CJam interpreter.
How it works
0          e# Push a 0 (accumulator).
l          e# Read a line from STDIN.
lc         e# Read a second line and keep only the first character.
f=         e# Check each character from the first line for equality.
           e# This results in 1 for the specified character and 0 for others.
e`         e# Perform run-length encoding.
::*        e# Multiply each element by its number of repetitions.
{          e# For each remaining integer I:
  (_!      e#   Subtract 1, copy and push sign(I-1).
  +        e#   Add the results.
           e#     If I == 0, I-1 + sign(I-1) =  -1 + -1 = -2.
           e#     If I == 1, I-1 + sign(I-1) =   0 +  0 =  0.
           e#     If I >= 2, I-1 + sign(I-1) = I-1 +  1 =  I.
  Y        e#   Push 2.
  13515Yb  e#   Convert 13515 into the array of its binary digits.
  +        e#   Concatenate 2 and the array.
           e#   This pushes [2 1 1 0 1 0 0 1 1 0 0 1 0 1 1].
  =        e#   Retrieve the digit at (index I-1 + sign(I-1))%15.
           e#     If I == 0, this pushes 1.
           e#     Else, if I == 1, this pushes 2.
           e#     Else, if I%15 == 0, this pushes 2.
           e#     Else, if I%3==0 or I%5==0, this pushes 0.
           e#     Else, this pushes 1.
  (        e#   Decrement the result.
  +        e#   Add it to the accumulator.
}/         e#

You can save another 2 bytes with a base-encoded lookup table and modular indexing: llcf=e`::*0-{(_!\6563282Zb:(=}%1b is 33 bytes.

@AndreaBiondo That actually saved 3 bytes. Thanks!

C, 160 126 125 119 114 109 104 100 bytes
main(int q,char **z){int i=0,t=0,s=0,a=z[1][0],c;do{if((c=z[2][i])!=a){s+=(!!t)*((t==1)-!(t%3)-!(t%5)+3*!(t%15));t=0;}else{++t;}++i;}while(c);printf("%d\n",s);}

Probably can be made better...
This takes input from command line arguments (first argument is pattern, second is string). Does not support searching for pattern of NULL char (\x00).
EDIT **126 125 119 114 109 104 100 bytes **: After incorporating Dennis's suggestions, and some additional ideas (removed else clause, combined the while into one single statement and used subtraction instead of !=). Also removed extra semicolon in for loop (that was actually part of Dennis's suggestion).
Shortened even more by removing the variables 'i' and 'a'.
t,s;main(c,z)char**z;{for(;c;t++)if((c=*z[2]++)-*z[1])s+=!!t*((t<2)-!(t%3)-!(t%5)+3*!(t%15)),t=-1;printf("%d",s);}

Removed the if and negation ('!') operators by abusing the ternary operator.
Compressed the modularity checks by using that bitwise 'AND' trick a double && because bitwise '&' has a bug, and putting the (t<2) comparison inside the ternary operators.
Replaced !!t * (...) by moving !!t into the ternary operator, thus allowing me to remove parentheses.
Man, I really want to get it below the 100 byte mark :S
t,s;main(c,z)char**z;{for(;c;)(c=*z[2]++)-*z[1]?s+=t%15?t%3&&t%5?t<2:-1:!!t,t=0:t++;printf("%d",s);}

TENTATIVE solutions:
I am not sure if these would be considered valid, but I can get down to 93 chars if I use exit(s) instead of printf("%d",s). But then the output would not be visible, rather it would be a return code.
If output is really necessary, I can also get it down to 98 bytes, but it would require printing all intermediate values of s before the final answer as well...

Welcome to Programming Puzzles & Code Golf! I haven't tested it thoroughly, but i,t,s,a;main(c,z)char**z;{a=*z[1];while(c){if((c=z[2][i])!=a)s+=(!!t)*((t<2)-!(t%3)-!(t%5)+3*!(t%15)),t=0;else++t;++i;}printf("%d",s);} should work just as well (and it's 23 bytes shorter).

Oh, nice thing with turning the if () { } clause into one statement!

A few more bytes: If you start main with for(a=*z[1];c;i++), you don't need the {} around the if...else.

Ruby, 111 103 96 bytes
->s,m{s.chars.chunk{|x|x}.reduce(0){|x,(c,g)|l=g.size
x+(c!=m ?0:l<2||l%15<1?1:l%3*l%5<1?-1:0)}}

This challenge was made for Ruby's Enumerable#chunk, so I had to post this. :)
Online test: http://ideone.com/pG4mAn
The code is pretty much straightforward. Here's a more readable version: http://ideone.com/ub3siA.

Python 3, 361, 300, 296, 263, 256, 237, 229, 188, 178, 164  bytes.
Saved 15 bytes thanks to vaultah from SOPython.
Saved 9 bytes thanks to Joe Kington from SOPython.
Saved 11 bytes thanks to DSM from SOPython.
This is my first time submitting an answer, so I'm sure this could be much shorter. It takes the test string as the first response to input, and the search char as the second one.
t=input()
m=input()
c=u=0
g=iter(t)
while g:
 r=next(g,0)
 if r==0:print(c);g=0
 while r==m:u+=1;r=next(g,0)
 if u:b=u%3<1;v=u%5<1;c+=((0,-1)[b|v],1)[u<2or b&v];u=0

Ungolfed version:
import sys
test = sys.argv[1]
match_char = sys.argv[2]
counter = char_counter = 0
char_generator = (c for c in test)
while char_generator:
    try:
        char = next(char_generator)
    except StopIteration:
        print(counter)
        break
    while char == match_char:
        char_counter += 1
        try:
            char = next(char_generator)
        except StopIteration:
            break
    if char_counter == 0:
        continue
    counter += 1 if char_counter == 1 or (char_counter % 3 == 0 and char_counter % 5 == 0) else -1 if char_counter % 3 == 0 or char_counter % 5 == 0 else 0
    char_counter = 0

Discovered I was failing one of the test cases.

Java, 146 152 143 138 139 136 bytes

Fixed a bug.
shifted operations, switched to bitwise operator for the %3&%5 checks.
Shortened i<2 comparison.
Fixed a bug (%3&%5 check not working as thought).
Used multiplication shortcut as seen in @w0lf's Ruby answer.

Implemented as a BiFunction<String, String, Integer> in Java 8, let me know if this is required to be a full program (or if I can even drop the java.util.regex package prefix below).
Byte count above does not include the newline below, which is simply added for formatting purposes on this site.
(a,b)->java.util.regex.Pattern.compile("[^"+b+"]").splitAsStream(a)
.mapToInt(v->v.length()).map(i->i<2?i:i%15<1?1:i%3*i%5<1?-1:0).sum();

Rough explanation:

Apply regex with pattern that does not match b, i.e. "[^"+b+"]".
Get length of each token (e.g. "a" -> 1).
Apply the desired mapping to -1, 0 and 1.
sum() to get answer.

Haskell, 120 bytes
import Data.List
f c=sum.map(v.length).filter((==c).head).group
v 1=1
v n|n%3&&n%5=1|(n%3||n%5)=(-1)|0<1=0
x%y=x`mod`y<1

f does the job.

Javascript, 206 bytes
function f(n,e){var t=n.match(new RegExp(e,"g")).length,g=n.match(new RegExp(e+"{2,}","g"));return null!==g&&g.forEach(function(n){t-=n.length,n.length%15==0?t+=1:(n.length%3==0||n.length%5==0)&&(t-=1)}),t}

Expanded:
function funkyFizzb(n, c) {
    var score = n.match(new RegExp(c, "g")).length;
    var repeatOccurence = n.match(new RegExp(c + "{2,}", "g"));

    if(repeatOccurence !== null) {
        repeatOccurence.forEach(function(v,i){
            // remove multiple occurrence counts
            score -= v.length;

            if(v.length % 15 == 0) {
                score += 1;
            }

            else if(v.length % 3 == 0 || v.length % 5 == 0) {
                score -= 1;
            }
        });
    }

    return score;
};

Explanation:
I'm using regex to count total times a character appears, then subtract from that all the times it appeared in groups. Finally, I go through the groups and do the fizz buzz increment / decrement.
Passes the test cases given in the question:
funkyFizzb("aaa", "a") => -1

and so on

Remove the new, use exec instead of match, and alias length, and you should be good.

Perl, 82 65 63 59 bytes
58 bytes + 1 byte command line parameter
Not particularly short, but it's a start - will continue shortening it.
$l=y///c,$i+=!($l>1&&$l%15)||-!($l%3*$l%5)for/$^I+/g;$_=$i

Assuming -i can be used to give the input string an example usage is as follows:
echo "aaabaaa" | perl -pi"a" entry.pl

Pyth, 32 bytes
so close! 2 more bytes to tie Dennis' excellent CJam entry
s.b?qYz?tN@+,0_1 1+}3PN}5PN1Zrw8

Test it Online

gawk, 140
p=$2{b="[^"$1"]";for($0=2;$i-->0;){sub("^"b"*",_,p);p=substr(p,$++i=match(p,b))}for($i=length(p);$++j;)s+=$j%5?$j%3?$j<2:-1:$j%3?-1:1}$0=s""

Input as "char space string", like so
echo "x axxbxcxdexxxfffghixxj" | awk 'p=$2{b="[^"$1"]";for($0=2;$i-->0;){sub("^"b"*",_,p);p=substr(p,$++i=match(p,b))}for($i=length(p);$++j;)s+=$j%5?$j%3?$j<2:-1:$j%3?-1:1}$0=s""'

Ungolfed
p=$2{
    #i=j=s=0                # make reusable
    b="[^"$1"]";           # pattern "not matching char"
    $0=2;                  # help starting the while loop
    while($i-->0){         # match didn't return -1; dec stack top
        sub("^"b"*",_,p);  # remove not matching chars at head of string
        $++i=match(p,b);   # push index of first occurence of not matching char
        p=substr(p,$i)     # remove matching chars from head of string
    };
    $i=length(p);          # get last value
    while($++j)            # sometimes last value on stack is 0
        s+=$j%5?$j%3?$j<2:-1:$j%3?-1:1

        # if $j%5!=0
        #   if $j%3!=0     (not divisible by 5 AND 3)
        #     s+=($j==1)   (single character)
        #   else           (divisible by 3 but not by 5)
        #     s-=1
        # else             (divisble by 5)
        #   if $j%3!=0
        #     s-=1         (divisible by 5 but not by 3)
        #   else
        #     s+=1         (divisible by 3 AND 5)

}$0=s"" # output

Pyth, 27 bytes
sm|!JPdx,02+}3J}5JhMf}zTrw8

Test suite
Input in the form e.g.:
a
aaaba

Explanation:
sm|!JPdx,02+}3J}5JhMf}zTrw8
                               z = input() (The match character)
                         w     input() (The string)
                        r 8    Run length encode
                    f}zT       Filter for the runs z is in.
                  hM           Take their lengths
 m|                            Map (d) to the logical or of
    Pd                         Find all prime factors of the current run length
   J                           Save them in J
  !                            Take the logical negation. This will be 1 if
                               d is 1, and 0 otherwise.
           +}3J                If d wasn't 1, add up 1 if 3 is in J
               }5J             and 1 if 5 is in J.
       x,02                    Then, take the index of the result in [0,2]
                               so 0 -> 0, 2 -> 1, 1 -> -1 (not found)
s                              Sum up the values for each run.

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


text:
Isn't the point of math to just use numbers?
Write a program that converts a mathematical expression to words, evaluates the expression, and prints how the equation would be spoken aloud.
Input

The input must only contain numbers and the symbols +, -, *, and /. There cannot be any whitespace in the input.
The input does not say what the expression is equal to.

Output

While order of operations must be followed in determining the numerical answer in the expression, it is not necessary to indicate this in the output (for this reason, the input cannot contain parentheses).
Numbers must be printed in capital letters. Operations must be printed in lower case.
Numbers must be printed in the order that they appear in the input. Then the word equals must be printed, then the answer.
Numbers in the output can be negative. The word negative is written in capital letters.
Operations and numbers must be separated by a space. There cannot be any space after the last letter is printed.
+ in the input gets converted to plus in the output. - in the input gets converted to minus in the output. * in the input gets converted to times in the output. / in the input gets converted to divided by in the output.
Division by 0 is not allowed.
When division results in a decimal, the number should be rounded to three decimal places and read X POINT X X X where the Xs are replaced by numbers.
Negative numbers should have `NEGATIVE in front of them.
For simplicity, all numbers must have absolute value less than 1000.
0 is ZERO (not NOUGHT, OH, etc).

Samples
Inputs
1+2
2-3
6*2-4/1
1+1-1*1/1
2/3
413-621

Outputs
ONE plus TWO equals THREE
TWO minus THREE equals NEGATIVE ONE
SIX times TWO minus FOUR divided by ONE equals EIGHT
ONE plus ONE minus ONE times ONE divided by ONE equals ONE
TWO divided by THREE equals ZERO POINT SIX SIX SEVEN
FOUR HUNDRED THIRTEEN minus SIX HUNDRED TWENTY-ONE equals NEGATIVE TWO HUNDRED EIGHT

This is code golf, fellas. Standard CG rules apply. Shortest code in bytes wins.

Is there a limit to the size of the numbers?  Are decimals to be handled and if so to what precision?

How do you get TWO for the last example? I get 1+1-1*1/1=1

@MickyT Updated.

@Geobits I am quite sure that the question never has, and never will think that 1+1-1*1/1=2 (sorry, I wasn't paying attention when I wrote that).

Is trailing whitespace allowed?

Also, do we have to handle numbers greater than 9? How do we output those? ONE NINE or NINETEEN? What is the maximum number we will have to handle?

NINETEEN should be used. Numbers must have absolute value less than 1000. Rules have been updated.

@Eridan I think it's to late to update. That's probably invalidated every answer

@Eridan this send all the previous answers (specially mine :P) to /dev/null

Are ONE divided by TWO equals ZERO POINT FIVE HUNDRED and ONE divided by THREE equals ZERO POINT THREE HUNDRED THIRTY-THREE valid answers?

I didn't specify the conditions well enough. At this point I'm tempted to just let you interpret the conditions as is. Sorry for not being specific enough.

JavaScript ES6, 255 247 237 225 219 bytes
s=>(s+'='+ +eval(s).toFixed(3))[h=(a,b,l)=>' '+[a,...btoa(b).split`z`][l],t='replace'](/\D/g,l=>h('divided by',`¶)³:eºÌæ{¬Íê®j[3¦§·<`,'*+-/=.'.indexOf(l)))[t](/\d/g,l=>h('ZERO',`8Ñ3Mc³LtD1NQÅ!Q3HóHED71tó4D`,l))

I'll resume golfing tomorrow. Gotta sleep :/
Base encoding may cause issues. If it does, I'll add a pastebin and possibly a hex dump.
If you find any issues (or the spec changes) don't hesitate to tell me, I'll fix it as soon as possible.
Explanation
s=>     // Function with argument "s"
 (s+'='                  // Add an equal sign to the input
   + +eval(s).toFixed(3)    // Add the value of the expression rounded to 3 places
 )[h=(a,b,l)=>           // Function h with args a,b, and l
                         // Return...
     ' '+                    // A space added to...
     [a,...btoa(b).split`z`] // Base decode the compressed words
     [l]                     // Grab the correct word
  ,t='replace'            // Alias replace command

 ](/\D/g,                // Replace non-digits with...
    l=>h(                                   // Function h
       'divided by',`¶)³:eºÌæ{¬Íê®j[3¦§·<`, // Base encoded words
       '*+-/=.'.indexOf(l)                  // Replace operator with correct word
    )

 )[t](                             // Replace again
    /\d/g,l=>                      // Replaces Digits with...
      h('ZERO',`8Ñ3Mc³LtD1NQÅ!Q3HóHED71tó4D` // Base encoded words
        ,l                                   // The associated number
      )
 )

Pyth, 170 143 141 bytes
jdm@c"ZERO,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,plus,minus,times,divided by,POINT,equals"\,x+jkm`kUT"+-*/.="d++z\=?q>2J`.Rvz3".0"<2JJ

Evaluates the input and if it ends with ".0", strips it. Then loops through a list with the numbers, then looks with their word representation.

You could generate the dict with .d,V+jkUT"+-*/.="c"ZERO,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,plus,-minus,times,divided by,POINT,equals"\,

But using dicts in Pyth golfing is usually a bad sign. There's almost always a better way.

For instance you could replace @$dict$d with: @(List of names)x(String with symbols)d

What happened to NEGATIVE and TEEN?

See @ vihan's comment http://codegolf.stackexchange.com/questions/58368/isnt-the-point-of-math-to-just-use-numbers/58389?noredirect=1#comment140601_58368, already posted when changed

Python 3, 268 224bytes
a=input()
o=eval(a)
print(*[{i:j for i,j in zip('*+-./=1234567890','times,plus,minus,POINT,divided by,equals,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,ZERO'.split(','))}[i] for i in a+'='+('%.'+str(3*(int(o)!=o))+'f')%o])

A dictionary lookup for each item assuming numbers are only evaluated between 0-9. Would appreciate some feedback on this.
Explanation:
The following formats the output string with the required decimals based on the fact that in python integers evaluate as equal to the equivalent float. e.g. 1.0 == 1 Which I use to identify integer numbers.
('%.'+str(3*(int(o)!=o))+'f')%o
('%.0f')%o if o is an integer
('%.3f')%o if o is a decimal

edit: Dictionary generators!

13+468-1966 returns ONE THREE plus FOUR SIX EIGHT minus ONE NINE SIX SIX equals minus ONE FOUR EIGHT FIVE instead of THIRTEEN plus FOUR HUNDRED SIXTY-EIGHT minus ONE THOUSAND NINE HUNDRED SIXTY-SIX equals NEGATIVE ONE THOUSAND FOUR HUNDRED EIGHTY-FIVE

Yeah... The rules changed overnight... Probably adds quite a few bytes regardless.

Python 2, 281 223 221 219 + 5 bytes
run with: "python -Qnew golf.py" to enable float divisions
a=raw_input()
print" ".join("ZERO%ONE%TWO%THREE%FOUR%FIVE%SIX%SEVEN%EIGHT%NINE%NEGATIVE%times%plus%equals%minus%POINT%divided by".split("%")[ord(i)-48]for i in a+','+("%.3f"%eval(a)).replace("-",")").replace(".000",""))

4 bytes off thanks to Zach Gates

You can remove the spaces around your modulo operator. It saves 2 bytes.

You can also remove the r (that makes it a raw string) from in front of your (\d+) regex string. And the first and last bracket inside the " ".join, because you can pass the iterable as an argument.

changed a lot before reading your comment :P

What about the teens?

The OP changed the rules after the game has started... to spell the numbers in english words is another CG!

Python 2, 628 + 5 bytes
run with: "python -Qnew golf.py" to enable float divisions
this one should spell correctly the numbers
import re
a=raw_input()
d,x="ZERO%ONE%TWO%THREE%FOUR%FIVE%SIX%SEVEN%EIGHT%NINE%TEN%ELEVEN%TWELVE%THIR%FOUR%FIF%SIX%SEVEN%EIGH%NINE%TWENTY%THIRTY%FORTY%FIFTY%SIXTY%SEVENTY%EIGHTY%NINETY%NEGATIVE%times%plus%equals%minus%POINT%divided by".split("%"),[]
for i in re.split("([.),/*+-])",a+','+("%.3f"%eval(a)).replace("-",")").rstrip('0').rstrip('.')):
    r=""
    if len(i)>2:
        x+=[d[int(i)//100],"HUNDRED"];i=i[1:].lstrip("0")
    if len(i)>1:
        z=int(i)
        if z<20:r+=d[z]+["","TEEN"][z>12];i=""
        else:r+=d[z//10+18]+["-",""][i[1]<"1"];i=i[1].strip("0")
    if i:
        c=d[ord(i)-48]
        if i<"0":x+=[c]
        else:r+=c
    if r:x+=[r]
print" ".join(x)

Test
1+2
ONE plus TWO equals THREE
2-3
TWO minus THREE equals NEGATIVE ONE
6*2-4/1
SIX times TWO minus FOUR divided by ONE equals EIGHT
1+1-1*1/1
ONE plus ONE minus ONE times ONE divided by ONE equals ONE
2/3
TWO divided by THREE equals ZERO POINT SIX HUNDRED SIXTY-SEVEN
413-621
FOUR HUNDRED THIRTEEN minus SIX HUNDRED TWENTY-ONE equals NEGATIVE TWO HUNDRED EIGHTEEN


text:
Time to adjust some prices!
I'm sure you know about the $9.99 price scheme, instead of using $10. Well, in your new job as a sys admin at a large retail store, they want prices to adhere to a similar scheme:

All prices are in whole dollars, no cents.
All prices should end with 5 or 9, rounding to the closest but up if the last digit is right between 5 and 9. (Applies to last digit 2 and 7)
Lowest input is $1, and the lowest outputted price should be $5.

Your input is a list of integers:
12
8
41
27
144
99
3

And the output should a list of the new prices. In the above case:
15
9
39
29
145
99
5

Can we take the input one by one? Or separated by something other than a newline?

For simplicity I think the specified format is best, so you can focus on solving the actual problem instead of handling formatting as well. But of course a single integer on one row is allowed. :)

I was thinking the opposite: Not every language likes to parse strings at all. "[12,8,14,27,144,99,3]" would help a lot. Most Qs specify not even something like that. Don't prescribe what you think is best for us :)

Well, I have to specify a format, right? What are you looking for?

You don't have to, I think. Maybe it's just me, but in my experience usually lists can be taken in as lists.

Yes a language-specific list is probably easier to handle. But how long can I keep changing specifications? This is one of the reasons I've hesitated to post anything in code golf.

Newline is now dropped as a requirement, specifying only "a list". I hope it will make things better, not worse...!

"But how long can I keep changing specifications? This is one of the reasons I've hesitated to post anything in code golf." In case you're not aware of it, you can post challenge ideas in the sandbox where you can get community feedback before the challenge goes live, such that things like this can (hopefully) be pointed out and fixed before changes invalidate existing answers.

Does an answer have to be a complete program or just a function that accepts a list of integers and returns a list of amended integers? Has the requirement for newlines been dropped from the output as well or just the input?

It is completely dropped. Clarified it, but that will probably lead to some other question... ;)

Brainfuck, 4428 bytes (invalid)
Once I knew the algorithm worked, I lost interest and didn't finish the input handler. That's why this solution technically solves the problem, but is very hard to use. When you start the program in an interactive interpreter (faster is better), you can enter your "number". It has to be entered in Base256 if your interpreter doesn't support number conversion (mine does). The maximum price you can enter is therefore 255.
It then performs a looping modulo if the number is greater than 9 to split off all digits except the last one. The division results are saved, while the last digit is rounded to 5 or 9. Then they are added and printed. Then the program cleans all used registers (probably overkill) and asks for the next number.
It handles all special cases ($1, $20/$21 -> $19 etc.). Watch it run for the number 4 here (about 3 minutes, video shortened):

Code
>+<+[>>>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<[>[-]+<-]>
[<+>>>>>>>>>>>[-],>>[-]<[-]<[>+<<<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>
>>>>[-]>[<+<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>>>>[-]+++++++++>[<<<<+
>>>>-]<[<<<<<<+>+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]
+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]>>[>>>>-<<<<[-]]<<<[-]<->>>>>>>>[<<<<<<<<->>>>
>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>[>>>>>+<<<<<<<<<<<<<<<->>>>>>>>>>[-]]<<<<<<<<<
-]>>>>>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<<<<
<[>[-]+<-]>[<+>>>>>>>>>>>>[-]<[>+<<<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>
>>>>>[-]++++++++++>>>[<<<<<<<+>>>>>>>-]<<<<<<<[>>>>[<<<<<+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<
<<<<<-]>>[>-[<<+<+>>>-]<<<[>>>+<<<-]+>[<->[-]]<[>>-[>>>>>>>>-<<<<<<<<[-]]+<<[-]]>>-]>>>>
>>>>+<<<<<<<]>>>>>[-]>>[<<+<<<<<<<<+>>>>>>>>>>-]<<<<<<<<<<[>>>>>>>>>>+<<<<<<<<<<-]>>>>>>
>[-]++++++++++>[<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>[>+<<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<
<<<-]>-]>>>>>>>>>[-]<<[>>+<<-][-]>>>[<<<+<<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+<
<<<<<<<<<<-]>>>>>>>[-]>>>[<<<+<<<<<<<+>>>>>>>>>>-]<<<<<<<<<<[>>>>>>>>>>+<<<<<<<<<<-]>>>>
>>>[>+<<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>>>>>[-]<<<[>>>+<<<-][-]>[<+<<<<<
<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>>>>[-]>>>[<<<+<<<<<<<+>>>>>>>>>>-]<<<<
<<<<<<[>>>>>>>>>>+<<<<<<<<<<-]>>>>>>>[>-<<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>
>>>>[-]<[>+<-]<<<<<<<<<-]>>>>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>>-]
<<<<<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>[-]>>[<<+<<<<<<<<+>>>>>>>>>>-]<<<<<<<<<<[>>>>
>>>>>>+<<<<<<<<<<-]>>>>>>>[-]>[<<<<+>>>>-]<[<<<<<<+>+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<
-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]>>[>>>>-<<
<<[-]]<<<[-]<->>>>>>>>[<<<<<<<<->>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>[>>>>>>>>>
>>>+<<<<<<<<<<<<<<<<<<<<<<->>>>>>>>>>[-]]<<<<<<<<<-]>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<+>>>>>
>>>>>>>>>>-]<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>[-]>[<+<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>
>>>>>>>>+<<<<<<<<<-]>>>>>>>[-]++++>[<<<<+>>>>-]<[<<<<<<+>+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<
<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]>>[>>
>>-<<<<[-]]<<<[-]<->>>>>>>>[<<<<<<<<->>>>>>>>-]<<<<<<<<[>>>>>>>>+<<<<<<<<-]>>>>>>>>[>>>>
>>+<<<<<<<<<<<<<<<<->>>>>>>>>>[-]]<<<<<<<<<-]<[>[-]+<-]>[<+>>>>>>>>>>>[-]+++++++++>>>>>>
>>+<<<<<<<<<<<<<<<<<<<->-]>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>-]<<<<<<<<<<<
<<<<<[>[-]+<-]>[<+>>>>>>>>>>[-]>[<+<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>
>>>>>[-]++>[<<<<+>>>>-]<[<<<<<<+>+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>[>>[<+<<<+>>>>-
]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]<[>>>>>>>-<<<<<<<[-]]>>>[-]>>
>[-]>>>>[<<<<+<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+<<<<<<<<<<<-]>>>>>>>>>>>>[-]+
++++++++<<<<<[<<<+>>>-]>>>>>[<<<<<<<<<<<+>+<<+>>>>>>>>>>>>-]<<<<<<<<<<<<[>>>>>>>>>>>>+<<
<<<<<<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]
>>[>>>-<<<[-]]<<<[-]>>>>>>>[<<<<<<<<+>>>>>>>>-]<<<<<<<<[[-]>>>>>>>[<<<<<<<+>+>>>>>>-]<<<
<<<[>>>>>>+<<<<<<-]<[>>>>>>>>-<<<<<<<<[-]]]->>>>>>>>[<<<<<<<<->>>>>>>>-]<<<<<<<<[>>>>>>>
>+<<<<<<<<-]>>>>>>>>[>>>>>>>>+<<<<<<<<<<<<<<<<<<->>>>>>>>>>[-]]<<<<<<<<<-]<[>[-]+<-]>[<+
>>>>>>>>>>[-]>>>[<<<+<<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+<<<<<<<<<<<-]>>>>>>>>
->>>[-]<<<[>>>+<<<-]>[-]>>>>>>>>>>>>+<<<<<<<<<<<<<<<<<<<<<<<->-]>>>>>>>>>>>>>>>>>[<<<<<<
<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>>[-]+++++<<<<<
<<<<<-]>>>>>>>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>>>>>-]<<<<[<<<<
<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>[-]>>>[<<
<+<<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+<<<<<<<<<<<-]>>>>>>>[-]>>[<<+<<<<<<<+>>>
>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>>>>[>+<<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<
<<-]>>>>>>>>>>>[-]<<<[>>>+<<<-][-]>>>[<<<+<<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+
<<<<<<<<<<<-]>[-]>[-]>[-]>[-]>>>>[<<<<<+[>+<<<<+>>>-]<<<[>>>+<<<-]+>>>>----------[<<<<->
>>>[-]]<<<<[>>+>[-]<<<-]>>[>>+<<<<+>>-]<<[>>+<<-]+>>>>----------[<<<<->>>>[-]]<<<<[>+>[-
]<<-]>>>>>>>>-]<<<<<<<[<++++++++[>++++++>++++++<<-]>.>.[-]<[-]]>[<<++++++++[>>++++++<<-]
>>.[-]]<<++++++++[>>>++++++<<<-]>>>.[-]<<<++++++++++.[-]>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<
<->-]<[>[-]+<-]>[<+<->>-]<<]

You'll get a vote for ambition, wish I could give more than one. :)

I think that gif needs an epilepsy warning.

CJam, 19 17 bytes
q~{2-Ab)4>59s=N}/

Test it here.
Takes input as a CJam-style list and returns output newline separated.
Explanation
qN/{   e# Run this block for each line of the input...
  ~    e#   Evaluate the current line to get the integer.
  2-   e#   Subtract 2 to get all but the last digit right.
  Ab)  e#   Convert to base 10 (discarding a potential minus sign) and split off
       e#   the last digit.
  4>   e#   Test if it's greater than 4.
  59s= e#   Select the correct digit from the string "59" based on this result.
  N    e#   Push a line feed.
}/

Python 2, 47
lambda l:[max(5,(n+3)/5*5-(n-2)/5%2)for n in l]

If we look at the sequence of rounded values, we see that they come in blocks of 5.
... 25, 29, 29, 29, 29, 29, 35, 35, 35, 35, 35, 39, ...

We find what number block we're in with (n+3)/5 (call this value J). Then, we get the right multiple of 5 with J*5, and adjust things like 30 down to 29 by subtracting 1 whenever J is even.
To special-case 1 give 5 rather than -1, we pass the result to max(5,_).

To fix the Pyth version I think you can do meS,-*hJ/-d2K5K%J2KQ

or 2 bytes shorter: m-|*K5hJ/-d2K6%J2Q

@Jakube That's clever, how about you post it?

O.k. I will. But you can take the idea for your Python answer. It saves one byte: lambda l:[((n+3)/5*5or 6)-(n-2)/5%2for n in l]

Retina, 32 bytes
Accepts input in a comma separated list. There must be a trailing comma. Outputs in the same format.
T`d`aa555559`.,
T+`da`ad`\da
a
5

Explanation:
T`               #Transliteration mode.
  d`aa555559`    #Map the digits 0-9 to aa55555999
             .,  #Map only the trailing digits.
T+`              #Do until input does not change.
   da`ad`        #Map a to 9, 0 to a, and 1-9 to 0-8
         \da     #Only do this to each a and the character before each a.
a                #Match all leftover a's. This only happens when the input contains the integer 1.
5                #Replace them with 5.

Python 3, 74 82 bytes
a=eval(input())
for i in a:print(round(i,-1)+[5,-1][max(4,i-2)%10>4])

I struggled for brevity on values less than 11 and the requirement for 1 to evaluate to 5.

Seems like your program only takes a single integer?

@daniero correct, fixed now to accept list.

R, 51 49 47 43 bytes
(f=((n=scan()-2)%/%5+1+(n<0))*5)-(f%%10==0)

There should be room to improve this, but I thinking a different strategy might be better.  Takes a vector of integers from scan and outputs a vector of integers.  Essentially this uses integer division to round the number down, adds 1 and multiples it by five.  Anything divisible by 10 has 1 taken away.  If n = 1 then it increments the integer division by 1.
Test run
> (f=((n=scan()-2)%/%5+1+(n<0))*5)-(f%%10==0)
1: 1
2: 12
3: 8
4: 41
5: 27
6: 144
7: 99
8: 3
9:
Read 8 items
[1]   5  15   9  39  29 145  99   5
>

Pyth, 21 18 29 28 bytes
Thanks to @Jakube for cutting 3 bytes!
KeQJ-QKI<K2tJ.q;I<K6+J5;E+J9

 Try it here.
EDIT: Apparently it was invalid. I fixed it up at the cost of 11 bytes; I'll try to golf it more.

eQ is the same thing as %Q10, also you can inline the assignment: I<KeQ6+-QK5;E+-QK9

Cool, I didn't know about that!

No problem. Your approach is wrong though. You should round down to 9, if the last digit is 0 or 1

Ah, I'll work on it.

Pyth, 21 bytes
m?tdtt+d@jC"²a<"6ed5Q

Sadly I have to spend 4 bytes to correctly handle $1.

Quite clever. You can handle 1 with only 2 bytes though. mt|t+d@jC"²a<"6ed6Q

Pyth, 18 bytes
m-|*K5hJ/-d2K6%J2Q

Try it online: Demonstration or Test Suite
This answer is based on @xor's Python/Pyth solution. The main difference is, that I handle the special case 1 differently. The actual result for 1 would be 0 - 1 = -1. Using Python's or I can replace the 0 with a 6, resulting in 6 - 1 = 5. This saves the pain of taking the maximum of 5 and the result.
Explanation:
m-|*K5hJ/-d2K6%J2Q
m                Q   map each number d of the input list Q to:
    K5                  K = 5
       J/-d2K           J = (d - 2) / K
   *K hJ                   K * (J + 1)
  |                     or
             6             6 # if K*(J+1)==0
 -            %J2       minus (J mod 2)

Hassium, 133 Bytes
func main(){i=[12,8,41,27,144,99,3];foreach(e in i){f=e%10;if(!(e/10==0))print(e/10);if(f<5)r=5;else if(f>5)r=9;elser=f;println(r);}}

Run and see the expanded online:
http://hassiumlang.com/Hassium/index.php?code=4f1c14f4d699b11da7a6392a74b720c4

Sorry about the link being broken, we were doing some database work. Works now.

As outlined in the code golf tag wiki, answers must be full programs or functions. Snippets that simply hardcode the input are not allowed, unless the question explicitly says otherwise.

TI-BASIC, 19 bytes
int(Ans/5+.6
max(5,5Ans-not(fPart(Ans/2

Uses xnor's algorithm. TI-BASIC gets vectorization and multiplication for free, but we spend a few more bytes because it doesn't have modulo.

Ruby, 55 50 + 1 bytes
Run it with the n flag, like so: ruby -n prices.rb. Enter each price on a separate line.
x=$_.to_i
p x<7?5:(x-2).round(-1)+(~/[2-6]$/?5:-1)

JavaScript, 50
l=>l.map(n=>Math.max(5,((n+3)/5|0)*5-((n-2)/5&1)))

I use an &1 to save bytes instead of |0 and mod 2

Perl 5 -p, 33 bytes
/.1$|[60]$/?$_--:$_++until/[59]$/

Try it online!

Haskell, 114 bytes
g n
 |n>6=9-n
 |n>1=5-n
 |1>0=(-n-1)
f n=show$(read n)+(g$read$(:[])$last n)
main=interact(unlines.(map f).lines)

Explanation:
The function g returns 9-n if n>6 or else 5-n if n>1 or else -n-1. g is given the last digit and returns what should be added to the input number. f uses g to get the solution (plus lots of string manipulation). main outputs the result of f for each line of input.

Vyxal, ja, 13 12 bytes
ƛ⇩ȧṫ4>59$iJṅ

Try it Online!
I simply ported the CJam answer.
Explained
ƛ⇩ȧṫ4>59$iJṅ
ƛ             # Over every number in the input,
 ⇩ȧ           #   abs(a - 2)
   ṫ4>        #   ↑[:-1], ↑[-1] > 4
      59$i    #   indexed into 59
          Jṅ  #   merged and joined on ""

Stax, 12 bytes
Ç«δv▀▼ÖP▄¶⌠"

Run and debug it
Yet another port of the CJam answer.
-1 more byte if a list of integers is taken as input.

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


text:
Counting groups of a given size
Groups
In abstract algebra, a group is a tuple \$(G,\ast)\$, where \$G\$ is a set and \$\ast\$ is a function \$G\times G\rightarrow G\$ such that the following holds:

For all \$x, y, z\$ in \$G\$, \$(x\ast y)\ast z=x\ast(y\ast z)\$.

There exists an element \$e\$ in \$G\$ such that for all \$x\$ in \$G\$, \$x\ast e=x\$.

For each \$x\$ in \$G\$, there exists an element \$y\$ in \$G\$ such that \$x\ast y=e\$.

The order of a group \$(G,\ast)\$ is defined as the number of elements of \$G\$.
For each strictly positive integer \$n\$, there exists at least one group of order \$n\$. For example, \$(C_n,+_n)\$ is such a group, where \$C_n=\{0,...,n-1\}\$ and \$x+_ny=(x+y)\mod n\$.
Isomorphic groups
Let \$G:=\{1,2\}\$ and define \$\ast\$ by \$x\ast y=(x\times y)\mod3\$. Then \$1\ast1=1=2\ast2\$ and \$1\ast2=2=2\ast1\$.
Likewise, \$0+_20=0=1+_21\$ and \$0+_21=1=1+_20\$.
Although the elements and operations of the groups \$(G,\ast)\$ and \$(C_2,+_2)\$ have different names, the groups share the same structure.
Two groups \$(G_1,\ast_1)\$ and \$(G_2,\ast_2)\$ are said to be isomorphic if there exists a bijection \$\phi:G_1\rightarrow G_2\$ such that \$\phi(x\ast_1y)=\phi(x)\ast_2\phi(y)\$ for all \$x,y\$ in \$G_1\$.
Not all groups of the same order are isomorphic. For example, the Klein group is a group of order 4 that is not isomorphic to \$(C_4,+_4)\$.
Task
Write a program or function that accepts a non-negative integer n as input and prints or returns the number of non-isomorphic groups of order n.
Test cases
Input   Output
0       0
1       1
2       1
3       1
4       2
5       1
6       2
7       1
8       5
9       2
10      2
11      1
12      5
13      1
14      2
15      1
16      14
17      1
18      5
19      1
20      5

(taken from OEIS A000001)
Additional rules

There are no limits on execution time or memory usage.

Built-ins that trivialize this task, such as Mathematica's FiniteGroupCount, are not allowed.

Standard code-golf rules apply.

Of course Mathematica has a builtin for this. :/

Quoting Peter (from a comment on the sandbox post of Evolution of OEIS): "If you look at the "formula" and "program" sections for e.g. A000001, A000003, A000019 then an answer which doesn't use specialised builtins will require a lot of research." (Emphasis mine.) ;)

Some say that there is no builtin Mathematica does not have, but this is still subject to research. Other myths say that Mathematica creates the builtins by reading the programmers mind, but this too has not yet been confirmed.

@flawr the undocumented monkeys_on_typewriters builtin covers everything not covered by the documented builtins.

Why is (1+1)%3 not 2?

@Cabbie407 It's 1 × 1, not 1 + 1.

Well, I still don't get it. It says 1*1=1 and 1+1=0 (in the Example of the isomorphic group with * being that star thingy and the + having a 2 beside it. They can't both be x. ;)

@Cabbie407 Consider the integers modulo 2, (Z/2Z if you're familiar with that notation). Everything divisible by 2 is 0 and everything else is 1. So 1*1=1 and 1+1=2=0. * is denoting the multiplicative operation in that group, while × is denoting typical integer multiplication.

Okay, I guess that +2 is not defined for G but for C2. So it is actually mod 2. I thought both examples meant that group G defined before.

CJam, 189 187 bytes
This one's gonna be tough to explain... Time complexity is guaranteed to be O(scary).
qi:N_3>{,aN*]N({{:L;N,X)-e!{X)_@+L@@t}%{X2+<z{_fe=:(:+}%:+!},}%:+}fX{:G;N3m*{_~{G@==}:F~F\1m>~F\F=}%:*},:L,({LX=LX)>1$f{\_@a\a+Ne!\f{\:M;~{M\f=z}2*\Mff==}:|{;}|}\a+}fX]:~$e`{0=1=},,}{!!}?

If you're brave enough, try it online. On my crappy laptop I can get up to 6 with the Java interpreter or 5 in the online interpreter.
Explanation
I don't have a big math background (just finished high school, starting CS at uni next week). So bear with me if I make mistakes, state the obvious, or do things in horribly inefficent ways.
My approach is a brute force, though I tried to make it a little more clever. The main steps are:

Generate all the possible operands ∗ for a group of order n (i.e., enumerate all groups of order n);
Generate all the possible bijections φ between two groups of order n;
Using the results from steps 1 and 2, determine all isomorphisms between two groups of order n;
Using the result from step 3, count the number of groups up to isomorphism.

Before looking at the how each step is done, let's get some trivial code out of the way:
qi:N_             e# Get input as integer, store in N, make a copy
     3>{...}    ? e# If N > 3, do... (see below)
            {!!}  e# Else, push !!N (0 if N=0, 1 otherwise)

The following algorithm doesn't work correctly with n < 4, the cases from 0 to 3 are handled with a double negation.
From now on, the elements of a group will be written as {1, a, b, c, ...}, where 1 is the identity element. In the CJam implementation, the corresponding elements are {0, 1, 2, 3, ...}, where 0 is the identity element.
Let's start from step 1. Writing all possible operators for a group of order n is equivalent to generating all the valid n×n Cayley tables. The first row and column are trivial: they are both {1, a, b, c, ...} (left-to-right, up-to-down).
      e# N is on the stack (duplicated before the if)
,a    e# Generate first row [0 1 2 3 ...] and wrap it in a list
  N*  e# Repeat row N times (placeholders for next rows)
    ] e# Wrap everything in a list
      e# First column will be taken care of later

Knowing that a Cayley table is also a reduced Latin square (due to the cancellation property) allows to generate the possible tables row-by-row. Starting from the second row (index 1), we generate all the unique permutations for that row, keeping the first column fixed to the value of the index.
N({                                 }fX e# For X in [0 ... N-2]:
   {                            }%      e#   For each table in the list:
    :L;                                 e#     Assign the table to L and pop it off the stack
       N,                               e#     Push [0 ... N-1]
         X)                             e#     Push X+1
           -                            e#     Remove X+1 from [0 ... N-1]
            e!                          e#     Generate all the unique permutations of this list
              {         }%              e#     For each permutation:
               X)_                      e#       Push two copies of X+1
                  @+                    e#       Prepend X+1 to the permutation
                    L@@t                e#       Store the permutation at index X+1 in L
                          {...},        e#     Filter permutations (see below)
                                  :+    e#   Concatenate the generated tables to the table list

Not all those permutations are valid, of course: each row and column must contain all the elements exactly one time. A filter block is used for this purpose (a truthy value keeps the permutation, a falsy one removes it):
X2+                 e# Push X+2
   <                e# Slice the permutations to the first X+2 rows
    z               e# Transpose rows and columns
     {        }%    e# For each column:
      _fe=          e#   Count occurences of each element
          :(        e#   Subtract 1 from counts
            :+      e#   Sum counts together
                :+  e# Sum counts from all columns together
                  ! e# Negate count sum:
                    e#   if the sum is 0 (no duplicates) the permutation is kept
                    e#   if the sum is not zero the permutation is filtered away

Note that I am filtering inside the generation loop: this makes the code a bit longer (compared to distinct generation and filtering), but greatly improves performance. The number of permutations of a set of size n is n!, so the shorter solution would require a lot of memory and time.
A list of valid Cayley tables is a great step towards enumerating the operators, but being a 2D structure, it can't check for associativity, which is a 3D property. So next step is filtering out non-associative functions.
{                                 }, e# For each table, keep table if result is true:
 :G;                                 e#   Store table in G, pop it off the stack
    N3m*                             e#   Generate triples [0 ... N-1]^3
        {                     }%     e#   For each triple [a b c]:
         _~                          e#     Make a copy, unwrap top one
           {    }:F                  e#     Define function F(x,y):
            G@==                     e#       x∗y (using table G)
                   ~F                e#     Push a∗(b∗c)
                     \1m>            e#     Rotate triple right by 1
                         ~           e#     Unwrap rotated triple
                          F\F        e#     Push (a∗b)∗c
                             =       e#     Push 1 if a∗(b∗c) == (a∗b)∗c (associative), 0 otherwise
                                :*   e#   Multiply all the results together
                                     e#   1 (true) only if F was associative for every [a b c]

Phew! Lots of work, but now we have enumerated all groups of order n (or better, the operations on it - but the set is fixed, so it's the same thing). Next step: find isomorphisms. An isomorphism is a bijection between two of those groups such that φ(x ∗ y) = φ(x) ∗ φ(y). Generating those bijections in CJam is trivial: Ne! will do it. How can we check them? My solution starts from two copies of the Cayley table for x ∗ y. On one copy, φ is applied to all elements, without touching the order of rows or columns. This generates the table for φ(x ∗ y). On the other one the elements are left as they are, but rows and columns are mapped through φ. That is, the row/column x becomes the row/column φ(x). This generates the table for φ(x) ∗ φ(y). Now that we have the two tables, we just have to compare them: if they are the same, we have found an isomorphism.
Of course, we also need to generate the pairs of groups to test isomorphism on. We need all the 2-combinations of the groups. Looks like CJam has no operator for combinations. We can generate them by taking each group and combining it only with the elements following it in the list. Fun fact: the number of 2-combinations is n × (n - 1) / 2, which is also the sum of the first n - 1 natural numbers. Such numbers are called triangular numbers: try the algorithm on paper, one row per fixed element, and you'll see why.
:L                          e# List of groups is on stack, store in L
  ,(                        e# Push len(L)-1
    {                  }fX  e# For X in [0 ... len(L)-2]:
     LX=                    e#   Push the group L[X]
        LX)>                e#   Push a slice of L excluding the first X+1 elements
            1$              e#   Push a copy of L[X]
              f{...}        e#   Pass each [L[X] Y] combination to ... (see below)
                            e#   The block will give back a list of Y for isomorphic groups
                    \a+     e#   Append L[X] to the isomorphic groups
                          ] e# Wrap everything in a list

The code above fixes the first element of the pair, L[X], and combines it with other groups (let's call each one of those Y). It passes the pair to a isomorphism test block that I'll show in a moment. The block gives back a list of values of Y for which L[X] is isomorphic to Y. Then L[X] is appended to this list. Before understanding why the lists are set up in such a way, let's look at the isomorphism test:
\_@                                      e# Push a copy of Y
   a\a+                                  e# L[X] Y -> [L[X] Y]
       Ne!                               e# Generate all bijective mappings
          \f{                    }       e# For each bijection ([L[X] Y] extra parameter):
             \:M;                        e#   Store the mapping in M, pop it off the stack
                 ~                       e#   [L[X] Y] -> L[X] Y
                  {     }2*              e#   Repeat two times (on Y):
                   M\f=                  e#     Map rows (or transposed columns)
                       z                 e#     Transpose rows and columns
                                         e#     This generates φ(x) ∗ φ(y)
                           \Mff=         e#   Map elements of L[X], generates φ(x ∗ y)
                                =        e#   Push 1 if the tables are equal, 0 otherwise
                                  :|     e#   Push 1 if at least a mapping was isomorphic, 0 otherwise
                                    {;}| e#   If no mapping was isomorphic, pop the copy of Y off the stack

Great, now we have a list of sets like [{L[0], Y1, Y2, ...}, {L[1], Y1, ...}, ...]. The idea here is that, by transitive property, if any two sets have at least one element in common then all the groups in the two sets are isomorphic. They can be aggregated into a single set. As L[X] will never appear in the combinations generated by L[X+...], after aggregating each set of isomorphisms will have one unique element. So, to get the number of isomorphisms, it's sufficient to count how many groups appear exactly once in all sets of isomorphic groups. To do this, I unwrap the sets so they look like [L[0], Y1, Y2, ..., L[1], Y1, ...], sort the list to create clusters of the same group and finally RLE-encode it.
:~            e# Unwrap sets of isomorphic groups
  $           e# Sort list
   e`         e# RLE-encode list
     {    },  e# Filter RLE elements:
      0=      e#   Get number of occurrences
        1=    e#   Keep element if occurrences == 1
            , e# Push length of filtered list
              e# This is the number of groups up to isomorphism

That's all, folks.

That is one heck of an explanation. Nice.

@The_Basset_Hound ...aaaand it's now finished ;)

I consider my own answer non-competing, so I have accepted this one.

CJam, 73 bytes
0ri:Re!Rm*{:Tz0=R,=[R,Te_]m!{~ff{T==}e_}/=&},{:T,e!{:PPff{T==P#}}%$}%Q|,+

The time complexity of the above code is worse than O(n!n).
Input n=4 is already to much for the online interpreter.
Using the Java interpreter, input n=5 could be possible, if you have enough RAM and patience.
Finding groups
Given a group (G, ∗) of order n, we can pick an arbitrary bijection φ : G -> Cn such that φ(e) = 0.
φ will become an isomorphism of (G, ∗) and (Cn, ∗') if we define ∗' by x ∗' y = φ(φ-1(x) ∗ φ-1(y)).
This means that it suffices to study all group operators in Cn such that 0 is the neutral element.
We will represent a group operator ∗ in Cn by a rectangular array T of dimensions n × n such that T[x][y] = x ∗ y.
To generate such an array, we can start by picking a permutation of Cn for each of its n rows.
This way, 0 will be present in all rows (but not necessarily all columns), meaning that the third condition (existence of an inverse) will be fulfilled, whatever e may be.
We can fix e = 0 by requiring that the first column of T is equal to Cn. In particular, the second condition (existence of a neutral element) will hold.
To verify that T corresponds to a group operator, all that's left to do is verifying that the first condition (associativity) holds. This can be done exhaustively by checking that T[T[x][y]][z] == T[x][T[y][z]] for all x, y, z in Cn.
Counting non-isomorphic groups
The above method for finding groups will yield some isomorphic groups. Rather than identifying which ones are isomorphic, we generate the family of all isomorphic groups for every one of them.
This can done achieved by iterating over all bijections φ : Cn -> Cn, and determining the associated array Tφ, defined by Tφ[x][y] = φ-1(T[φ(x)][φ(y)]).
All that's left to do is counting the number of distinct families.
What the code does
0         e# Push 0. For input 0, the remaining code will crash, leaving
          e# this 0 on the stack.
ri:R      e# Read an integer from STDIN and save it in R.
e!        e# Push all permutations of [0 ... R-1].
Rm*       e# Push all arrays of 6 permutations of [0 ... R-1].
{         e# Filter; for each array:
  :T      e#   Save it in T.
  z0=R,=  e#   Check if the first column equals [0 ... R-1].
  [R,Te_] e#   Push [0 ... R-1] and a flattened T.
  m!{     e#   For both pairs (any order):
    ~     e#     Unwrap the pair.
    ff{   e#     For each X in the first: For each Y in the second:
      T== e#       Push T[X][Y].
    }     e#
  }/      e#
  =       e#   Check for equality, i.e., associativity.
  &       e#   Bitwise AND with the previous Boolean
},        e# Keep T iff the result was truthy.
{         e# For each kept array:
  :T      e#   Save it in T
  ,e!     e#   Push all permutations of [0 ... R-1].
  {       e#   For each permutation:
    :PP   e#     Save it in P. Push a copy.
    ff{   e#     For each X in P: For each Y in P:
      T== e#       Push T[X][Y].
      P#  e#       Find its index in P.
    }     e#
  }%      e#
  $       e#   Sort the results.
}%        e#
Q|,       e# Deduplicate and count.
+         e# Add the result to the 0 on the stack.

Nice. I did try a "dumb" brute, but it was difficult to get to 5, so I traded bytes for speed.

Python 2, 515 507 bytes

Saved eight bytes thanks to Dennis.

def F(n):
 def f(k,*s):n==len(set(s))and S.add(s);{k and f(~-k,j,*s)for j in I}
 def c(k,*G):k and{s in G or c(~-k,s,*G)for s in S}or(I in G)&all((o(x,y)in G)&any(I==o(z,x)for z in G)for x in G for y in G)and A.add(G)
 S=set();A=S-S;I=tuple(range(n));o=lambda x,y:tuple(y[x[j]]for j in I);i=lambda G,H:any(all(o(H[B[i]],H[B[j]])==H[B[[k for k in I if G[k]==o(G[i],G[j])][0]]]for i in I for j in I)for B in S);f(n);c(n);K=list(A);[G in K and{G!=H and i(G,H)and K.remove(H)for H in K}for G in A];return len(K)

Try it online!

Using the equivalence between the number of non-isomorphic subgroups of order \$n\$ of \$\ \Sigma_n\$ and the number of isomorphic equivalence classes of finite groups of order \$n\$.
Link to verbose version.

Do the orders of s and G matter? If not, you can use def f(k,*s):...f(~-k,j,*s)... and def c(k,*G):...c(~-k,s,*G).....

@Dennis They do not; thanks.

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


text:
Monday Mini-Golf #1: Reverse Fibonacci Solver
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday.
A Fibonacci-like sequence is obtained using the same method as the famous Fibonacci sequence; that is, each number F(n) is found by adding the previous two numbers in the sequence (F(n) = F(n-1) + F(n-2)), or by subtracting the next two numbers (F(n) = F(n+2) - F(n+1)). The main difference is that these sequences can start with any two numbers. The zero-indexing of these sequences is disputable, but for now, we're going to use this rule:

The 0th number in a Fibonacci-like sequence is the last number which is smaller than the preceding number.

As an example, the Fibonacci sequence could be written as 1, 0, 1, 1, 2, 3, 5..., so the 0th number in the sequence is the lone 0.
Challenge
The goal of the challenge is to write a program or function that takes in three integers, in any format:

A and B, the two numbers with which to start generating a sequence.
N, the length of the resulting sequence to output.

And outputs the first N numbers of the sequence, starting at the 0th.
Details

A, B, and N may be taken in any order and format, as long as they are visibly separated. If you use a different order/format, please specify what it is.
You may assume that A, B, and N are always positive integers.
You may assume that N is no more than 100, and the resulting sequence will not contain x >= 2^31.
If A is larger than B, then B is the 0th number in the sequence.
The output must be separated by spaces, commas, and/or newlines.
A trailing space or newline is allowed, but not a trailing comma.

Test-cases
Example 1:
8 13 10

Working backward from 8 13 until we find a number larger than the previous, we get 13 8 5 3 2 1 1 0 1. Thus, 0 is the 0th number in this sequence. Working forward from this, we print out 0 and the next 9 members:
0 1 1 2 3 5 8 13 21 34

Example 2:
23 37 5

Again working backward to find the 0th number, we find 37 23 14 9 5 4 1 3. The 0th number this time is 1, so we print it out, along with the next 4 members:
1 4 5 9 14

Example 3:
4 3 8

With this one, we don't have to work backward to find the 0th number, because 3 is smaller than 4:
3 7 10 17 27 44 71 115

Example 4:
29 47 11

Result:
1 3 4 7 11 18 29 47 76 123 199

Scoring
This is code-golf, so shortest valid code in bytes wins. Tiebreaker goes to earlier posted submission. The winner will be chosen next Monday, Sep 28. Good luck!
Edit: Congrats to your winner, @Jakube, using Pyth for an amazing 23 bytes!

I've removed the [monday-mini-golf] tag you created. I don't think we should create tags for more or less arbitrary groups of challenges. The tag doesn't really tell you anything about the challenge, and if you want to find all of these, one could just search for the phrase in search bar. Alternatively, if you include a link to this first challenge in every future instalment, they will all be linked under "Linked questions" in the sidebar.

@MartinBüttner OK, thanks; I'll keep that in mind.

Can I take the input how I want it (A python list literal [8, 13, 10])?

@muddyfish Sure, as long as you specify in your answer the format used.

Is the solution 3 7 10 17 27 44 71 115 correct?

@LuisMendo I believe so; 4+3=7, 3+7=10, etc. and the 4 is not printed, since it has an index of -1. Are you getting a different result?

No, I think I had got the question wrong. Thanks!

Can the input be an array of the two numbers and then the third number? That is, [8 3], 10

The challenge currently says write a program. Does that mean that functions are not allowed? (CC @LuisMendo)

@Dennis Hm, good point. OP please clarify!

@Dennis Sorry, slipped my mind. Functions are also allowed. Thanks for pointing that out!

@LuisMendo That's alright; just be sure to specify it in your answer.

Pyth, 23 bytes
AQWgHGA,-HGG)VvwHA,H+GH

Try it online: Demonstration or Test Suite
Quite unusual style of Pyth programming. Sometimes functional programming has its downsides.
Explanation:
AQWgHGA,-HGG)VvwHA,H+GH  Q = input list of the two starting numbers
AQ                       G, H = Q (unpacking Q)
  WgHG                   while H >= G:
      A,-HGG                G, H = [H - G, G]
            )            end while
              vw         read a number from input
             V           for N in range(^):
                H           print H
                 A,H+GH     G, H = [H, G + H]

Retina, 65 54 bytes
+`(1*),\1(1*)
$2,$1
+`(1*)(,1*);1\B
$1$2$2$1;
^1*,|;1
<empty>

Here, <empty> represents an empty trailing line. Run the code as a single file with the -s flag.
The input format is
A,B;N

where the numbers are represented in unary. The output is a comma-separated list, also in unary. For instance:
8 13 10

would be
11111111,1111111111111;1111111111

and yield
,1,1,11,111,11111,11111111,1111111111111,111111111111111111111,1111111111111111111111111111111111

Explanation
+`(1*),\1(1*)
$2,$1

First, we reduce A and B to the 0th and -1st element. The + tells Retina to keep repeating this regex substitution until either the regex stops matching or the substitution doesn't modify the string. The regex captures A into group 1 with (1*), and then makes sure that B is at least as big as A while capturing B-A with \1(1*) into group 2. This ensures that this loop terminates once A>B.
The substitution simply turns A,B into B-A,A by setting the match to $2,$1.
+`(1*)(,1*);1\B
$1$2$2$1;

Now we've already got the first number of the required output in the string (as well as the one before it, which we'll need to get rid off later). This substitution now adds another number as the sum of the last two numbers while taking a 1 from N. Because we already have one number we want this to happen only N-1. We do this by ensuring with \B that there is still at least ;11 at the end of the string. If we call the last two values of the sequence C and D, then the regex captures C into group 1 and ,D into group two. We write those back with $1$2. Then we also write $2$1 which translates to ,D+C. Note that we don't write back the single 1 we matched in N, thereby decrementing it.
^1*,|;1
<empty>

Finally, we need to get rid of -1st element of the sequence, as well the leftover ;1 from N, which we simply do by matching either of those and replacing it with the empty string.

Python 2, 93 87 67 61 60 bytes
i,j,l=input()
while j/i:i,j=j-i,i
exec"i,j=j,i+j;print i;"*l

Gets the input (as a literal python list [8,10,13])
Works out the 0th term
Then prints out the sequence of additions until the length has been reached

Nice method. For the index-less loop for _ in[1]*l:, it's a bit shorter to do exec"stuff;"*l

@xnor: It appears significantly longer to me.

Compare for _ in[1]*l:stuff to exec"stuff;"*l. @xnor didn't put in the stuff part in the for loop. Or for _ in[1]*l: to exec";"*l

You can replace j>=i with j/i. Just found that out! (Because You may assume that A, B, and N are always positive integers)

CJam, 26 23 bytes
Thanks to Dennis for saving 3 bytes.
q~{_@\-_g)}g\@{_@+_p}*t

Takes input in order N B A (separated by any kind of white space). Prints the result as a newline-separated list and terminates with an error.
Test it here.
Explanation
This goes one step further when finding the 0th element. That is, it terminates once one of the values is negative.
q~      e# Read and evaluate input, pushing N, B and A on the stack.
{       e# do while...
  _@\-  e#   B, A = A, B-A
  _W>   e#   Check if A is still non-negative.
}g
\@      e# Reorder N B A into A B N.
{       e# Run the following N times...
  _@+   e#   A, B = B, A+B
  _p    e#   Print B.
}*
t       e# The last A, B are still on the stack. We remove them by trying to
        e# execute a ternary operator: it pops the first two values but then
        e# terminates the program with an error, because there is no third value.

q~{_@\-_g)}g\@{_@+_p}*t (N B A) saves three bytes.

While I was trying to solve this in CJam myself I had trouble with the input from example 1. Now I see that this solution doesn't give the expected output either. Where is the flaw here? I think instead of checking for B>A it has to check for B not smaller than A or something, but I can't figure out how to do that in CJam. EDIT: Dennis' solution prints the correct output.

Well, I solved it in my solution.

@Cabbie407 You're correct, I should have used <! instead of >.

Ah, okay. I wondered where to put that ! in this. I simply added one to make it work ;)

Great work! This is tied for the shortest answer, but the award goes to Jakube's Pyth answer, as it reached its final length sooner.

C, 105 102 100 bytes
main(a,b,n,t){for(scanf("%d%d%d",&a,&b,&n);t=b-a,t>=0;a=t)b=a;for(;n--;b=t)t=a+b,printf("%d ",a=b);}

Thanks to @C0deH4cker for golfing off 2 bytes!
Try it online on Ideone.

Labyrinth, 58 54 49 46 44 bytes
Thanks to Sp3000 for suggesting the use of bitwise negation, which saved two bytes.
??#"{=
  ;  -
@"~~:}
~""
?
"}}:=
(   +
{{\!:

Input format is B A N. The output is a newline separated list.
Explanation
(Slightly outdated. The basic idea is still the same, but the layout of the code is different now.)
This uses the same idea as my CJam answer (so credits still go to Dennis): when backtracking the sequence we don't stop until we get a negative value (which leaves us with the -1st and -2nd element of the sequence). Then, we start adding them before printing the first value.
This uses a couple of nifty Labyrinth golfing tricks. Let's go through the code in sections:
?"
}

The IP starts on the ? going right (which reads A). On the " (a no-op) it hits a dead end, so it turns around, executing the ? again (reading B). Lastly, } moves B over to the auxiliary stack. The dead end saves a byte over the naive
?
?
}

Now the loop which finds the beginning of the sequence:
)(:{
"  -
" "`?...
=}""

The )( (increment-decrement) is a no-op, but it's necessary to ensure that the top of the stack is positive on the junction (such that the IP turns east). : duplicates A, { moves B back to the main stack, - computes A-B. What we really want is B-A though, so ` negates the value.
This is now a four-way junction. For negative results, the IP takes a left-turn towards the ?, reading N and moving to the next part of the program. If the result is zero, the IP keeps moving south, takes a turn in the corner, and remains in the loop. If the result is positive, the IP takes a right-turn (west), turns in the corner, and takes another right-turn (west again) so it also remains in the loop. I think this might become a common pattern, to distinguish negative from non-negative (or positive from non-positive) values:
                v
                "
               """>negative
non-negative <"""

At least I haven't been able to find a more compact/useful layout for this case yet.
Anyway, while A is non-negative, the loop continue, } moves A to the auxiliary stack and = swaps A and B.
Once A is negative, ? reads N and we move into the second loop:
 }:=+:
 }   !
?"({{\

We know that N is positive, so we can rely on the IP taking a left-turn (north). The loop body is now simply:
}}:=+:!\{{(

In words: moves both N and A onto the auxiliary stack. Duplicate B, swap the copy with A and add A to the other copy of B. Duplicate it again to print the current value of B. Print a newline. Move B and N back to the main stack and decrement N.
While N is positive, the IP will take a right-turn (north) continuing the loop. Once N reaches zero, the code terminates in a rather fancy way:
The IP keeps moving straight ahead (west). The ? tries to read another integer, but we've already reached EOF, so it actually pushes 0 instead. ` tries negating that, but that's still zero. So the IP still moves west, takes a turn in the corner, and then keeps moving downwards onto the @ which terminates the program.
I wonder if I could place the @ in an even cheaper position (it currently costs 3 whitespace characters) by turning the three " around the ` into compound no-ops (like )(), but I haven't been able to make that work yet.

Matlab / Octave, 115 125 bytes
function x=f(x,n)
while x(2)>=x(1)
x=[abs(x(1)-x(2)) x];end
x=x([2 1]);for k=1:n-1
x=[x(1)+x(2) x];end
x=x(n:-1:1);

The function should be called as f([8 13],10).
Example (Matlab):
>> f([8 13],10)
ans =
     0     1     1     2     3     5     8    13    21    34

Or try it online (Octave).

According to the rules, you can modify the input, so f([a b],n) should be allowed.

@beaker Thanks! I was going to do that... but then I read the rule "The input and output may be separated by spaces, commas, or newlines" and got confused. I'll ask for clarification

Yeah, I don't know if x=f(x,n) in the function header counts...

@AlexA. I was responding to Luis' comment about the rule "The input and output may be separated by spaces, commas, or newlines" and the OP's "A, B, and N may be taken in any order and format, as long as they are visibly separated." Because A and B would no longer visibly separated in the function header, I was questioning whether having only 2 function arguments would be permissible.

><>, 33 31+1 for -v = 32 bytes
&:{:@(?v:}-$&
-1;!?:&<$+{oan::$&

Input must be pushed on stack using -v since parsing decimal numbers is non-trivial in ><>.
Explanation :
I will represent the stack after each (group of) operation. It starts with [F(n), F(n+1), N]
The first lines goes down the serie to its 0th term :
& removes N from the stack to put it into a register. [F(n), F(n+1)]
:{:@ move the stack and duplicate items to get [F(n+1), F(n), F(n+1), F(n)]
(?v compares the two top items of the stack and branch to the second line if F(n+1) < F(n) [F(n+1), F(n)]
:} move the stack and duplicate its top to get [F(n), F(n+1), F(n)]
- substracts the two top items and put the result on top of the stack [F(n), F(n+1) - F(n)]
$ switchs the top two values of the stack. [F(n+1) - F(n), F(n)]
& retrieve the value from the register. iteration complete, since [F(n+1) - F(n), F(n), N] can also be read as [F(n-1), F(n), N]

The second line goes up the serie until it has printed N terms :
< changes the code pointer direction to the left [F(0), F(-1)]
& retrieves the stored value back from the stack [F(0), F(-1), N]
:?!; copies N to compare it to 0, stops if it is [F(0), F(-1), N]
1- decreases it [F(0), F(-1), N-1]
& stores it back [F(0), F(-1)]
$:: makes the stack [F(-1), F(0), F(0), F(0)]
n{ prints the top of the stack then left shifts it [F(0), F(0), F(-1)]
ao displays a line feed (ascii character 0x0a) [F(0), F(0), F(-1)]
+ adds the two top values [F(0), F(-1) + F(0)]
$ switch the two top values. iteration complete since [F(-1) + F(0), F(0)] which can be read as [F(1), F(0)]

You should be able to reduce your byte count by 2 by changing 00. on the first line to &. Theoretically, ! should work but I think that ><> pads the width of lines to match the width of the longest one (edit: which is why I figure you had 00. in the first place).

Yeah, I'm not too sure about that, I've saw people here use ! In a way that ignored spaces. I know the online interpreter at fishlanguage.com doesn't work that way, but maybe the python interpreter does. & does the trick nicely anyway, thanks !

The online interpreter works with ! or ? (at the end of the line) if it's on the longest line. You can try it with something like 1n! and it'll error, but if there's a line below it with something longer than it, like lorumipsum, it won't.

"The output must be separated by spaces, commas, and/or newlines." Sorry, but you'll have to use the other version. Good job, though!

Fixed it, I used \n instead of spaces to save 2 bytes

Haskell, 67 65 56 bytes
a#b|a>b=b:scanl(+)(a+b)(a#b)|1>0=(b-a)#a
n%a=take n.(a#)

Thanks to @nimi for suggestions
This defines a ternary infix function %, which is invoked in the format (n%a)b, for example:
> (10%8)13
[0,1,1,2,3,5,8,13,21,34]

Explanation
The binary infix function #, defined on the first line, takes in two integers a and b and returns the infinite Fibonacci-like sequence where a and b occur as consecutive elements.
a#b                                       -- Define a#b:
   |a>b=                                  -- if a>b, then a#b is
        b:                                -- the sequence that starts with b and
          scanl(+)     (a#b)              -- continues with the sums of prefixes of a#b
                  (a+b)                   -- plus the additional term a+b;
                            |1>0=(b-a)#a  -- otherwise, it's (b-a)#a.

The function % simply takes the first n elements of a#b.

You can create the fibonacci sequence with let f=a:scanl(+)(a+b)f in f (-> full #: a#b|a>b=let f=a:scanl(+)(a+b)f in f|1>0=(b-a)#a and save two bytes.

@nimi Thanks; I ran with your idea and saved a total of 9 bytes.

Javascript (ES6), 83 73 63 bytes
This might have been golfed to the max. We'll see.
(a,b,n)=>{while(a<=b)b-=a=b-a;for(;n--;console.log(a=b-a))b+=a}

Ungolfed:
function f(a,b,n) {
  // repeat until we find the 0th item...
  while (a <= b) {  // if a = 5, b = 8:
    a = b - a;      // a = (8 - 5) = 3
    b = b - a;      // b = (8 - 3) = 5
  }
  // repeat n times...
  while (n-- > 0) { // if a = 5, b = 8:
    b += a;         // b = (8 + 5) = 13
    a = b - a;      // a = (13 - 5) = 8
    console.log(a); // print out each item
  }
}

Java, 113 78 76 bytes
Credit goes to ETHproduction for providing the algorithm I use in this answer.
(a,b,n)->{for(;a<=b;b-=a)a=b-a;for(;n-->0;b+=a,a=b-a)System.out.println(b);}

Try here.
Explanation:
(a,b,n)->{
    for (;a<=b;b=b-a)a=b-a;  //Compute previous terms while a <= b
    for (;n-->0;b=a+b,a=b-a) //Compute and print next terms while n > 0
    System.out.println(b);   //Print term
}

Original approach, 113 93 bytes
Looks more golfy ;)
String a(int a,int b,int n){return n<0?a+" "+a(b,a+b,n+1):n>0?a>b?a(b,a+b,-n):a(b-a,a,n):"";}

Try it out here.
Explanation:
String a(int a, int b, int n){
    return
    n < 0 ?                           //If n < 0
        a + " " + a(b, a + b, n + 1)  //Return a + next terms and increment n.
    :                                 //Else
        n > 0 ?                       //If n > 0
            a > b ?                   //If a > b
                a(b, a + b, -n)       //Negate n and return terms.
            :                         //If a <= b
                a(b - a, a, n)        //Generate previous term.
        :                             //If n == 0
            ""                        //Return nothing.
    ;
}

What? Java is shorter than JS?!? There's gotta be something I'm doing wrong....

@ETHproductions I actually copied your algorithm (and then golfed it) :P

That's fine with me, I took some of your improvements ;) I forgot printing each item separately was valid in JS.

You can shorten b=b-a to b-=a, and the same with a=b+a. It will save 2 bytes

+1 for making a verbose language submission so short. Usually Java submissions are the longest!

Mathematica 112
Will golf it eventually
z[a_, b_, n_] := (
  f[0] := Min[a, b];
  f[1] := Max[a, b];
  f[x_] := f[x - 1] + f[x - 2];
  f /@ Range[n]
  )

CJam, 40 bytes
l~:A;{_@_@)<}{_@\-\}w\{A(:A0>}{_p_@+}w\;

Baby steps. This is my first CJam program ever, so I'm proud it works at all.
It takes input in the same form as in the examples.
I've now seen I could reduce it to 33 bytes using the { ... }* construct.
l~:A;{_@_@)<}{_@-z\}w\A{_p_@+}*;;

And I could even reduce it by one more by using the ternary operator to clean the stack and produce an error.

Ruby, 141 bytes
def u a,b,n,z=""
n<1 ? z.chop : u(b,a+b,n-1,z+"#{a} ")
end
def d a,b,z=0
a.abs>b ? z : d(b-a,a,[a,b])
end
def f a,b,n
x,y=d a,b
u x,y,n
end

Execution
f function produces the desired output, argument names match the variable names from the question
f(8,13,10) # returns => "0 1 1 2 3 5 8 13 21 34"

Nothing clever:

u (up) function computes n elements in the fibonacci sequence starting with a,b using recursion
d (down) function finds the 0th and 1st element given two end elements using recursion
f (fibonacci) function puts the two together

Mathematica, 59 bytes
If[#>#2,LinearRecurrence[{1,1},#2+{0,#},#3],#0[#2-#,#,#3]]&

Ruby, 81 75 73
a,b,n=23,37,5;while(c=b-a)<a;b,a=a,c;end;p a;[*2..n].map{b=c+a;c,a=a,b;p b}

Shortened by 6 Bytes when replacing for-loop with range.map
a,b,n=23,37,5;while(c=b-a)<a;b,a=a,c;end;p a;[*2..n].map{p b=c+a;c,a=a,b}

Saved another 2 bytes by moving print statement

Pyke, 24 bytes
DA/IDA-],X_r)QVDsRe
R]);

Try it here!

Jelly, 14 bytes
Ḋ;_/Ɗ>/¿+⁹Ð¡/Ṗ

Try it online!

Common Lisp, 91 bytes
(lambda(a b n)(do((x a(- y x))(y b x))((> x y)(dotimes(k n)(print y)(psetf y(+ y x)x y)))))

Try it online!