OFFSET
1,1
COMMENTS
This sequence is similar to Fibonacci sequence except that, if a(n) = a(n-1) + a(n-2) is not a prime, the prime numbers < a(n-2) are added to a(n-1)+a(n-2) sequentially starting from the largest prime number < a(n-2) until the sum becomes a prime.
If the prime numbers added to a(n-1)+a(n-2) are limited to the terms < a(n-2) that are already in the sequence including a(0)=1, we would have a new sequence with 9 terms only: 2, 3, 5, 11, 19, 41, 71, 131, 281. [See also the comment in A175211. - Peter Munn, Apr 01 2025]
Although a(0)=1 is an anchor for the sequence, a(0) does not appear in the sequence because the obvious intent is to construct a sequence of primes. - R. J. Mathar, Jun 18 2021
Conjecture: This sequence is infinite. - Ya-Ping Lu, Apr 02 2025
FORMULA
a(n) = a(n-1) + a(n-2) + Sum{i=1..m-s}prime(m-i), where a(-1) = a(0) = prime(0) = 1, m = pi(a(n-2)), and s = max(0, 1, 2, ..., m) such that a(n) is prime.
EXAMPLE
a(1) = a(0) + a(-1) = 1 + 1 = 2;
a(2) = a(1) + a(0) = 2 + 1 = 3;
a(3) = a(2) + a(1) = 3 + 2 = 5;
a(4) = a(3) + a(2) + prime(pi(a(2))-1) + prime(pi(a(2))-2) = 5 + 3 + prime(1) + prime(0) = 8 + 2 + 1 = 11;
a(5) = a(4) + a(3) + prime(pi(a(3))-1) = 11 + 5 + prime(2) = 16 + 3 = 19;
a(15) = a(14) + a(13) + prime(pi(a(13))-1) + prime(pi(a(13))-2) + prime(pi(a(13))-3) + prime(pi(a(13))-4) + prime(pi(a(13))-5) = 987713 + 50857 + prime(5208) + prime(5207) + prime(5206) + prime(5205) + prime(5204) = 1038570 + 50849 + 50839 + 50833 + 50821 + 50789 = 1292701.
PROG
(Python)
from sympy import isprime, prevprime; a_2 = a_1 = 1
for _ in range(28):
a = a_2 + a_1; b = a_2
while not isprime(a): b = prevprime(b) if b > 2 else 1 if b == 2 else exit(); a += b
print(a, end = ', '); a_2 = a_1; a_1 = a # Ya-Ping Lu, Apr 02 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Aug 25 2020
STATUS
approved
