The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A351653 a(n) is the concatenation of the length of each run of digits in the decimal representation of n. 1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 2, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 2, 11, 11 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,11
LINKS
EXAMPLE
a(100) = 12, because the 1st run (1) has length 1 and the 2nd run (00) has length 2.
a(13211) = 1112, because the 1st run (1) has length 1, the 2nd run (3) has length 1, the 3rd run (2) has length 1 and the 4th run (11) has length 2.
MATHEMATICA
a[n_] := FromDigits[IntegerDigits[Length /@ Split[IntegerDigits[n]]] // Flatten]; Array[a, 100, 0] (* Amiram Eldar, Feb 16 2022 *)
PROG
(PARI) a(n) = {my(result = "", count = 0, dig = digits(n), last = dig[1]); for(i = 1, length(dig), current = dig[i]; if (current == last, count++, result = concat(result, Str(count)); count = 1); last = current); result = concat(result, Str(count)); return(eval(result))};
(Python)
from itertools import groupby
def A351653(n): return int(''.join(str(len(list(g))) for k, g in groupby(str(n)))) # Chai Wah Wu, Mar 11 2022
CROSSREFS
Cf. A001462, A318921, A318927 (binary version).
Sequence in context: A273877 A066795 A079366 * A226110 A323484 A330521
KEYWORD
base,easy,nonn
AUTHOR
Eder Vanzei, Feb 16 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 12:14 EDT 2024. Contains 372540 sequences. (Running on oeis4.)