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.

A347905 Array read by antidiagonals, m, n >= 1: T(m,n) is the position of the first prime (after the two initial terms) in the Fibonacci-like sequence with initial terms m and n, or 0 if no such prime exists.

This page as a plain text file.
%I A347905 #10 Sep 20 2021 11:50:03
%S A347905 2,2,2,3,0,3,2,2,2,2,3,0,0,0,3,2,2,2,2,2,2,4,0,3,0,3,0,4,3,5,0,4,3,0,
%T A347905 3,4,3,0,3,0,0,0,3,0,3,2,2,2,2,2,2,2,2,2,2,3,0,0,0,3,0,3,0,0,0,3,2,2,
%U A347905 2,2,2,2,2,2,2,2,2,2,4,0,6,0,3,0,0,0,3,0,3,0,4
%N A347905 Array read by antidiagonals, m, n >= 1: T(m,n) is the position of the first prime (after the two initial terms) in the Fibonacci-like sequence with initial terms m and n, or 0 if no such prime exists.
%C A347905 There are cases where T(m,n) = 0 even when m and n are coprime; see A082411, A083104, A083105, A083216, and A221286.
%C A347905 The largest value of T(m,n) for m, n <= 5000 is T(1591,300) = 17262.
%F A347905 T(m,n) = 0 if m and n have a common factor.
%F A347905 T(m,n) = T(n,m+n) + 1 if m+n is not prime, otherwise T(m,n) = 2.
%e A347905 Array begins:
%e A347905   m\n|  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
%e A347905   ---+------------------------------------------------------------
%e A347905    1 |  2  2  3  2  3  2  4  3  3  2  3  2  4  3  3  2  4  2  4  3
%e A347905    2 |  2  0  2  0  2  0  5  0  2  0  2  0  4  0  2  0  2  0  4  0
%e A347905    3 |  3  2  0  2  3  0  3  2  0  2  6  0  3  2  0  2  3  0  3  2
%e A347905    4 |  2  0  2  0  4  0  2  0  2  0  4  0  2  0  2  0  4  0  2  0
%e A347905    5 |  3  2  3  3  0  2  3  2  3  0  4  2  3  2  0  3  4  2  3  0
%e A347905    6 |  2  0  0  0  2  0  2  0  0  0  2  0  2  0  0  0  2  0  5  0
%e A347905    7 |  4  3  3  2  3  2  0  3  4  2  3  2  4  0  3  2  3  3  4  3
%e A347905    8 |  4  0  2  0  2  0  4  0  2  0  2  0  5  0  2  0  4  0  4  0
%e A347905    9 |  3  2  0  2  3  0  3  2  0  2  3  0  6  2  0  3  3  0  3  2
%e A347905   10 |  2  0  2  0  0  0  2  0  2  0  4  0  2  0  0  0  4  0  2  0
%e A347905   11 |  3  2  3  3  4  2  4  2  3  3  0  2  3  5  3  3  4  2  4  2
%e A347905   12 |  2  0  0  0  2  0  2  0  0  0  2  0  5  0  0  0  2  0  2  0
%e A347905   13 |  4  3  3  2  3  2  4  3  3  2  4  3  0  3  3  2  3  2  4  3
%e A347905   14 |  4  0  2  0  2  0  0  0  2  0  4  0  4  0  2  0  2  0  5  0
%e A347905   15 |  3  2  0  2  0  0  3  2  0  0  3  0  3  2  0  2  6  0  3  0
%e A347905   16 |  2  0  2  0  4  0  2  0  4  0  5  0  2  0  2  0  4  0  4  0
%e A347905   17 |  3  2  3  5 10  2  3  6  4  3  4  2  3  2  3  5  0  3  7  2
%e A347905   18 |  2  0  0  0  2  0  5  0  0  0  2  0  2  0  0  0  5  0  2  0
%e A347905   19 |  4  3  4  2  3  3  4  5  3  2  3  2  6  3  4  5  3  2  0  3
%e A347905   20 |  4  0  2  0  0  0  4  0  2  0  2  0  4  0  0  0  2  0  4  0
%e A347905 T(2,7) = 5, because 5 is the smallest k >= 2 for which A022113(k) is prime.
%o A347905 (Python)
%o A347905 # Note that in the (rare) case when m and n are coprime but there are no primes in the Fibonacci-like sequence, this function will go into an infinite loop.
%o A347905 from sympy import isprime,gcd
%o A347905 def A347905(m,n):
%o A347905     if gcd(m,n) != 1:
%o A347905         return 0
%o A347905     m,n = n,m+n
%o A347905     k=2
%o A347905     while not isprime(n):
%o A347905         m,n = n,m+n
%o A347905         k += 1
%o A347905     return k
%Y A347905 Cf. A022113, A082411, A083104, A083105, A083216, A221286, A347904.
%K A347905 nonn,tabl
%O A347905 1,1
%A A347905 _Pontus von Brömssen_, Sep 18 2021