OFFSET
1,2
COMMENTS
a(n) is the number formed by the rightmost A160094(n) digits -- only the position(s) that changed -- of a decimal counter (e.g., an odometer) after it increments from n - 1 to n. - Rick L. Shepherd, Jun 29 2016
LINKS
A. D. Skovgaard, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n mod 10 if n is not a multiple of 10.
From Robert Israel, Aug 08 2016: (Start)
a(10*n) = 10*a(n).
a(10*n+k) = k for 1 <= k <= 9.
G.f. g(x) satisfies g(x) = (x+2x^2+...+9x^9)/(1-x^10) + 10 g(x^10). (End)
EXAMPLE
a(1) = 1 because when 1 is added to 1 - 1 = 0, the units digit changes so the units digit of 1 is shown.
a(110) = 10 because when 1 is added to 109, the tens digit and the units digit change, so the last two digits of 110 are shown.
a(1000) = 1000 because when 1 is added to 999, all the digits change so they are all shown.
MAPLE
f:= n -> n mod 10^(1+min(padic:-ordp(n, 2), padic:-ordp(n, 5))):
map(f, [$1..100]); # Robert Israel, Aug 08 2016
MATHEMATICA
Table[FromDigits@ Join[{Last@ #}, Table[0, {Log10[n/FromDigits@ #]}]] &@ Select[IntegerDigits@ n, # != 0 &], {n, 120}] (* Michael De Vlieger, Jun 29 2016 *)
PROG
(PARI) a(n) = n%10^(valuation(n, 10)+1); \\ David A. Corneth, Jun 29 2016
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
A. D. Skovgaard, Jun 13 2016
STATUS
approved