OFFSET
0,2
COMMENTS
This is the same as a(n) = 1*n in the arithmetic defined in A169918 (cf. A169930). - M. F. Hasler, Mar 25 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..90000
FORMULA
a(A002283(n)) = 0. - Reinhard Zumkeller, Feb 21 2014
EXAMPLE
a(8) = 9.
a(9) = 0.
a(10) = 21 because the original 1 is changed to a 2 and the 0 is changed to a 1.
MATHEMATICA
Table[FromDigits[ReplaceAll[IntegerDigits[n] + 1, 10 -> 0]], {n, 0, 79}] (* Alonso del Arte, Feb 27 2014 *)
PROG
(Haskell)
a048379 n = if n == 0 then 1 else x n where
x m = if m == 0 then 0 else 10 * x m' + (d + 1) `mod` 10
where (m', d) = divMod m 10
-- Reinhard Zumkeller, Feb 21 2014
(PARI) A048379(n)=n+sum(i=1, #n=digits(n), if(n[i]<9, 10^(i-1), -9*10^(i-1))) \\ M. F. Hasler, Mar 21 2015
(PARI) A048379(n)=!n+apply(t->(t+1)%10, n=digits(n))*vector(#n, i, 10^(#n-i))~ \\ M. F. Hasler, Mar 21 2015
(Python)
d = {ord(str(i)):ord(str((i+1)%10)) for i in range(10)}
def a(n): return int(str(n).translate(d))
print([a(n) for n in range(72)]) # Michael S. Branicky, Dec 20 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Patrick De Geest, Mar 15 1999
STATUS
approved