Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A048793
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A048793 List giving all subsets of natural numbers arranged in standard statistical (or Yates) order. +0
2
0, 1, 2, 1, 2, 3, 1, 3, 2, 3, 1, 2, 3, 4, 1, 4, 2, 4, 1, 2, 4, 3, 4, 1, 3, 4, 2, 3, 4, 1, 2, 3, 4, 5, 1, 5, 2, 5, 1, 2, 5, 3, 5, 1, 3, 5, 2, 3, 5, 1, 2, 3, 5, 4, 5, 1, 4, 5, 2, 4, 5, 1, 2, 4, 5, 3, 4, 5, 1, 3, 4, 5, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 6, 2, 6, 1, 2, 6, 3, 6, 1, 3, 6, 2, 3, 6, 1, 2, 3, 6, 4, 6, 1, 4 (list; graph; listen)
OFFSET

0,3

REFERENCES

S. Hedayat, N. J. A. Sloane and J. Stufken, Orthogonal Arrays, Springer-Verlag, NY, 1999, p. 249.

FORMULA

Constructed recursively: subsets that include n are obtained by appending n to all earlier subsets.

EXAMPLE

empty; 1; 2; 1 2; 3; 1 3; 2 3; 1 2 3;...

PROGRAM

(C:) #include <stdio.h> #include <stdlib.h> #define USAGE "Usage: 'A048793 num' where num is the largest number to use creating sets.\n" #define MAX_NUM 10 #define MAX_ROW 1024 int main(int argc, char *argv[]) { unsigned short a[MAX_ROW][MAX_NUM]; signed short old_row, new_row, i, j, end; if (argc < 2) { fprintf(stderr, USAGE); return EXIT_FAILURE; } end = atoi(argv[1]); end = (end > MAX_NUM) ? MAX_NUM: end; for (i = 0; i < MAX_ROW; i++) for ( j = 0; j < MAX_NUM; j++) a[i][j] = 0; a[1][0] = 1; new_row = 2; for (i = 2; i <= end; i++) { a[new_row++ ][0] = i; for (old_row = 1; a[old_row][0] != i; old_row++) { for (j = 0; a[old_row][j] != 0; j++) { a[new_row][j] = a[old_row][j]; } a[new_row++ ][j] = i; } } fprintf(stdout, "Values: 0"); for (i = 1; a[i][0] != 0; i++) for (j = 0; a[i][j] != 0; j++) fprintf(stdout, ", %d", a[i][j]); fprintf(stdout, "\n"); return EXIT_SUCCESS; }

CROSSREFS

Cf. A048794.

Sequence in context: A097825 A002343 A082076 this_sequence A075106 A036995 A116908

Adjacent sequences: A048790 A048791 A048792 this_sequence A048794 A048795 A048796

KEYWORD

nonn,tabf,easy,nice

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

More terms from Larry Reeves (larryr(AT)acm.org), Apr 11 2000

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 December 15 00:47 EST 2009. Contains 170825 sequences.


AT&T Labs Research