login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A339238 a(1)=a(2)=1 and, for n >= 3, a(n) = a(n-1) + a(n-2) - Sum_{i=3..k} primepi(a(n-i)), where k is the largest integer such that a(n) >=2 and not already in the sequence. 0
1, 1, 2, 3, 5, 7, 9, 10, 12, 11, 15, 13, 14, 16, 18, 22, 28, 19, 20, 30, 25, 39, 21, 33, 42, 36, 38, 50, 45, 40, 23, 34, 57, 29, 54, 35, 17, 52, 58, 66, 49, 77, 92, 61, 68, 51, 101, 37, 8, 45, 41, 44, 55, 72, 70, 43, 93, 67, 91, 120, 85, 105, 117, 69, 63, 75 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
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
Sequence in context: A117284 A137377 A274793 * A168543 A026277 A201804
KEYWORD
nonn
AUTHOR
Ya-Ping Lu, Nov 28 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 12:14 EDT 2024. Contains 371792 sequences. (Running on oeis4.)