OFFSET
1,2
COMMENTS
Except for a(2), identical to A022940. - Ivan Neretin, Apr 05 2016
LINKS
Nathaniel Johnston, Table of n, a(n) for n = 1..10000
MAPLE
a[1]:=1: a[2]:=2: c[1]:=3: for n from 2 to 70 do c[n]:=c[n-1]+1: for k from 1 to n do if(c[n]<=a[k])then if(c[n]=a[k])then c[n]:=c[n]+1: fi: break: fi: od: a[n+1]:=a[n]+c[n-1]: od: seq(a[n], n=1..70); # Nathaniel Johnston, May 01 2011
MATHEMATICA
Fold[Append[#1, #1[[-1]] + Complement[Range[Max@#1 + 1], #1][[#2]]] &, {1, 2}, Range[50]] (* Ivan Neretin, Apr 04 2016 *)
PROG
(Haskell)
import Data.List (delete)
a022941 n = a022941_list !! (n-1)
a022941_list = 1 : 2 : f 2 [3..] where
f x (z:zs) = y : f y (delete y zs) where y = x + z
-- Reinhard Zumkeller, May 17 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(27) inserted by Nathaniel Johnston, May 01 2011
STATUS
approved