OFFSET
1,4
LINKS
T. D. Noe, Table of n, a(n) for n=1..1000
FORMULA
EXAMPLE
a(6)=3 because the 6th Fibonacci term is 8 and the distance to nextprime(6) is 3 (11-8=3).
MAPLE
A159978 := proc(n) local f; f := combinat[fibonacci](n) ; nextprime(f)-f ; end: seq(A159978(n), n=1..100) ; # R. J. Mathar, Apr 29 2009
MATHEMATICA
Table[f = Fibonacci[n]; NextPrime[f] - f, {n, 200}] (* Vladimir Joseph Stephan Orlovsky, Jul 08 2011 *)
PROG
(UBASIC) 10 'FiboB 20 A=1:print A; 30 B=1:print B; 40 C=A+B:print C; :T=T+1:print "<"; nxtprm(C)-C; ">"; 50 D=B+C:print D; :print "<"; nxtprm(D)-D; ">"; 60 A=C:B=D:if T>22 then stop:else 40
(PARI) a(n) = my(f=fibonacci(n)); nextprime(f+1) - f; \\ Michel Marcus, Sep 22 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Apr 28 2009
EXTENSIONS
Extended by R. J. Mathar, Apr 29 2009
STATUS
approved