login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = Fibonacci(n - 1) modulo the n-th prime number.
2

%I #30 Sep 08 2022 08:45:27

%S 1,1,2,3,5,8,13,21,5,24,15,21,18,1,27,43,11,38,63,49,44,32,88,2,83,59,

%T 73,76,79,63,113,9,94,61,6,123,76,149,127,34,74,124,32,83,1,3,91,212,

%U 204,232,85,76,171,141,148,234,145,38,2,271,208,179,194,73,14,127,177

%N a(n) = Fibonacci(n - 1) modulo the n-th prime number.

%H Vincenzo Librandi, <a href="/A121104/b121104.txt">Table of n, a(n) for n = 2..5000</a>

%F a(n) = Fibonacci(n - 1) modulo Prime(n).

%e a(10)=5 because the 9th Fibonacci=34, the 10th Prime=29, and 34 mod 29=5.

%t With[{nn=70},Mod[First[#],Last[#]]&/@Thread[{Fibonacci[Range[nn-1]], Prime[ Range[2,nn]]}]] (* _Harvey P. Dale_, Feb 27 2013 *)

%t Table[Mod[Fibonacci[n - 1], Prime[n]], {n, 2, 70}] (* _Vincenzo Librandi_, Jun 19 2017 *)

%o (PARI) a(n) = fibonacci(n-1) % prime(n); \\ _Michel Marcus_, Jun 18 2017

%o (PARI) fibmod(n, m)=((Mod([1, 1; 1, 0], m))^n)[1, 2]

%o a(n)=lift(fibmod(n-1,prime(n))) \\ _Charles R Greathouse IV_, Jun 19 2017

%o (Magma) [Fibonacci(n-1) mod NthPrime(n): n in [2..70]]; // _Vincenzo Librandi_, Jun 19 2017

%Y Cf. A000040, A000045, A072123.

%K nonn

%O 2,3

%A _Gil Broussard_, Aug 12 2006