A338827 For any number with decimal representation (d(1), d(2), ..., d(k)), the decimal representation of a(n) is (abs(d(1)-d(k)), abs(d(2)-d(k-1)), ..., abs(d(k)-d(1))).
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 11, 22, 33, 44, 55, 66, 77, 88, 22, 11, 0, 11, 22, 33, 44, 55, 66, 77, 33, 22, 11, 0, 11, 22, 33, 44, 55, 66, 44, 33, 22, 11, 0, 11, 22, 33, 44, 55, 55, 44, 33, 22, 11, 0, 11, 22, 33, 44, 66, 55, 44, 33, 22, 11, 0, 11, 22
Offset: 0
Examples
For n = 1021: - abs(1-1) = 0, - abs(0-2) = 2, - abs(2-0) = 2, - abs(1-1) = 0, - so a(1021) = 220.
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
Maple
a:= n-> (l-> (h-> add(h[j]*10^(j-1), j=1..nops(h)))([seq( abs(l[i]-l[-i]), i=1..nops(l))]))(convert(n, base, 10)): seq(a(n), n=0..70); # Alois P. Heinz, Nov 12 2020
-
PARI
a(n, base=10) = my (d=digits(n, base)); fromdigits(abs(d-Vecrev(d)), base)
Comments