login
A118627
a(1) = a(2) = 1. For n >=3, a(n) = the a(n-2)th integer, among those positive integers which are missing from the first (m-1) terms of the sequence, below a(n-1) if such a positive integer exists. Otherwise, a(n) = the a(n-2)th integer, among those positive integers which are missing from the first (m-1) terms of the sequence, above a(n-1).
0
1, 1, 2, 3, 5, 8, 13, 21, 6, 30, 24, 55, 31, 87, 56, 144, 88, 233, 145, 379, 234, 614, 380, 995, 615, 1611, 996, 2608, 1612, 4221, 2609, 6831, 4222, 11054, 6832, 17887, 11055, 28943, 17888, 46832, 28944, 75777, 46833, 122611, 75778, 198390, 122612, 321003
OFFSET
1,3
EXAMPLE
The first 8 terms of the sequence are 1,1,2,3,5,8,13,21. Those integers which are missing from the first 8 terms of the sequence form the sequence 4,6,7,9,10,11,12,14,15,16,17,18,19,20,.. Counting down from a(8)=21 a total of a(7)=13 positions in this sequence of missing terms, we land on 6. So a(9) = 6.
There are fewer than a(8)=21 missing positive integers below a(9)=6, so we count UP to get a(10). a(10) is what we land on when counting up from 6 a total of a(8)=21 positions, skipping over terms which occur earlier in the sequence. So a(10) = 30.
CROSSREFS
Sequence in context: A137290 A268962 A121104 * A358404 A080787 A065124
KEYWORD
easy,nonn
AUTHOR
Leroy Quet, May 09 2006
EXTENSIONS
More terms from Joshua Zucker, Jul 27 2006
STATUS
approved