OFFSET
1,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
MAPLE
b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
and (b(n, i-1, t) or i^10<=n and b(n-i^10, i, t-1))
end:
a:= proc(n) option remember; local k;
for k from 1+ `if`(n=1, -1, a(n-1))
while not b(k, iroot(k, 10), 10) do od; k
end:
seq(a(n), n=1..60); # Alois P. Heinz, Sep 16 2016
MATHEMATICA
b[n_, i_, t_] := b[n, i, t] = n == 0 || i > 0 && t > 0 && (b[n, i - 1, t] || i^10 <= n && b[n - i^10, i, t - 1]);
a[n_] := a[n] = (For[k = 1 + If[n == 1, -1, a[n - 1]], !b[k, k^(1/10) // Floor, 10], k++]; k);
Array[a, 60] (* Jean-François Alcover, Apr 06 2017, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Alois P. Heinz, Sep 16 2016
STATUS
approved