OFFSET
1,2
COMMENTS
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..1000
EXAMPLE
a(13) = 10 because Sum_{i=1..10} Fibonacci(i) = 1+1+2+3+5+8+13+21+34+55 = 143 = 11*13 is divisible by 13. Or 13 | A000071(12) => 13|143.
MAPLE
fib:= gfun:-rectoproc({f(0)=0, f(1)=1, f(n)=f(n-1)+f(n-2)}, f(n), remember):
a:= proc(n) local k; for k from 1 do if fib(k+2)-1 mod n = 0 then return k fi od end proc:
seq(a(i), i=1..1000); # Robert Israel, Nov 03 2015
MATHEMATICA
Table[s=0; k=0; While[k++; s=Mod[s+Fibonacci[k], n]; s>0]; k, {n, 100}]
Module[{nn=100, sk}, sk=Thread[{Accumulate[Fibonacci[Range[2nn]]], Range[ 2nn]}]; Table[SelectFirst[sk, Divisible[#[[1]], n]&], {n, nn}]][[All, 2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 10 2020 *)
PROG
(PARI) a(n) = {k=1; while(k, if( (fibonacci(k+2)-1) % n == 0, return(k)); k++)} \\ Altug Alkan, Nov 05 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Nov 03 2015
STATUS
approved