login
A375751
a(n) is the difference between F=A000045(n) and the largest prime not exceeding F.
1
0, 0, 0, 1, 0, 2, 3, 2, 0, 5, 0, 4, 3, 4, 0, 5, 4, 2, 7, 4, 0, 17, 8, 14, 31, 14, 0, 37, 20, 26, 9, 20, 22, 11, 6, 12, 15, 32, 18, 17, 0, 16, 43, 24, 0, 17, 20, 26, 27, 20, 6, 9, 12, 34, 29, 36, 30, 47, 48, 4, 45, 32, 54, 27, 132, 22, 31, 4, 32, 11, 12, 60, 7, 76
OFFSET
3,6
LINKS
FORMULA
a(n) = A000045(n) - A138184(n).
a(n) = 0 <=> n in { A001605 }. - Alois P. Heinz, Aug 27 2024
MAPLE
a:= n-> (F-> F-prevprime(F+1))(combinat[fibonacci](n)):
seq(a(n), n=3..76); # Alois P. Heinz, Aug 27 2024
MATHEMATICA
a[n_]:=Module[{p=2}, While[(f=Fibonacci[n])>=p, pold=p; p=NextPrime[p]]; d=f-pold; If[d>0, f-pold, d=0]; d]; Array[a, 74, 3] (* Stefano Spezia, Aug 27 2024 *)
Map[(# - NextPrime[# + 1, -1]) &, Fibonacci[Range[3, 76]]] (* Amiram Eldar, Aug 29 2024 *)
PROG
(PARI) a(n) = my(F=fibonacci(n)); F-precprime(F)
(Python)
from sympy import prevprime, fibonacci
def A375753(n): return (F:=fibonacci(n)) - prevprime(F+1) # Karl-Heinz Hofmann, Aug 27 2024
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Aug 27 2024
STATUS
approved