OFFSET
1,3
FORMULA
a(n) = a(n-1) + a(n-2) - Sum_{i=3..k} primepi(a(n-i)), where a(1)=a(2)=1 and k<=n-3 such that a(n) >= 2 and not in {a(i), i=1..n-1}.
PROG
(Python)
from sympy import primepi
a_1 = a_2 = 1
print(a_2, "\n", a_1)
list1 = [a_1, a_2]
for n in range(3, 1001):
a = a_1 + a_2
i = 2
while i < len(list1):
d = a - primepi(list1[i])
if d >= 2 and d not in list1: a = d
else: break
i += 1
list1.insert(0, a)
a_2 = a_1
a_1 = a
print(a)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Nov 28 2020
STATUS
approved