OFFSET
1,7
COMMENTS
The formula given and the sequence itself must use the same convention on "between" and what to do if one or both Fibonacci numbers are themselves prime. - Jonathan Vos Post, Mar 08 2010
With the given sequence data, we see that neither endpoint is included, so we count primes p in the open interval F(n)<p<F(n+1) only. - Jeppe Stig Nielsen, Jun 06 2015
LINKS
FORMULA
a(n) = PrimePi(F(n+1)-1) - PrimePi(F(n)) = A000720(A000045(n+1)-1) - A000720(A000045(n)). - Jonathan Vos Post, Mar 08 2010; corrected by Jeppe Stig Nielsen, Jun 06 2015
a(n) ~ phi^(n-1)/(n*sqrt(5)*log(phi)), where phi = (1+sqrt(5))/2 is the golden ratio. - Charles R Greathouse IV, Jun 08 2015
a(n) = A054782(n+1) - A054782(n) - [n+1 in A001605], where [] denotes the Iverson bracket. - Amiram Eldar, Jun 10 2024
EXAMPLE
Between Fib(9)=34 and Fib(10)=55 we find the following primes: 37, 41, 43, 47 and 53 hence a(9)=5.
MAPLE
for n from 1 to 43 do T[n]:= numtheory:-pi(combinat:-fibonacci(n)) od:
seq(T[n]-T[n-1]-`if`(isprime(combinat:-fibonacci(n)), 1, 0), n=2..43); # Robert Israel, Jun 08 2015
MATHEMATICA
lst={}; Do[p=0; Do[If[PrimeQ[a], p++ ], {a, Fibonacci[n]+1, Fibonacci[n+1]-1}]; AppendTo[lst, p], {n, 50}]; lst (* Vladimir Joseph Stephan Orlovsky, Nov 23 2009 *)
pbf[n_]:=Module[{fib1=If[PrimeQ[Fibonacci[n+1]], PrimePi[Fibonacci[n+1]-1], PrimePi[ Fibonacci[n+1]]], fib0=If[PrimeQ[Fibonacci[n]], PrimePi[ Fibonacci[n]+1], PrimePi[Fibonacci[n]]]}, Max[0, fib1-fib0]]; Array[pbf, 50] (* Harvey P. Dale, Mar 01 2012 *)
PROG
(Haskell)
a052011 n = a052011_list !! (n-1)
a052011_list = c 0 0 $ drop 2 a000045_list where
c x y fs'@(f:fs) | x < f = c (x+1) (y + a010051 x) fs'
| otherwise = y : c (x+1) 0 fs
-- Reinhard Zumkeller, Dec 18 2011
(PARI) a(n)=my(s); forprime(p=fibonacci(n)+1, fibonacci(n+1)-1, s++); s \\ Charles R Greathouse IV, Jun 08 2015
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
Patrick De Geest, Nov 15 1999
STATUS
approved