OFFSET
1,4
COMMENTS
Useful for computing A232749.
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}]];
a46[n_] := For[k = 1, True, k++, If[A5228[[k]] > n, Return[k-1]]];
a[n_] := a[n] = If[n == 1, 0, a[n-1] + (1 - (a46[n] - a46[n-1]))];
Array[a, nmax] (* Jean-François Alcover, Dec 09 2021 *)
PROG
(Scheme, with memoization macro definec from Antti Karttunen's IntSeq-library)
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 30 2013
STATUS
approved