A104714 Greatest common divisor of a Fibonacci number and its index.
0, 1, 1, 1, 1, 5, 2, 1, 1, 1, 5, 1, 12, 1, 1, 5, 1, 1, 2, 1, 5, 1, 1, 1, 24, 25, 1, 1, 1, 1, 10, 1, 1, 1, 1, 5, 36, 1, 1, 1, 5, 1, 2, 1, 1, 5, 1, 1, 48, 1, 25, 1, 1, 1, 2, 5, 7, 1, 1, 1, 60, 1, 1, 1, 1, 5, 2, 1, 1, 1, 5, 1, 72, 1, 1, 25, 1, 1, 2, 1, 5, 1, 1, 1, 12, 5, 1, 1, 1, 1, 10, 13, 1, 1, 1, 5, 96, 1
Offset: 0
Examples
The natural numbers: 0 1 2 3 4 5 6 7 8 9 10 11 12 ... The Fibonacci numbers: 0 1 1 2 3 5 8 13 21 34 55 89 144 ... The corresponding GCDs: 0 1 1 1 1 5 2 1 1 1 5 1 12 ...
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..20000 (first 1001 terms from T. D. Noe)
- Paolo Leonetti, Carlo Sanna, On the greatest common divisor of n and the nth Fibonacci number, arXiv:1704.00151 [math.NT], 2017.
- Carlo Sanna, Emanuele Tron, The density of numbers n having a prescribed G.C.D. with the nth Fibonacci number, arXiv:1705.01805 [math.NT], 2017.
Crossrefs
Programs
-
Haskell
let fibs@(_ : fs) = 0 : 1 : zipWith (+) fibs fs in 0 : zipWith gcd [1 ..] fs
-
Maple
b:= proc(n) option remember; local r, M, p; r, M, p:= <<1|0>, <0|1>>, <<0|1>, <1|1>>, n; do if irem(p, 2, 'p')=1 then r:= r.M mod n fi; if p=0 then break fi; M:= M.M mod n od; r[1, 2] end: a:= n-> igcd(n, b(n)): seq(a(n), n=0..100); # Alois P. Heinz, Apr 05 2017
-
Mathematica
Table[GCD[Fibonacci[n],n],{n,0,97}] (* Alonso del Arte, Nov 22 2010 *)
-
PARI
a(n)=if(n,gcd(n,lift(Mod([1,1;1,0],n)^n)[1,2]),0) \\ Charles R Greathouse IV, Sep 24 2013
Formula
a(n) = gcd(F(n), n).
Comments