OFFSET
1,2
LINKS
FORMULA
If n mod 10 = 0 then a(n) = a(n/10), otherwise a(n) = n mod 10.
EXAMPLE
a(3)=3, a(23)=3, a(30)=3, a(12300)=3.
MATHEMATICA
um10[n_]:=Module[{idns=Split[IntegerDigits[n]]}, If[idns[[-1, 1]] == 0, idns[[-2, 1]], idns[[-1, 1]]]]; Array[um10, 110] (* Harvey P. Dale, Dec 26 2016 *)
PROG
(PARI) { for (n=1, 1000, a=n; while (a%10 == 0, a\=10); write("b065881.txt", n, " ", a%10) ) } \\ Harry J. Smith, Nov 03 2009
(Python)
def A065881(n): return int(str(n).rstrip('0')[-1]) # Chai Wah Wu, Dec 07 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Henry Bottomley, Nov 26 2001
STATUS
approved