%I #64 Mar 09 2024 11:03:36
%S 0,1,1,2,3,5,1,6,0,6,6,5,4,2,6,1,0,1,1,2,3,5,1,6,0,6,6,5,4,2,6,1,0,1,
%T 1,2,3,5,1,6,0,6,6,5,4,2,6,1,0,1,1,2,3,5,1,6,0,6,6,5,4,2,6,1,0,1,1,2,
%U 3,5,1,6,0,6,6,5,4,2,6,1,0,1,1,2,3,5,1,6,0,6,6,5,4,2,6,1,0,1,1,2,3
%N Fibonacci sequence (mod 7).
%C Sequence is periodic with Pisano period 16 = A001175(7).
%H Vincenzo Librandi, <a href="/A105870/b105870.txt">Table of n, a(n) for n = 0..1000</a>
%H Brady Haran, <a href="https://www.youtube.com/watch?v=e4sF_Z5oJek">Fibonacci Tartan and Bagpipes</a>, Numberphile video (2013). The music by Alan Stewart at 1:53 to 3:20 has pitch based on this sequence.
%H Wayne Peng, <a href="http://arxiv.org/abs/1511.05645">ABC Implies There are Infinitely Many non-Fibonacci-Wieferich Primes - An Application of ABC Conjecture over Number Fields</a>, arXiv:1511.05645 [math.NT], 2015.
%H Diana Savin and Elif Tan, <a href="https://arxiv.org/abs/2403.01592">On Companion sequences associated with Leonardo quaternions: Applications over finite fields</a>, arXiv:2403.01592 [math.CO], 2024. See p. 10.
%H <a href="/index/Rec#order_16">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1).
%F G.f.: - x*(1 + x + 2*x^2 + 3*x^3 + 5*x^4 + x^5 + 6*x^6 + 6*x^8 + 6*x^9 + 5*x^10 + 4*x^11 + 2*x^12 + 6*x^13 + x^14)/((x - 1)*(1 + x)*(1 + x^2)*(1 + x^4)*(1 + x^8)). - _R. J. Mathar_, Jul 14 2012
%F a(1) = a(2) = 1, then a(n) = (a(n - 2) + a(n - 1)) mod 7. - _Alonso del Arte_, Jul 30 2013
%e a(5) = 5 because Fibonacci(5) = 5.
%e a(6) = 1 because Fibonacci(6) = 8 and 8 mod 7 = 1.
%e a(7) = 6 because Fibonacci(7) = 13 and 13 mod 7 = 6.
%t Table[Mod[Fibonacci[n], 7], {n, 0, 100}] (* _Alonso del Arte_, Jul 29 2013 *)
%o (PARI) a(n)=fibonacci(n)%7 \\ _Charles R Greathouse IV_, Jun 04 2013
%o (PARI) a(n)=lift(((Mod([1,1;1,0],7))^n)[1,2]) \\ _Charles R Greathouse IV_, Jun 04 2013
%o (PARI) a(n)=fibonacci(n%16)%7 \\ _Charles R Greathouse IV_, Jan 06 2016
%o (Haskell)
%o a105870 n = a105870_list !! (n-1)
%o a105870_list = 1 : 1 : zipWith (\u v -> (u + v) `mod` 7)
%o (tail a105870_list) a105870_list
%o -- _Reinhard Zumkeller_, Jan 15 2014
%o (Magma) [Fibonacci(n) mod 7: n in [0..100]]; // _Vincenzo Librandi_, Feb 04 2014
%o (Python)
%o A105870_list, a, b, = [], 0, 1
%o for _ in range(10**3):
%o A105870_list.append(a)
%o a, b = b, (a+b) % 7 # _Chai Wah Wu_, Nov 26 2015
%K nonn,easy,hear
%O 0,4
%A _Shyam Sunder Gupta_, May 05 2005
%E a(0)=0 from _Vincenzo Librandi_, Feb 04 2014