cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A138185 Smallest prime >= n-th Fibonacci number.

Original entry on oeis.org

2, 2, 2, 2, 3, 5, 11, 13, 23, 37, 59, 89, 149, 233, 379, 613, 991, 1597, 2591, 4201, 6779, 10949, 17713, 28657, 46381, 75029, 121403, 196429, 317827, 514229, 832063, 1346273, 2178313, 3524603, 5702897, 9227479, 14930387, 24157823, 39088193
Offset: 0

Views

Author

Colm Mulcahy, Mar 04 2008

Keywords

Examples

			a(6) = 11 because 11 is the smallest prime not less than 8 (the 6th Fibonacci number).
		

Crossrefs

Cf. A138184.

Programs

  • Maple
    with(combinat): a:=proc(n) if isprime(fibonacci(n))=true then fibonacci(n) else nextprime(fibonacci(n)) end if end proc: seq(a(n),n=0..35); # Emeric Deutsch, Mar 31 2008
  • Mathematica
    fib[0] = 0; fib[1] = 1; fib[n_] := fib[n] = fib[n - 1] + fib[n - 2] nextprime[n_] := Module[{k = n},While[Not[PrimeQ[k]], k++ ]; k] Table[nextprime[fib[n]], {n, 0, 50}] (* Erich Friedman, Mar 26 2008 *)
    NextPrime/@(Fibonacci[Range[0,50]]-1) (* Harvey P. Dale, Nov 23 2011 *)

Extensions

More terms from Erich Friedman and Emeric Deutsch, Mar 26 2008
Changed the definition of Fibonacci number to F(0) = 0, F(1) = 1, which is the standard definition. - Harry J. Smith, Jan 06 2009

A180422 Largest prime immediately preceding a Fibonacci number.

Original entry on oeis.org

2, 3, 7, 11, 19, 31, 53, 83, 139, 229, 373, 607, 983, 1583, 2579, 4177, 6763, 10939, 17707, 28649, 46351, 75017, 121379, 196387, 317797, 514219, 832003, 1346249, 2178283, 3524569, 5702867, 9227443, 14930341, 24157811, 39088157, 63245971
Offset: 4

Views

Author

Carmine Suriano, Sep 03 2010

Keywords

Comments

Limit ratio of two consecutive elements of this sequence is phi=1.61803... the golden ratio.

Examples

			a(7)=53 that is the prime number preceding 55=fib(10).
fib(1)=1, fib(2)=1 and fib(3)=2 are not accounted.
		

Crossrefs

Programs

  • Mathematica
    NextPrime[#,-1]&/@Fibonacci[Range[4,40]] (* Harvey P. Dale, Oct 31 2013 *)
  • PARI
    a(n)=precprime(fibonacci(n)-1)

Extensions

Program and cross-ref from Charles R Greathouse IV, Sep 08 2010

A375751 a(n) is the difference between F=A000045(n) and the largest prime not exceeding F.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Aug 27 2024

Keywords

Crossrefs

Programs

  • 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 *)
  • 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

Formula

a(n) = A000045(n) - A138184(n).
a(n) = 0 <=> n in { A001605 }. - Alois P. Heinz, Aug 27 2024
Showing 1-3 of 3 results.