This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A248624 #19 Jul 19 2015 10:44:50 %S A248624 4,5,4,6,4,5,7,11,10,5,6,8,10,14,11,21,14,6,7,9,21,13,15,23,14,5,20, %T A248624 33,41,17,7,8,10,20,35,14,14,23,16,33,31,51,20,33,13,32,50,45,53,24, %U A248624 44,8,9,11,17,33,35,12,4,35,40,17,47,48,31,14,25,20,40,27 %N A248624 Hiccup sequence. %C A248624 The hiccup sequence #_n: Consider the sequences created by a_n = a_[n-1] + a_[n-2] in Z mod n, with a certain "carrying" rule, where when the numbers a_[n-2] and a_[n-1] are added together in Z and the result is greater than n, two numbers are added to the sequence, first 1, and then a_[n-2] + a_[n-1] mod n. These sequences all fall into cycles of a different length: %C A248624 2: 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0... [4] %C A248624 3: 0, 1, 1, 2, 1, 0, 1, 1, 2, 1, 0, 1, 1, 2, 1, 0, 1... [5] %C A248624 4: 0, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3, 1, 1, 2, 3... [4] %C A248624 5: 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3, 1, 0, 1, 1, 2, 3... [6] %C A248624 6: 0, 1, 1, 2, 3, 5, 1, 2, 3, 5, 1, 2, 3, 5, 1, 2, 3... [4] %C A248624 7: 0, 1, 1, 2, 3, 5, 1, 1, 2, 3, 5, 1, 1, 2, 3, 5, 1... [5] %C A248624 8: 0, 1, 1, 2, 3, 5, 1, 0, 1, 1, 2, 3, 5, 1, 0, 1, 1... [7] %C A248624 ...and so on! It is easy to calculate and it seems to go on forever. But I do not have a proof. %C A248624 Proof: This sequence continues forever. This is because the state of the sequence is totally determined by the previous two numbers, and it has only a finite number of states. Therefore, the same state of any carrying Fibonacci sequence must repeat after a finite period of time; in physics, this is PoincarĂ©'s recurrence theorem. %C A248624 Proof: This sequence increases without bound. This is because in order to cycle a carrying Fibonacci sequence must wrap around at least once. Thus %C A248624 #_n ≥ sup{k in N, Fib[k] < n} %H A248624 Lars Blomberg, <a href="/A248624/b248624.txt">Table of n, a(n) for n = 2..10000</a> %o A248624 (Lua) %o A248624 for i = 2, 100 do %o A248624 local a = {i} %o A248624 for j = 1, 20 do %o A248624 local k %o A248624 if j <3 then %o A248624 k = j-1 %o A248624 else %o A248624 k = a[#a] + a[#a-1] %o A248624 end %o A248624 if k >= i then %o A248624 a[#a+1] = 1 %o A248624 k = k - i %o A248624 end %o A248624 a[#a+1] = k %o A248624 end %o A248624 print(table.concat(a, ", ")) %o A248624 end %Y A248624 Cf. A248218, A001175. %K A248624 nonn %O A248624 2,1 %A A248624 _Mason Bogue_, Oct 10 2014 %E A248624 Corrected a(9) and added a(13)-a(71) by _Lars Blomberg_, Oct 18 2014