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.

A338762 Greatest prime Fibonacci divisor of F(n)^2 + 1 where F(n) is the n-th Fibonacci number, or 0 if no such prime factor exists.

Original entry on oeis.org

2, 2, 5, 5, 13, 13, 5, 13, 89, 89, 233, 233, 89, 233, 1597, 1597, 5, 1597, 1597, 13, 28657, 28657, 13, 28657, 28657, 5, 514229, 514229, 2, 514229, 514229, 89, 13, 89, 89, 13, 233, 233, 0, 233, 433494437, 433494437, 5, 433494437, 2971215073, 2971215073, 13, 2971215073
Offset: 1

Views

Author

Michel Lagneau, Nov 07 2020

Keywords

Comments

a(n) = 0 for n = 39, 60, 69, 72, ... .
a(5385) has 1126 decimal digits. - Chai Wah Wu, Nov 19 2020

Examples

			a(6) = 13 because F(6)^2 + 1 = 8^2 + 1 = 65 = 5*13 and 13 is the greatest prime Fibonacci divisor.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local F, m, t; F, m, t:=
          [1, 2], 0, (<<0|1>, <1|1>>^n)[2, 1]^2+1;
          while F[2]<=t do if isprime(F[2]) and irem(t, F[2])=0
            then m:=F[2] fi; F:= [F[2], F[1]+F[2]]
          od; m
        end:
    seq(a(n), n=1..50);  # Alois P. Heinz, Nov 07 2020
  • Mathematica
    a[n_] := Module[{F, m, t}, F = {1, 2}; m = 0; t = MatrixPower[{{0, 1}, {1, 1}}, n][[2, 1]]^2 + 1; While[F[[2]] <= t, If[PrimeQ[F[[2]]] && Mod[t, F[[2]]] == 0, m = F[[2]]]; F = {F[[2]], F[[1]] + F[[2]]}]; m];
    Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Feb 09 2025, after Alois P. Heinz *)
  • PARI
    isfib(n) = my(k=n^2); k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8));
    a(n) = my(f=factor(fibonacci(n)^2+1)[,1]~, v=select(x->isfib(x), f)); if (#v, vecmax(v), 0); \\ Michel Marcus, Nov 07 2020