login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Array read by antidiagonals, m, n >= 1: T(m,n) is 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

%I #9 Sep 20 2021 11:49:30

%S 2,3,3,7,0,5,5,5,5,5,11,0,0,0,7,7,7,7,7,7,7,23,0,13,0,11,0,17,17,41,0,

%T 23,13,0,11,19,19,0,17,0,0,0,13,0,11,11,11,11,11,11,11,11,11,11,11,23,

%U 0,0,0,19,0,17,0,0,0,13,13,13,13,13,13,13,13,13,13,13,13,13

%N Array read by antidiagonals, m, n >= 1: T(m,n) is 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 There are cases where T(m,n) = 0 even when m and n are coprime; see A082411, A083104, A083105, A083216, and A221286. The smallest (in the sense that m+n is as small as possible) known case where this occurs appears to be m = 106276436867, n = 35256392432 (Vsemirnov's sequence, A221286).

%F T(m,n) = 0 if m and n have a common factor.

%F T(m,n) = T(n,m+n) if m+n is not prime, otherwise T(m,n) = m+n.

%e Array begins:

%e m\n| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

%e ---+---------------------------------------------------

%e 1 | 2 3 7 5 11 7 23 17 19 11 23 13 41 29 31 17

%e 2 | 3 0 5 0 7 0 41 0 11 0 13 0 43 0 17 0

%e 3 | 5 5 0 7 13 0 17 11 0 13 103 0 29 17 0 19

%e 4 | 5 0 7 0 23 0 11 0 13 0 41 0 17 0 19 0

%e 5 | 7 7 11 13 0 11 19 13 23 0 43 17 31 19 0 37

%e 6 | 7 0 0 0 11 0 13 0 0 0 17 0 19 0 0 0

%e 7 | 17 11 13 11 17 13 0 23 41 17 29 19 53 0 37 23

%e 8 | 19 0 11 0 13 0 37 0 17 0 19 0 89 0 23 0

%e 9 | 11 11 0 13 19 0 23 17 0 19 31 0 149 23 0 41

%e 10 | 11 0 13 0 0 0 17 0 19 0 53 0 23 0 0 0

%e 11 | 13 13 17 19 37 17 43 19 29 31 0 23 37 103 41 43

%e 12 | 13 0 0 0 17 0 19 0 0 0 23 0 101 0 0 0

%e 13 | 29 17 19 17 23 19 47 29 31 23 59 37 0 41 43 29

%e 14 | 31 0 17 0 19 0 0 0 23 0 61 0 67 0 29 0

%e 15 | 17 17 0 19 0 0 29 23 0 0 37 0 41 29 0 31

%e 16 | 17 0 19 0 47 0 23 0 59 0 103 0 29 0 31 0

%e T(2,7) = 41, because the first prime in A022113, excluding the two initial terms, is 41.

%o (Python)

%o # 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 from sympy import isprime,gcd

%o def A347904(m,n):

%o if gcd(m,n) != 1:

%o return 0

%o m,n = n,m+n

%o while not isprime(n):

%o m,n = n,m+n

%o return n

%Y Cf. A022113, A082411, A083104, A083105, A083216, A221286, A347905.

%K nonn,tabl

%O 1,1

%A _Pontus von Brömssen_, Sep 18 2021