login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A138153
If the numbers a(1)...a(n) contain a hole, then a(n+1) is the smallest hole; otherwise a(n+1) = a(n-2) + a(n-1) + a(n).
2
1, 2, 3, 6, 4, 5, 15, 7, 8, 9, 10, 11, 12, 13, 14, 39, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 111, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66
OFFSET
1,2
COMMENTS
This is to A060000 as tribonacci A000073 is to Fibonacci A000045. Let H be the set of positive numbers less than a(n) which are not equal to some a(i), i < n. This H is the 'set of holes so far'. If H is nonempty, then define a(n+1) = minimum(H). Otherwise define a(n+1) = a(n-2) + a(n-1) + a(n). Permutation of the natural numbers with inverse not yet in the OEIS.
LINKS
MATHEMATICA
a[n_] := a[n] = If[n < 4, n, Block[{s = Array[a, n-1]}, s = Complement[ Range[ Max@s], s]; If[s == {}, a[n - 1] + a[n - 2] + a[n - 3], First[s]]]]; Array[a, 80] (* Giovanni Resta, Jun 20 2016 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, May 04 2008
EXTENSIONS
Data corrected by Giovanni Resta, Jun 20 2016
STATUS
approved