login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A044821 Positive integers having distinct base-10 run lengths. 18
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 200, 211, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 233, 244, 255 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

David A. Corneth, Table of n, a(n) for n = 1..10000

EXAMPLE

117 is in the sequence because it has a run length of 2 and a run length of 1. 101 is not in the sequence because it has three run lengths of 1. - R. J. Mathar, Jan 18 2018

MAPLE

rlset := proc(L::list)

local lset, rl, i ;

lset := [] ;

rl := 1 ;

for i from 2 to nops(L) do

if op(i, L) = op(i-1, L) then

rl := rl+1 ;

else

lset := [op(lset), rl] ;

rl := 1;

end if;

end do:

lset := [op(lset), rl] ;

end proc:

isA044821 := proc(n)

local dgs, rl;

dgs := convert(n, base, 10) ;

rl := rlset(dgs) ;

if nops(rl) = nops( convert(rl, set)) then

true;

else

false;

end if;

end proc:

for n from 1 to 400 do

if isA044821(n) then

printf("%d, ", n) ;

end if;

end do: # R. J. Mathar, Jan 18 2018

PROG

(Python)

from itertools import groupby

def ok(n):

runlengths = [len(list(g)) for k, g in groupby(str(n))]

return len(runlengths) == len(set(runlengths))

print([i for i in range(1, 256) if ok(i)]) # Michael S. Branicky, Jan 04 2021

(PARI) is(n) = { my(runs = List(), lr = 0, d = digits(n)); for(i = 1, #d - 1, if(d[i] != d[i + 1], listput(runs, i - lr); lr = i; ) ); listput(runs, #d - lr); #Set(runs) == #runs } \\ David A. Corneth, Jan 04 2021

CROSSREFS

Cf. A044813, A044814, A044815, A044816, A044817, A044818, A044819, A044820, A044821, A044822, A044823, A044824, A044825, A044826, A044827 (base 2 to base 16).

Sequence in context: A353181 A306273 A141033 * A297148 A048307 A043713

Adjacent sequences: A044818 A044819 A044820 * A044822 A044823 A044824

KEYWORD

nonn,base

AUTHOR

Clark Kimberling

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 December 2 20:59 EST 2022. Contains 358510 sequences. (Running on oeis4.)