OFFSET
1,4
COMMENTS
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]]];
a48[n_] := a48[n] = If[n == 1, 0, a48[n-1] + (1 - (a46[n] - a46[n - 1]))];
a[n_] := If[n == 1, 0, a48[n] (a48[n] - a48[n - 1])];
Array[a, nmax] (* Jean-François Alcover, Dec 09 2021 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 30 2013
STATUS
approved