OFFSET
1,1
MAPLE
A075330 := proc(nmax) local r, s, n, stst, rtst ; r := [1] : s := [] : n := {1} : while nops(r) < nmax do stst := 1 ; while stst in n or stst-op(-1, r) in n or stst+op(-1, r) in n do stst := stst +1 ; od ; s := [op(s), stst] ; n := n union {stst, stst-op(-1, r), stst+op(-1, r)} ; rtst := 1 ; while rtst in n do rtst := rtst +1 ; od ; r := [op(r), rtst] ; n := n union {rtst} ; od : RETURN(s) ; end: A075330(100) ; # R. J. Mathar, Feb 03 2007
MATHEMATICA
A075330[nmax_] := Module[{r = {1}, s = {}, n = {1}, stst, rtst}, While[Length[r] < nmax, stst = 1; While[MemberQ[n, stst] || MemberQ[n, stst - Last[r]] || MemberQ[n, stst + Last[r]], stst++]; s = Append[s, stst]; n = n ~Union~ {stst, stst - Last[r], stst + Last[r]}; rtst = 1; While[MemberQ[n, rtst], rtst++]; r = Append[r, rtst]; n = n ~Union~ {rtst}]; Return[s]];
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Sep 18 2002
EXTENSIONS
More terms from R. J. Mathar, Feb 03 2007
STATUS
approved