Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A100549
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A100549 List of binary words that correspond to a valid pairing of parentheses. +0
1
0, 1, 3, 5, 7, 11, 13, 15, 19, 21, 23, 27, 29, 31, 39, 43, 45, 47, 51, 53, 55, 59, 61, 63, 71, 75, 77, 79, 83, 85, 87, 91, 93, 95, 103, 107, 109, 111, 115, 117, 119, 123, 125, 127, 143, 151, 155, 157, 159, 167, 171, 173, 175, 179, 181, 183, 187, 189, 191, 199, 203, 205 (list; graph; listen)
OFFSET

0,3

LINKS

Described in the fxtbook

EXAMPLE

List of binary words with parentheses for those in the sequence:

0 0000 P [empty string]

1 0001 P ()

2 0010

3 0011 P (())

4 0100

5 0101 P ()()

6 0110

7 0111 P ((()))

8 1000

9 1001

10 1010

11 1011 P (()())

12 1100

13 1101 P ()(())

14 1110

15 1111 P (((())))

PROGRAM

C++ code that returns true if the input is a in the sequence: inline bool is_parenword(ulong x) { int s = 0; for (ulong j=0; x!=0; ++j) { s += ( x&1 ? +1 : -1 ); if ( s<0 ) break; // invalid word x >>= 1; } return (s>=0); }

CROSSREFS

Sequence in context: A141107 A047484 A036991 this_sequence A091892 A117203 A081118

Adjacent sequences: A100546 A100547 A100548 this_sequence A100550 A100551 A100552

KEYWORD

nonn

AUTHOR

Joerg Arndt (arndt(AT)jjj.de), Nov 27 2004

page 1

Search completed in 0.002 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 September 8 08:06 EDT 2008. Contains 143486 sequences.


AT&T Labs Research