OFFSET
0,3
EXAMPLE
a(a(3)) = a(10) = 6 = 3*4/2.
MATHEMATICA
nmax = 58; amax = 2000; tri[n_] := n*(n+1)/2; triQ[n_] := triQ[n] = Resolve[ Exists[ k, Reduce[ k > 0 && n == tri[k], k, Integers] ] ]; t = {{0, a[0] = 0}, {1, a[1] = 1}, {2, a[2]}}; While[ !FreeQ[t, a], t = Table[ {n, a[n]}, {n, 0, nmax}]; n = Select[t, !IntegerQ[#[[2]]]& , 1][[1, 1]]; t2 = Union[ Flatten[ Append[ Select[ t, IntegerQ[ #[[2]] ] & ], n] ] ]; an = If[ n == 2, 4, Select[ Complement[ Range[ Max[t2] ], t2], !triQ[#]&, 1][[1]]]; a[n] = an; While[ an < amax, an = a[n = an] = tri[n] ] ]; A054048 = Table[ a[n], {n, 0, nmax}] (* Jean-François Alcover, Jan 05 2012 *)
CROSSREFS
KEYWORD
base,nice,nonn
AUTHOR
Henry Bottomley, Apr 28 2000
STATUS
approved