login
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.
2
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, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 0, 6, 0, 3, 0, 0, 0, 3, 0, 3, 0, 4
OFFSET
1,1
COMMENTS
There are cases where T(m,n) = 0 even when m and n are coprime; see A082411, A083104, A083105, A083216, and A221286.
The largest value of T(m,n) for m, n <= 5000 is T(1591,300) = 17262.
FORMULA
T(m,n) = 0 if m and n have a common factor.
T(m,n) = T(n,m+n) + 1 if m+n is not prime, otherwise T(m,n) = 2.
EXAMPLE
Array begins:
m\n| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
---+------------------------------------------------------------
1 | 2 2 3 2 3 2 4 3 3 2 3 2 4 3 3 2 4 2 4 3
2 | 2 0 2 0 2 0 5 0 2 0 2 0 4 0 2 0 2 0 4 0
3 | 3 2 0 2 3 0 3 2 0 2 6 0 3 2 0 2 3 0 3 2
4 | 2 0 2 0 4 0 2 0 2 0 4 0 2 0 2 0 4 0 2 0
5 | 3 2 3 3 0 2 3 2 3 0 4 2 3 2 0 3 4 2 3 0
6 | 2 0 0 0 2 0 2 0 0 0 2 0 2 0 0 0 2 0 5 0
7 | 4 3 3 2 3 2 0 3 4 2 3 2 4 0 3 2 3 3 4 3
8 | 4 0 2 0 2 0 4 0 2 0 2 0 5 0 2 0 4 0 4 0
9 | 3 2 0 2 3 0 3 2 0 2 3 0 6 2 0 3 3 0 3 2
10 | 2 0 2 0 0 0 2 0 2 0 4 0 2 0 0 0 4 0 2 0
11 | 3 2 3 3 4 2 4 2 3 3 0 2 3 5 3 3 4 2 4 2
12 | 2 0 0 0 2 0 2 0 0 0 2 0 5 0 0 0 2 0 2 0
13 | 4 3 3 2 3 2 4 3 3 2 4 3 0 3 3 2 3 2 4 3
14 | 4 0 2 0 2 0 0 0 2 0 4 0 4 0 2 0 2 0 5 0
15 | 3 2 0 2 0 0 3 2 0 0 3 0 3 2 0 2 6 0 3 0
16 | 2 0 2 0 4 0 2 0 4 0 5 0 2 0 2 0 4 0 4 0
17 | 3 2 3 5 10 2 3 6 4 3 4 2 3 2 3 5 0 3 7 2
18 | 2 0 0 0 2 0 5 0 0 0 2 0 2 0 0 0 5 0 2 0
19 | 4 3 4 2 3 3 4 5 3 2 3 2 6 3 4 5 3 2 0 3
20 | 4 0 2 0 0 0 4 0 2 0 2 0 4 0 0 0 2 0 4 0
T(2,7) = 5, because 5 is the smallest k >= 2 for which A022113(k) is prime.
PROG
(Python)
# 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.
from sympy import isprime, gcd
def A347905(m, n):
if gcd(m, n) != 1:
return 0
m, n = n, m+n
k=2
while not isprime(n):
m, n = n, m+n
k += 1
return k
KEYWORD
nonn,tabl
AUTHOR
STATUS
approved