OFFSET
1,1
COMMENTS
FORMULA
T(m,n) = 0 if m and n have a common factor.
T(m,n) = T(n,m+n) if m+n is not prime, otherwise T(m,n) = m+n.
EXAMPLE
Array begins:
m\n| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
---+---------------------------------------------------
1 | 2 3 7 5 11 7 23 17 19 11 23 13 41 29 31 17
2 | 3 0 5 0 7 0 41 0 11 0 13 0 43 0 17 0
3 | 5 5 0 7 13 0 17 11 0 13 103 0 29 17 0 19
4 | 5 0 7 0 23 0 11 0 13 0 41 0 17 0 19 0
5 | 7 7 11 13 0 11 19 13 23 0 43 17 31 19 0 37
6 | 7 0 0 0 11 0 13 0 0 0 17 0 19 0 0 0
7 | 17 11 13 11 17 13 0 23 41 17 29 19 53 0 37 23
8 | 19 0 11 0 13 0 37 0 17 0 19 0 89 0 23 0
9 | 11 11 0 13 19 0 23 17 0 19 31 0 149 23 0 41
10 | 11 0 13 0 0 0 17 0 19 0 53 0 23 0 0 0
11 | 13 13 17 19 37 17 43 19 29 31 0 23 37 103 41 43
12 | 13 0 0 0 17 0 19 0 0 0 23 0 101 0 0 0
13 | 29 17 19 17 23 19 47 29 31 23 59 37 0 41 43 29
14 | 31 0 17 0 19 0 0 0 23 0 61 0 67 0 29 0
15 | 17 17 0 19 0 0 29 23 0 0 37 0 41 29 0 31
16 | 17 0 19 0 47 0 23 0 59 0 103 0 29 0 31 0
T(2,7) = 41, because the first prime in A022113, excluding the two initial terms, is 41.
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 A347904(m, n):
if gcd(m, n) != 1:
return 0
m, n = n, m+n
while not isprime(n):
m, n = n, m+n
return n
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Pontus von Brömssen, Sep 18 2021
STATUS
approved