[Question]
  [
As you probably know, a Fibonacci Number is one which is the sum of the previous two numbers in the series.
A Fibonacci Digit™ is one which is the sum of the two previous *digits*.
For instance, for the series beginning `1,1`, the series would be `1,1,2,3,5,8,13,4,7,11,2...` The change occurs after the `13`, where, instead of adding `8+13`, you add `1+3`. The series loops at the end, where `4+7=11`, and `1+1=2`, same as the series starts.
For another example, the series beginning `2,2`: `2,2,4,6,10,1,1,2,3,5,8,13,4,7,11,2,3...`. This one starts out uniquely, but once the digits sum to `10`, you end up with `1+0=1, 0+1=1`, and the series continues - and loops - the same way the `1,1` series did.
---
# The Challenge
Given an integer input `0≤n≤99`, calculate the loop in the Fibonacci Digit series beginning with those two digits. (You are certainly *allowed* to consider integers out of this range, but it's not required.) If given a one-digit input, your code should interpret it to denote the series beginning `0,n`.
All numbers in the loop that are two-digits *must* be outputted as two digits. So, for instance, the loop for `1,1` would contain `13`, not `1,3`.
The output begins with the first number in the loop. So, based on the above restrictions, the loop for `1,1` begins with `2`, since `1,1` and `11` are counted separately.
Each number of the output may be separated by whatever you want, as long as it's consistent. In all of my examples I use commas, but spaces, line breaks, random letters, etc. are all allowed, as long as you always use the same separation. So `2g3g5g8g13g4g7g11` is a legal output for `1`, but `2j3g5i8s13m4g7sk11` is not. You can use strings, lists, arrays, whatever, provided that you have the correct numbers in the correct order separated by a consistent separator. Bracketing the entire output is also allowed (ex. `(5,9,14)` or `[5,9,14]`, etc.).
**Test Cases:**
```
1 -> 2,3,5,8,13,4,7,11
2 -> 2,3,5,8,13,4,7,11
3 -> 11,2,3,5,8,13,4,7
4 -> 3,5,8,13,4,7,11,2
5 -> 2,3,5,8,13,4,7,11
6 -> 3,5,8,13,4,7,11,2
7 -> 14,5,9
8 -> 13,4,7,11,2,3,5,8
9 -> 11,2,3,5,8,13,4,7
0 -> 0
14 -> 5,9,14
59 -> 5,9,14
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the lowest number of bytes wins.
  
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 15 bytes
```
DFṫ-SṭḊ
d⁵ÇÐḶZḢ
```
[Try it online!](https://tio.run/##y0rNyan8/9/F7eHO1brBD3eufbijiyvlUePWw@2HJzzcsS3q4Y5F/w@3P2pao@D@/7@hjoKRjoKxjoKJjoKpjoKZjoK5joKFjoKljoKBjoIhSNQSAA "Jelly – Try It Online")
### How it works
```
d⁵ÇÐḶZḢ  Main link. Argument: n (integer)
d⁵       Divmod 10; yield [n:10, n%10].
  ÇÐḶ    Call the helper link until a loop is reached. Return the loop.
     Z   Zip/transpose the resulting array of pairs.
      Ḣ  Head; extract the first row.
DFṫ-SṭḊ  Helper link. Argument: [a, b] (integer pair)
D        Decimal; replace a and b with the digits in base 10.
 F       Flatten the resulting array of digit arrays.
  ṫ-     Tail -1; take the last two digits.
    S    Compute their sum.
      Ḋ  Dequeue; yield [b].
     ṭ   Append the sum to [b].
```
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~96 78~~ 75 bytes
*-3 bytes thanks to nwellnhof*
```
{0,|.comb,((*~*)%100).comb.sum...{my$a=.tail(2);m/(\s$a.*)$a/}o{@_};$_&&$0}
```
[Try it online!](https://tio.run/##bY7NbsIwEITvfooVchM73RpvfoAIEfU9WoQMIlKkuEGYHqIQXj2N0wNqldvON7Ozezlf69VgWwhK2MHQabyrU2OPKET0iOQLaS0noNy3VUp1tuVmp26mqkUst3YpPh03KpLcLPumez/0W34IAq77oWyuIOrq6@xkUSh3qaubWMBbAQsJHQNwpgX1ofcYehhiKV69lAghVG4Eo0t71g/k/RgTzHCDlGCKayRi8TxOPCbCvw5LPf6XxZhl8yWr@fR66k5HnrPNND/N3w6Wz5/XHmtG0xvjOlLKsvwpfgA "Perl 6 – Try It Online")
0 returns 0, and other number return a Match object which stringifies to the numbers separated by a space with a leading a trailing space.
### Explanation:
```
{                                                                         }   # Anonymous code block
 0,|.comb,                    ...   # Start a sequence with 0,input
                                    # Where each element is
                          .sum      # The sum of
          (     %100).comb          # The last two digits
           (*~*)                    # Of the previous two elements joined together
                                                                         # Until
                                 {                           }o{@_}   # Pass the list into another function
                                  my$a=.tail(2); # Save the last two elements
                                                m/(\s$a.*)$a/  # The list contains these elements twice?
                                                                     # And return
                                                                   ;$_     # Input if input is 0
                                                                      &&   # Else
                                                                        $0 # The looping part, as matched
```
[Answer]
# JavaScript (ES6), ~~111 104~~ 103 bytes
```
f=(n,o=[p=n/10|0,n%10])=>n^o[i=o.lastIndexOf(n=(q=p+[p=n])/10%10+q%10|0)-1]?f(n,[...o,n]):o.slice(i,-1)
```
[Try it online!](https://tio.run/##jc/NCoJAEAfwe0/hJdilcd3xozLYOnfqAcRATMOQHUuJDr27rShUe/I6/9983bJn1uaPqulcTZei70vFNJBKGqU9lG8Jeoky5Wqvz5RUikSdtd1RX4rXqWRasbtqVgNOueGGru7LoY27mB4MgEQIQWDiHYm2rvKCVeAi73PSLdWFqOnKSuYg547nOT4EEMEWMIAQNoC4sJw/0wWjQ4R/artwdNY08G0Xzdy7njlvM90XGhjb4XYKv@3jWtvFM5@Uo5NWHafnzQWAoRVG8W/YfwA "JavaScript (Node.js) – Try It Online")
### Commented
```
f = (                       // f = recursive function taking:
  n,                        //    n = last term, initialized to the input
  o = [                     //    o = sequence, initially containing:
    p = n / 10 | 0,         //      p = previous term, initialized to floor(n / 10)
    n % 10 ]                //      n mod 10
) =>                        //
  n ^                       // we compare n against
  o[                        // the element in o[] located at
    i = o.lastIndexOf(      //   the index i defined as the last position of
      n =                   //     the next term:
        (q = p + [p = n])   //       q = concatenation of p and n; update p to n
        / 10 % 10           //       compute the sum of the last two digits
        + q % 10            //       of the resulting string
        | 0                 //       and coerce it back to an integer
      ) - 1                 //   minus 1
  ] ?                       // if o[i] is not equal to n:
    f(n, [...o, n])         //   append n to o[] and do a recursive call
  :                         // else:
    o.slice(i, -1)          //   we've found the cycle: return it
```
[Answer]
# [Python 3](https://docs.python.org/3/), ~~187~~ ~~176~~ ~~158~~ ~~139~~ ~~138~~ ~~129~~ ~~121~~ ~~120~~ ~~112~~ ~~96~~ ~~95~~ ~~120~~ 116 bytes
```
f=lambda n,m=0,z=[]:(n,m)in zip(z,z[1:])and z[z.index(m)::-1]or f((z and n//10or m%10)+n%10,z and n or n//10,(m,*z))
```
[Try it online!](https://tio.run/##jVJhS8MwEP3eX3EMhETPrXGb2wL94AfxR3RlxDV1hTUrbdQZ8bfXS1cnlQkNtL2@9@5ejrvyw@4OZto0WbRXxXOqwGARheiiOJGMYp4bcHnJHLpYyIQrk4KL3Tg3qT6ygkt5K5JDBRljDjxpJhMRElBciZDfGHpjRwChLYuswGvHeZPqDFRd68pu3nO725RVbix7yd@0QdDHUm@tThHU1r6qPZcB0DnpzyxEUccjjNbmyedKr/v8WpvHTiTbv4dWJjtuNM4OVaH@twsCfz2ra8s6a31URbnXNUQQt4A/LET/cI6/kCDoDmGKMEdYIgiKZggLikRPeDdUSDgTVPaSuCckgF0sR7k94Xyo9f3Qigt/x1mrXPWIpSf6iWfjnnA1tEtv4zugBDHrt7W6wCRB@6GBw59pA633z1jlucqAncxOEKc1Oa1I8w0 "Python 3 – Try It Online")
Edit: As noted by @[Jules](https://codegolf.stackexchange.com/users/81581/jules), shorter solution applies to Python 3.6+. No longer distinct solutions for Python 3 / 3.6+
Edit: Indexing of `z` was too verbose. Without that now there is no gain in using `eval`.
Edit: Simplified finding if last two elements already appeared in the sequence.
Edit: Changed output format from list to tuple + replaced `lambda` with `def`
Edit: Back to `lambda` but embedded `t` into `f`.
Edit: Input `n` can be actually interpreted as head of growing collection `z` which would represent tail in recursive approach. Also beats @[Arbo](https://codegolf.stackexchange.com/users/82577/arbo)'s solution again.
Edit: Actually you can unpack two items from head which cuts another 16 bytes.
Edit: Actually 17 bytes.
Edit: As noted by @[Arbo](https://codegolf.stackexchange.com/users/82577/arbo) solution was giving answers for `14` and `59` cases as they were in initial test cases which were proven later to be wrong. For now this isn't so short but at least it works correctly.
---
Quite an abuse of `f-strings` and `eval`. Original ungolfed code although I suspect it could be done somehow easier:
```
def is_subsequence(l1, l2):
    N, n = len(l1), len(l2)
    for i in range(N-n):
        if l1[i:i+n]==l2:
            return True
    return False
def generate_sequence(r):
    if is_subsequence(r,r[-2:]):
        return r
    last_two_digits = "".join(map(str,r))[-2:]
    new_item = sum(int(digit) for digit in last_two_digits)
    return generate_sequence(r + [new_item])
def f(n):
    seq = generate_sequence([n,n])[::-1]
    second_to_last = seq[1]
    first_occurence = seq.index(second_to_last)
    second_occurence = seq.index(second_to_last, first_occurence + 1)
    return seq[first_occurence + 1 : second_occurence + 1][::-1]
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~114~~ ~~112~~ 109 bytes
```
f(n,s){int i[19]={};for(s=n/10,n%=10;i[s]-n;n+=n>9?-9:s%10,s=i[s])i[s]=n;for(;printf("%d ",s),i[s=i[s]]-n;);}
```
[Try it online!](https://tio.run/##XY7PCoMwDMbve4oiCC1GZt3f2nV7EPEwHI4iy8S6k/TZXarDw3JIyJcvya9On3U9ve4WuRg3jMLiwGxZmVFCDjvYwwGOcIIzKMhAUqu8no3Nu2c8uFtmWKapXJjMqSaJYMutEF1PnoZHcf4oWAS2bCuh12nD/4TuMzgeRT/Fb/zUcAQnxoVLKiLzmn5zZ3ArM8DYyEzb0lUpakwMXtUtVYWLaeZM0EVIBuclveI8CMYJ4llMYVtoP01f "C (gcc) – Try It Online")
-3 from [ceilingcat](https://codegolf.stackexchange.com/questions/178588/what-are-the-repeating-fibonacci-digits/178688?noredirect=1#comment430698_178688)
Includes a trailing space.
```
f(n,s){
    int i[19]={};                               //re-initialize edges for each call
    for(s=n/10,n%=10;                           //initialize from input
        i[s]-n;                                 //detect loop when an edge s->n repeats
        n+=n>9?-9:s%10,s=i[s])i[s]=n;           //step
    for(;printf("%d ",s),i[s=i[s]]-n;);         //output loop
}
```
[Answer]
# Perl 5, ~~90~~ 76 bytes
```
s/.\K/ /;s/(.?) *(.)\K$/$".($1+$2)/e until/^0|\b(.\B.|. .)\b.*(?= \1)/;$_=$&
```
[TIO](https://tio.run/##DcrBCoJAEADQ@3zFEkPsGs7sWluJiNBV@oOlQPAgLLq0dvPbmzw@eGn8RC@SmULPipvMmjqjCk0m9Mh4II3uhJXhUX3ndYr8slsYNIUHbaT2NVChu1YFZ7jBd4tHEQcVnOECHq5wgzvUYMHtrH9LWqdlzlI@PVlnpUzxDw)
[Answer]
# [Java (JDK)](http://jdk.java.net/), 194 bytes
```
n->"acdfinehlcdfinehfjofj".chars().map(x->x-97).skip((n="abbicbcsfibbbgqifiibbgbbbcsfbiiqcigcibiccisbcqbgcfbffifbicdqcibcbicfsisiibicfsiffbbicfsifiibicfsifii".charAt(n)%97)).limit(n<1?1:n<9?8:3)
```
[Try it online!](https://tio.run/##bZAxb8IwEIV3fsUpUiS7EAvaoQUCiKVSh06MVQfb4cKFxAm2g0AVvz01gXZpF99375387CvkUSZFtu@oamrroQi9aD2V4mE@@KNha7Sn2vxrOm@3srpaupTOwbskA18DgKZVJWlwXvpQjjVlUAWPbbwlk398grS54/0owJvxr/eUNPCmv3QJCIvOJMtI6gzJbHflvWJRYxEJvZPWMS4q2bBTsjwl02cu3J4axswikkqRVtohKaXyAyEFyAMHSREdNOWawogmp/RB5RoVIgVLZ8FTOgA6ckQ3QFR3@FWIbm9Ye2Z4HMK5KKmi0KWT1WRm0unqZfbEu3n/R6wtI@OBYAHjeSgpTMZXGA5/1gCwOTu/rUTdetGEPXlkUfyYzSB2sYlGQCNYWyvPTvj6tkiGQjZNeWbEg9abjHN@i7z05@AKl@4b "Java (JDK) – Try It Online")
Hardcoded seemed the shortest given that Python already had an answer of 187...
[Answer]
## Haskell, 100 bytes
```
d!p@(s,t)|(_,i:h)<-span(/=p)d=fst<$>i:h|q<-d++[p]=q!(t,last$mod s 10+t:[t-9|t>9])
h x=[]!divMod x 10
```
[Try it online!](https://tio.run/##DclLDoMgFEDReVfxTBxAfLbaP0ZMN@AKCDEktIFULRbSOHDvlOG9xyj/fo5jjDpzD@Ix0I0MaBtD29I7NZMDd1Tzlw9t3qW9LW2pi0I4yZeMBByVD/n00eChrorQiFCyLXRM0p2BlQuZafvrk6/J46TsDBwm5foBiPvaOcAeDAVR4xFPeMYLXvGGd2RYYZ2SyfgH "Haskell – Try It Online")
```
d!p@(s,t)                -- function '!' recursively calculates the sequence
                         -- input parameter:
                         -- 'p': pair (s,t) of the last two numbers of the sequence
                         -- 'd': a list of all such pairs 'p' seen before
  |       <-span(/=p)d   -- split list 'd' into two lists, just before the first
                         -- element that is equal to 'p'
   (_,i:h)               -- if the 2nd part is not empty, i.e. 'p' has been seen
                         -- before
          =fst<$>i:h     -- return all first elements of that 2nd part. This is
                         -- the result.
  |q<-d++[p]             -- else (p has not been seen) bind 'q' to 'd' followed by 'p'
   =q!                   -- and make a recursive call to '!' with 'q' and
     (t,    )            -- make the last element 't' the second to last element
                         -- the new last element is
          [t-9|t>9]      -- 't'-9 (digit sum of 't'), if 't'>9
       mod s 10+t        -- last digit of 's' plus 't', otherwise
h x=                     -- main function
     []!divMod x 10      -- call '!' with and empty list for 'd' and
                         -- (x/10,x%10) as the pair of last numbers
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~123~~ ~~114~~ 113 bytes
```
n=input()
p=b=l=n/10,n%10
while~-(b in p):p+=b,;l+=(b[1]/10or b[0]%10)+b[1]%10,;b=l[-2:]
print l[p.index(b)-2:-2]
```
[Try it online!](https://tio.run/##FYxBCsMgEADvvsJLQVFbtbeEfYl4WRqIIJslWNpe@nW7vQ3DMPwZ@0F5ToJG/BzGKgaEDnRL0dMlRfXaW9@@waBupNku7AD92h0YLKlKdpwaS6zSWvdXAn6VRwl5qYrPRkP3wtdGj@1t0IoOuc55/wE "Python 2 – Try It Online")
The program builds up a tuple `p` of all 2-value pairs that have occurred in the sequence, which is initialised with junk to save some bytes. The sequence itself gets built in the tuple `l`, and the last two elements of this tuple are stored in `b` for easy (and short) reference. As soon as a repeat is found, we can look up the index of `b` in `p` to know where the loop began.
EDIT: Cleaned this up a bit, and shaved off one more byte... My method does seem to be nearing its byte count limit, and I really should stop working on this.
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 46 bytes
```
≔Ｅ◧Ｓ²ΣιθＷ¬υ≔ΦＥ⊖Ｌ⊞ＯθΣ…⮌⪫θω²✂θλＬθ¹⁼κ✂θ⊗⁻λＬθλ¹υＩυ
```
[Try it online!](https://tio.run/##TU/NbsIwDL7zFD06EjvADfU0lSEx8VONJwjBNNHcpE2coj19lhQOWLJkfX/Wp7T0yklK6TME01k4ygFaeTvgnWFvh8gX9sZ2IJbVOu8l9mBEPkZRLx7aEFZwcgxRiOqVsDPE6OegLSqPPVrGGxzQdqyhjUGfB/SSnYfxGdj8KcJGuwF@cEIfEL6dsYV9iPlvmSwlo7CgtKxeaWOGV4X7GqOkAL9vqq2LV8qPj8bGAO@eYqDZmI@Yi7S5IkMjw1ykTmmTPib6Bw "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
≔Ｅ◧Ｓ²Σιθ
```
Input the number, pad it to 2 characters, then take the digital sum of each character, and save the resulting list.
```
Ｗ¬υ
```
Repeat while the list of loops is empty.
```
⊞ＯθΣ…⮌⪫θω²
```
Calculate the sum of the two previous digits and add it to the Fibonacci list.
```
Ｅ⊖Ｌ...✂θλＬθ¹
```
Take all the nontrivial suffixes of the list.
```
≔Φ...⁼κ✂θ⊗⁻λＬθλ¹υ
```
Filter out those that don't repeat and save the result in the list of loops.
```
Ｉυ
```
Cast the list of loops to string and print.
[Answer]
# [Red](http://www.red-lang.org), ~~189~~ ~~178~~ ~~164~~ 137 bytes
```
func[n][b: n % 10 c: reduce[a: n / 10]until[append c e: b
b: a *(pick[0 1]b > 9)+(a: b % 10)+(b / 10)k: find c reduce[e b]]take/last k k]
```
[Try it online!](https://tio.run/##Tc3RCoIwFMbxe5/iQwi0iFxp5S56iG7HLra5gUyGmD6/LSeH7g4/@H9nst36tp2QmeOrW4IRQQrNEXAAq2A4Jtstxgr1s0s0uYS5H4QaRxs6GFgOncVC4ViMvfGiApMaL7TlqYiV3pbirbe89Byu38p92UJLOStvL4P6zPDwch2nPswiZzi/crg4mO1y/YnDleCW4EZQJ6gJmgQNwT3BneCR4EHwTPAkaBO0BFWCioDtf9nf471qWrl@AQ "Red – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), ~~149~~ 139 bytes
```
s=input()
s=[s/10,s%10]
while zip(s,s[1:]).count((s[-2],s[-1]))<2:s+=[(s[-1]/10or s[-2]%10)+s[-1]%10]
print s[-s[::-1].index(s[-2],2)-1:-2]
```
[Try it online!](https://tio.run/##LY7LDoIwEEXXzld0Y2jDQ1qfNPZLGhYGqjTR0jAloj@Phbibe27m5PpP6Hon5qZvDVEkSZIZlXV@DJQBKo07Xma45WUN784@DflaTzFDzWXNiqYfXaAUdS7qyHJeM3YVElOl6Rrjdz@QtY8Olq5wtfnBurA0qKWMsLCuNdNfJVjOZTzmuAfu0WCDeRHryHBzD0O5YBI2ZjINWXbPHATs4QBHOMEZLlBBCTzG6gc "Python 2 – Try It Online")
Expects a non-negative integer as input. Smaller bytecount, but likely will no longer work for integers >99.
**Explanation:**
```
# get the input from STDIN
s=input()
# convert the input into two integers via a divmod operation
s=[s/10,s%10]
# count number of times the last two numbers appear in sequence in list.
# turn list into list of adjacent value pairs Ex: [1,1,2]->[(1,1),(1,2)]
      zip(s,s[1:])
                  # count number of times the last two items in list appear in entire list
                  .count((s[-2],s[-1]))
# if >1 matches, we have found a repeat.
while .................................<2:
        # the first digit of the last number, if it is >9
        # else the last digit of the second to last number
        (s[-1]/10or s[-2]%10)
                             # the last digit of the last number
                             +s[-1]%10
    # add the new item to the list
    s+=[..............................]
         # reverse the list, then find the second occurrence of the second to last item
         s[::-1].index(s[-2],2)
# get the section of the list from the second occurrence from the end, discard the final two items of the list
print s[-......................-1:-2]
```
[Answer]
# [Husk](https://github.com/barbuz/Husk), 15 bytes
```
UṠ-U_2¡ȯΣ↑_2ṁd;
```
[Try it online!](https://tio.run/##ASgA1/9odXNr/23igoHFgDEw/1XhuaAtVV8ywqHIr86j4oaRXzLhuYFkO/// "Husk – Try It Online")
```
UṠ-U_2¡ȯΣ↑_2ṁd;
U                   # longest prefix of unique elements from sequence
 Ṡ-U_2              # (after removing longest prefix with 
                    # all unique sublists of length 2)
      ¡ȯΣ↑_2ṁd;     # fibonacci digit sequence:
      ¡             # repeatedly apply function to list
              ;     # (starting with list formed from input):
       ȯ            # combination of 3 functions - 
        Σ           # sum of
         ↑_2        # last 2 elements of
            ṁd      # digits of list
```
]