# A003893 ## a(n) = Fibonacci(n) mod 10. > `(list)`   `(graph)`   `(refs)`   `(listen)`   `(history)`   `(text)`   `(edit)` ### DATA ```text 0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4, 1, 5, 6, 1, 7, 8, 5, 3, 8, 1, 9, 0, 9, 9, 8, 7, 5, 2, 7, 9, 6, 5, 1, 6, 7, 3, 0, 3, 3, 6, 9, 5, 4, 9, 3, 2, 5, 7, 2, 9, 1, 0, 1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4, 1, 5, 6, 1, 7, 8, 5, 3, 8, 1, 9, 0, 9, 9, 8, 7, 5, 2, 7, 9, 6, 5, 1, 6, 7, 3 ``` ### METADATA - **OFFSET** : `0,4` - **KEYWORDS** : `nonn,base,easy` - **AUTHOR** : [_N. J. A. Sloane_](https://oeis.org/wiki/User:N._J._A._Sloane), elipper(AT)uoft02.utoledo.edu - **IDENTIFICATION** : `#91 Apr 15 2025 15:49:07` - **CURRENT IMPLEMENTER** : @goulu ### COMMENTS - All blocks of 60 successive terms contain 20 even and 40 odd numbers. - [_Reinhard Zumkeller_](https://oeis.org/wiki/User:Reinhard_Zumkeller), Apr 09 2005 - These are the analogs of the Fibonacci numbers in carryless arithmetic mod 10. ### FORMULA - Periodic with period 60 = [A001175](A001175)(10). - From [_Reinhard Zumkeller_](https://oeis.org/wiki/User:Reinhard_Zumkeller), Apr 09 2005: (Start) - a(n) = (a(n-1) + a(n-2)) mod 10 for n > 1, a(0) = 0, a(1) = 1. - a(n) = [A105471](A105471)(n) - [A105472](A105472)(n)*10 = [A105471](A105471)(n)/10. (End) - a(n) = [A010879](A010879)([A000045](A000045)(n)). - [_Michel Marcus_](https://oeis.org/wiki/User:Michel_Marcus), Nov 19 2022 ### REFERENCES - G. Marsaglia, The mathematics of random number generators, pp. 73-90 of S. A. Burr, ed., The Unreasonable Effectiveness of Number Theory, Proc. Sympos. Appl. Math., 46 (1992). Amer. Math. Soc. ### LINKS - Vincenzo Librandi, [Table of n, a(n) for n = 0..10000](https://oeis.org/A003893/b003893.txt) - David Applegate, Marc LeBrun and N. J. A. Sloane, [Carryless Arithmetic (I): The Mod 10 Version](http://neilsloane.com/doc/carry1.pdf). - H. S. M. Coxeter, [The Golden Section, Phyllotaxis and Wythoff's Game](https://oeis.org/A000201/a000201.pdf), Scripta Math. 19 (1953), 135-143. [Annotated scanned copy] - Gregory P. Dresden, [Three transcendental numbers from the last non-zero digits of n^n, F_n and n!](https://dresden.academic.wlu.edu/files/2017/08/lnzd2.pdf), Math. Mag., pp. 96-105, vol. 81, 2008. - Ron Knott, [The Mathematical Magic of the Fibonacci Numbers](http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibmaths.html). - Yaohui Zhu, Kaiming Sun, Zhengdong Luo, and Lingfeng Wang, [Progressive Self-Learning for Domain Adaptation on Symbolic Regression of Integer Sequences](https://doi.org/10.1609/aaai.v39i2.32162), Proc. 39th AAAI Conf. Artif. Intel. (2025) Vol. 39, No. 1, 1692-1699. See p. 1698. - [Index entries for sequences related to final digits of numbers](https://oeis.org/index/Fi#final) - [Index entries for sequences related to carryless arithmetic](https://oeis.org/index/Ca#CARRYLESS) - [Index entries for linear recurrences with constant coefficients](https://oeis.org/index/Rec#order_39), signature (0,0,0,0,0,1,0,0,0,0,0,-1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,1,0,0,0,0,0,-1,0,0,0,0,0,1). ### PROGRAMS #### Maple ```maple with(combinat,fibonacci); A003893 := proc(n) fibonacci(n) mod 10; end; ``` #### Mathematica ```mathematica Table[Mod[Fibonacci[n], 10], {n, 0, 99}] (* _Alonso del Arte_, Jul 29 2013 *) Table[IntegerDigits[Fibonacci[n]][[-1]], {n, 0, 99}] (* _Alonso del Arte_, Jul 29 2013 *) NumberDigit[Fibonacci[Range[0,120]],0] (* Requires Mathematica version 12 or later *) (* _Harvey P. Dale_, Jul 05 2021 *) ``` #### Other Programs - **(Haskell)** : ```haskell a003893 n = a003893_list !! n a003893_list = 0 : 1 : zipWith (\u v -> (u + v) `mod` 10) (tail a003893_list) a003893_list -- _Reinhard Zumkeller_, Jul 01 2013 ``` - **(PARI)** : ```pari a(n)=fibonacci(n)%10 \\ _Charles R Greathouse IV_, Feb 03 2014 ``` - **(Magma)** : ```magma [Fibonacci(n) mod 10: n in [0..100]]; // _Vincenzo Librandi_, Feb 04 2014 ``` - **(Python)** : ```python A003893_list, a, b, = [], 0, 1 for _ in range(10**3): A003893_list.append(a) a, b = b, (a+b) % 10 # _Chai Wah Wu_, Nov 26 2015 ``` ### PYTHON IMPLEMENTATION Executable sequence implementation based on `goulib.sequence.Sequence`: #### Main definition: ```python A003893 = Sequence(math2.fibonacci_gen(mod=10), desc='Fibonacci numbers modulo 10') ``` #### Detail of provided methods: | Function | Expression | Description | | :--- | :--- | :--- | | **`iterf`** | `math2.fibonacci_gen(mod=10)` | Generator iterating over the infinite sequence | | **`itemf(n)`** | *(sequential evaluation)* | Direct computation of $n$-th term | | **`containf(x)`** | *(monotonic search)* | Boolean membership test ($x \in S$) | ### CROSSREFERENCES - Cf. [A000045](A000045), [A010879](A010879), [A089911](A089911), [A105471](A105471), [A105472](A105472). - Cf. [A008963](A008963), [A261606](A261606). - See also the official entry at ### EXTENSIONS AND ERRORS - More terms from [_Ray Chandler_](https://oeis.org/wiki/User:Ray_Chandler), Nov 15 2003