cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A065881 Ultimate modulo 10: right-hand nonzero digit of n.

This page as a plain text file.
%I A065881 #21 Dec 31 2024 14:04:37
%S A065881 1,2,3,4,5,6,7,8,9,1,1,2,3,4,5,6,7,8,9,2,1,2,3,4,5,6,7,8,9,3,1,2,3,4,
%T A065881 5,6,7,8,9,4,1,2,3,4,5,6,7,8,9,5,1,2,3,4,5,6,7,8,9,6,1,2,3,4,5,6,7,8,
%U A065881 9,7,1,2,3,4,5,6,7,8,9,8,1,2,3,4,5,6,7,8,9,9,1,2,3,4,5,6,7,8,9,1,1,2,3,4,5
%N A065881 Ultimate modulo 10: right-hand nonzero digit of n.
%H A065881 Harry J. Smith, <a href="/A065881/b065881.txt">Table of n, a(n) for n = 1..1000</a>
%H A065881 <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a>
%F A065881 If n mod 10 = 0 then a(n) = a(n/10), otherwise a(n) = n mod 10.
%e A065881 a(3)=3, a(23)=3, a(30)=3, a(12300)=3.
%t A065881 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 *)
%o A065881 (PARI) a(n) = { n/10^valuation(n,10)%10 } \\ _Harry J. Smith_, Nov 03 2009
%o A065881 (Python)
%o A065881 def A065881(n): return int(str(n).rstrip('0')[-1]) # _Chai Wah Wu_, Dec 07 2023
%Y A065881 In base 2 this is A000012, base 3 A060236 and base 4 A065882. For n <= 100 this sequence is also "Remove final zeros from n" which in bases 2, 3 and 4 produces A000265, A038502 and A065883. Cf. A010879.
%K A065881 base,nonn
%O A065881 1,2
%A A065881 _Henry Bottomley_, Nov 26 2001