OFFSET
1,3
COMMENTS
FORMULA
a(n) = one less than the least k such that A005228(k) > n.
MATHEMATICA
nmax = 100; A5228 = {1}; Module[{d = 2, k = 1}, Do[While[MemberQ[A5228, d], d++]; k += d; d++; AppendTo[A5228, k], {n, 1, nmax}]];
a[n_] := For[k = 1, True, k++, If[A5228[[k]] > n, Return[k-1]]];
Array[a, nmax] (* Jean-François Alcover, Dec 09 2021 *)
PROG
(Scheme, with Antti Karttunen's IntSeq-library)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 30 2013
STATUS
approved