OFFSET
1,1
COMMENTS
This sequence is finite and has 111 terms, which are given in the b-file.
a(n) == 1 (mod 6) if n > 2. For n = 3 or > 4, b(n) = a(n-i) - 1, where 1 < b < n.
LINKS
Ya-Ping Lu, Table of n, a(n) for n = 1..111
EXAMPLE
For n = 6, the first 6 terms are [3, 5, 7, 13, 19, 31] and, in the list [19+-1, 13+-1, 7+-1, 5+-1, 3+-1], 13-1 is the largest number that gives a prime when added to a(6). Thus, b(6) = 13 - 1 = 12 and b(7) = a(6) + b(6) = 43.
PROG
(Python)
from sympy import isprime; L = [3, 5]
while 1:
for j in range(2, len(L)+1):
s = L[-1] + L[-j]
if isprime(s+1): L.append(s+1); break
elif isprime(s-1): L.append(s-1); break
else: break
print(*L, sep = ', ')
CROSSREFS
KEYWORD
fini,nonn,full
AUTHOR
Ya-Ping Lu, Apr 10 2022
STATUS
approved