login
a(n) = Fibonacci(n) mod n*(n+1).
2

%I #16 Sep 16 2024 12:38:44

%S 1,1,2,3,5,8,13,21,34,55,89,144,51,167,130,171,67,190,1,45,320,1,505,

%T 168,275,649,614,319,59,620,125,837,376,407,485,1296,1331,419,466,

%U 1435,1231,1420,1289,1653,830,2069,2161,1344,1849,1975,746,1167,1589,872,2645,2205

%N a(n) = Fibonacci(n) mod n*(n+1).

%H Alois P. Heinz, <a href="/A217737/b217737.txt">Table of n, a(n) for n = 1..10000</a>

%F A000045(n) modulo A002378(n).

%p a:= proc(n) local r, M, p, m; r, M, p, m:=

%p <<1|0>, <0|1>>, <<0|1>, <1|1>>, n, n*(n+1);

%p do if irem(p, 2, 'p')=1 then r:= r.M mod m fi;

%p if p=0 then break fi; M:= M.M mod m

%p od; r[1, 2]

%p end:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Nov 26 2016

%t Table[Mod[Fibonacci[n],n(n+1)],{n,60}] (* _Harvey P. Dale_, Oct 02 2017 *)

%o (Python)

%o prpr, prev = 0, 1

%o for i in range(1, 333):

%o cur = prpr + prev

%o print(str(prev % (i*(i+1))), end=', ')

%o prpr, prev = prev, cur

%o (PARI) a(n)=fibonacci(n)%(n*(n+1)) \\ _Charles R Greathouse IV_, Jun 23 2017

%Y Cf. A000045, A002708, A121343, A132634, A132636.

%K nonn,easy

%O 1,3

%A _Alex Ratushnyak_, Mar 22 2013