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.

Original entry on oeis.org

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, 27, 28, 29, 30, 31, 32, 6, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 8, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 10, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 12, 67, 68
Offset: 0

Views

Author

Rémy Sigrist, Feb 22 2022

Keywords

Comments

A043096 corresponds to fixed points.
Each number appears at least once in this sequence; zeroless numbers (A052382) appear finitely many times, other positive numbers appear infinitely many times.

Examples

			For n = 1066:
- we have three runs of consecutive equal digits: one 1's, one 0's, two 6's,
- 1 * 1 = 1, 1 * 0 = 0, 2 * 6 = 12,
- we obtain: 1, 0, 12,
- so a(1066) = 1012.
		

Crossrefs

Cf. A002275, A043096 (fixed points), A052382, A113589, A175930, A351870.

Programs

  • Mathematica
    Array[FromDigits@ Flatten@ Map[If[Length[#] == 1, #[[1]], IntegerDigits[Length[#]*#[[1]]]] &, Split@ IntegerDigits[#]] &, 69, 0] (* Michael De Vlieger, Feb 25 2022 *)
  • 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) }
    
  • Python
    from itertools import groupby
    def a(n): return int("".join(str(int(k)*len(list(g))) for k, g in groupby(str(n))))
    print([a(n) for n in range(69)]) # Michael S. Branicky, Feb 23 2022

Formula

a(A002275(n)) = n.