Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A161820
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A161820 a(n) = the smallest positive integer such that both n and a(n), when represented in binary, contain the same types of runs of 1's, the runs being in any order. +0
5
1, 1, 3, 1, 5, 3, 7, 1, 5, 5, 11, 3, 11, 7, 15, 1, 5, 5, 11, 5, 21, 11, 23, 3, 11, 11, 27, 7, 23, 15, 31, 1, 5, 5, 11, 5, 21, 11, 23, 5, 21, 21, 43, 11, 43, 23, 47, 3, 11, 11, 27, 11, 43, 27, 55, 7, 23, 23, 55, 15, 47, 31, 63, 1, 5, 5, 11, 5, 21, 11, 23, 5, 21, 21, 43, 11, 43, 23, 47, 5 (list; graph; listen)
OFFSET

1,3

COMMENT

Clarification of definition: Think of binary n and a(n) each as a string of 0's and 1's. Consider the "runs" of 1's in binary n and a(n), where each run is made up completely of 1's, and is bounded on both sides either by 0's or by the edge of the string. Now consider the lengths of each bounded run of 1's (the number of 1's in each run). Then a(n) is the smallest positive integer whose set of run-lengths is a permutation of the set of run-lengths for n. (See example.)

EXAMPLE

77 in binary is 1001101. There are three runs of 1's, two runs of one 1 each and one run of two 1's. So we are looking for the smallest positive integer with two runs of one 1 each and one run of two 1's (and no other runs of 1's). For example, 15 in binary is 1111, which contains the runs, except that it is required that each run be bounded by 0's or the edge of the binary string. The next number that fits the requirements completely is 43 = 101011 in binary. So a(77) = 43.

MAPLE

rtype := proc(n) local rt, bdgs, pr, i, rl ; rt := [seq(0, i=1..40)] ; bdgs := convert(n, base, 2) ; pr := 0 ; for i from 1 to nops(bdgs) do if op(i, bdgs) = 1 then if pr = 0 then rl := 0 ; fi; rl := rl+1 ; else if pr = 1 then rt := subsop(rl=op(rl, rt)+1, rt) ; fi; fi; pr := op(i, bdgs) ; if i = nops(bdgs) and pr = 1 then rt := subsop(rl=op(rl, rt)+1, rt) ; fi; od: rt ; end: A161820 := proc(n) local rtn, a; rtn := rtype(n) ; for a from 1 do if rtype(a) = rtn then RETURN(a) ; fi; od: end: seq(A161820(n), n=1..100) ; [From R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Jul 20 2009]

CROSSREFS

A161819, A161821, A161822

Sequence in context: A082725 A078701 A161398 this_sequence A116528 A081431 A053641

Adjacent sequences: A161817 A161818 A161819 this_sequence A161821 A161822 A161823

KEYWORD

base,nonn

AUTHOR

Leroy Quet (q1qq2qqq3qqqq(AT)yahoo.com), Jun 20 2009

EXTENSIONS

More terms from R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Jul 20 2009

page 1

Search completed in 0.005 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research