OFFSET
0,3
COMMENTS
a(n) = n when 0 <= n < 20 or 10^i <= n < 10^i + 20 for some i>1.
a(n) = n if and only if every digit of n (in base 10), except possibly the ones digit, is 0 or 1. Otherwise, n < a(n). - Danny Rorabaugh, Apr 02 2015
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
EXAMPLE
a(19) = 1^2 * 10^1 + 9^1 * 10^0 = 19.
a(20) = 2^2 * 10^1 + 0^1 * 10^0 = 40.
a(40) = 4^2 * 10^1 + 0^1 * 10^0 = 160.
a(199) = 1^3 * 10^2 + 9^2 * 10^1 + 9^1 * 10^0 = 100 + 810 + 9 = 919.
MATHEMATICA
Array[Total@ MapIndexed[#1^(#2)*10^(#2 - 1) & @@ {#1, First[#2]} &, Reverse@ IntegerDigits[#]] &, 71, 0] (* Michael De Vlieger, Nov 16 2022 *)
PROG
(PARI) vector(80, n, d = digits(n); sum(k=1, #d, d[k]^(#d-k+1)*10^(#d-k))) \\ Michel Marcus, Apr 09 2015
CROSSREFS
KEYWORD
base,nonn,easy
AUTHOR
Michael De Vlieger, Apr 02 2015
EXTENSIONS
Name and comments corrected by Paul Tek, Apr 11 2015
STATUS
approved