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.

A048379 Apply the transformation 0->1->2->3->4->5->6->7->8->9->0 to digits of n.

This page as a plain text file.
%I A048379 #30 Dec 21 2022 09:19:31
%S A048379 1,2,3,4,5,6,7,8,9,0,21,22,23,24,25,26,27,28,29,20,31,32,33,34,35,36,
%T A048379 37,38,39,30,41,42,43,44,45,46,47,48,49,40,51,52,53,54,55,56,57,58,59,
%U A048379 50,61,62,63,64,65,66,67,68,69,60,71,72,73,74,75,76,77,78,79,70,81,82
%N A048379 Apply the transformation 0->1->2->3->4->5->6->7->8->9->0 to digits of n.
%C A048379 This is the same as a(n) = 1*n in the arithmetic defined in A169918 (cf. A169930). - _M. F. Hasler_, Mar 25 2015
%H A048379 Reinhard Zumkeller, <a href="/A048379/b048379.txt">Table of n, a(n) for n = 0..90000</a>
%F A048379 a(A002283(n)) = 0. - _Reinhard Zumkeller_, Feb 21 2014
%e A048379 a(8) = 9.
%e A048379 a(9) = 0.
%e A048379 a(10) = 21 because the original 1 is changed to a 2 and the 0 is changed to a 1.
%t A048379 Table[FromDigits[ReplaceAll[IntegerDigits[n] + 1, 10 -> 0]], {n, 0, 79}] (* _Alonso del Arte_, Feb 27 2014 *)
%o A048379 (Haskell)
%o A048379 a048379 n = if n == 0 then 1 else x n where
%o A048379    x m = if m == 0 then 0 else 10 * x m' + (d + 1) `mod` 10
%o A048379          where (m',d) = divMod m 10
%o A048379 -- _Reinhard Zumkeller_, Feb 21 2014
%o A048379 (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
%o A048379 (PARI) A048379(n)=!n+apply(t->(t+1)%10, n=digits(n))*vector(#n, i, 10^(#n-i))~ \\ _M. F. Hasler_, Mar 21 2015
%o A048379 (Python)
%o A048379 d = {ord(str(i)):ord(str((i+1)%10)) for i in range(10)}
%o A048379 def a(n): return int(str(n).translate(d))
%o A048379 print([a(n) for n in range(72)]) # _Michael S. Branicky_, Dec 20 2022
%K A048379 nonn,base,easy
%O A048379 0,2
%A A048379 _Patrick De Geest_, Mar 15 1999