OFFSET
1,5
COMMENTS
Superimpose Fibonacci sequence over the prime sequence (ignoring first two Fibonacci terms); subtract the prime term from the Fibonacci term.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
Line up Fibonacci sequence above the prime sequence so that the 2,3,5, terms are one above the other. Then subtract the prime terms from the Fibonacci.
EXAMPLE
a(6)=8 because prime term 13 subtracted from Fibonacci term 21 = 8.
MATHEMATICA
Table[Fibonacci[2 + n] - Prime[n], {n, 40}] (* Harvey P. Dale, Sep 05 2015 *)
PROG
(UBASIC) 10 'Fibo Fib-Prm 20 P=1:A=1:B=1:Q=Q+1 30 C=A+B:E=nxtprm(P):print C-E; :P=E 40 D=B+C:E=nxtprm(P):print D-E; :P=E 50 Q=Q+1 60 A=C:B=D:if Q<40 then 30 ' Enoch Haga, May 05 2009
(Magma) [Fibonacci(n+2) - NthPrime(n): n in [1..40]]; // Vincenzo Librandi, May 20 2016
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, May 04 2009; corrected May 05 2009
STATUS
approved