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.
%I A352152 #23 Mar 08 2022 12:55:21 %S A352152 0,1,2,3,4,5,6,7,8,9,10,11,21,31,41,51,61,71,81,91,20,12,22,32,42,52, %T A352152 62,72,82,92,30,13,23,33,43,53,63,73,83,93,40,14,24,34,44,54,64,74,84, %U A352152 94,50,15,25,35,45,55,65,75,85,95,60,16,26,36,46,56,66,76 %N A352152 Reverse each run of consecutive nonzero digits in the decimal expansion of n. %C A352152 This sequence is a self-inverse permutation of the nonnegative integers. %C A352152 This sequence first differs from A321474 for n = 102: a(102) = 102 whereas A321474(102) = 201. %C A352152 This sequence first differs from A333659 for n = 101: a(101) = 101 whereas A333659(101) = 110. %C A352152 This sequence first differs from A336956 for n = 102: a(102) = 102 whereas A336956(102) = 201. %H A352152 Rémy Sigrist, <a href="/A352152/b352152.txt">Table of n, a(n) for n = 0..10000</a> %H A352152 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A352152 a(10*n) = 10*a(n). %e A352152 For n = 1024: %e A352152 - we have two runs of consecutive nonzero digits: "1" and "24", %e A352152 - the reverse of "1" is "1", that of "24" is "42", %e A352152 - so a(1024) = 1042. %o A352152 (Perl) sub a { my $v = shift; $v =~ s/[1-9]+/reverse($&)/ge; return $v; } %o A352152 (Python) %o A352152 from itertools import groupby %o A352152 def A352152(n): return int(''.join(''.join(list(g) if k else list(g)[::-1]) for k, g in groupby(str(n),key=lambda x:x =='0'))) # _Chai Wah Wu_, Mar 08 2022 %Y A352152 Cf. A321474, A333659, A336956. %K A352152 nonn,base,easy %O A352152 0,3 %A A352152 _Rémy Sigrist_, Mar 06 2022