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.

A351868 In the decimal expansion of a number, replace each run of consecutive equal digits, say of k consecutive d's, by the decimal expansion of k*d.

This page as a plain text file.
%I A351868 #18 Feb 25 2022 11:17:10
%S A351868 0,1,2,3,4,5,6,7,8,9,10,2,12,13,14,15,16,17,18,19,20,21,4,23,24,25,26,
%T A351868 27,28,29,30,31,32,6,34,35,36,37,38,39,40,41,42,43,8,45,46,47,48,49,
%U A351868 50,51,52,53,54,10,56,57,58,59,60,61,62,63,64,65,12,67,68
%N A351868 In the decimal expansion of a number, replace each run of consecutive equal digits, say of k consecutive d's, by the decimal expansion of k*d.
%C A351868 A043096 corresponds to fixed points.
%C A351868 Each number appears at least once in this sequence; zeroless numbers (A052382) appear finitely many times, other positive numbers appear infinitely many times.
%H A351868 Michael De Vlieger, <a href="/A351868/b351868.txt">Table of n, a(n) for n = 0..10000</a>
%F A351868 a(A002275(n)) = n.
%e A351868 For n = 1066:
%e A351868 - we have three runs of consecutive equal digits: one 1's, one 0's, two 6's,
%e A351868 - 1 * 1 = 1, 1 * 0 = 0, 2 * 6 = 12,
%e A351868 - we obtain: 1, 0, 12,
%e A351868 - so a(1066) = 1012.
%t A351868 Array[FromDigits@ Flatten@ Map[If[Length[#] == 1, #[[1]], IntegerDigits[Length[#]*#[[1]]]] &, Split@ IntegerDigits[#]] &, 69, 0] (* _Michael De Vlieger_, Feb 25 2022 *)
%o A351868 (PARI) a(n, base=10) = { my (d=[]); while (n, my (t=n%base); for (k=0, oo, if (n%base!=t, d=concat(if (t, digits(k*t, base), [0]), d); break, n\=base))); fromdigits(d, base) }
%o A351868 (Python)
%o A351868 from itertools import groupby
%o A351868 def a(n): return int("".join(str(int(k)*len(list(g))) for k, g in groupby(str(n))))
%o A351868 print([a(n) for n in range(69)]) # _Michael S. Branicky_, Feb 23 2022
%Y A351868 Cf. A002275, A043096 (fixed points), A052382, A113589, A175930, A351870.
%K A351868 nonn,base,easy
%O A351868 0,3
%A A351868 _Rémy Sigrist_, Feb 22 2022