Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A048794
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A048794 Subsets of natural numbers arranged in standard statistical (or Yates) order. +0
3
0, 1, 2, 12, 3, 13, 23, 123, 4, 14, 24, 124, 34, 134, 234, 1234, 5, 15, 25, 125, 35, 135, 235, 1235, 45, 145, 245, 1245, 345, 1345, 2345, 12345, 6, 16, 26, 126, 36, 136, 236, 1236, 46, 146, 246, 1246, 346, 1346, 2346, 12346, 56, 156, 256, 1256, 356, 1356 (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: 'A048794 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 char 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++) { sprintf(&a[new_row++ ][0], "%d", i); for (old_row = 1; a[old_row][0] != (i+48); old_row++) { sprintf(&a[new_row++ ][0], "%s%d", &a[old_row][0], i); } } fprintf(stdout, "Values: 0"); for (i = 1; a[i][0] != 0; i++) fprintf(stdout, ", %s", &a[i][0]); fprintf(stdout, "\n"); return EXIT_SUCCESS; }

CROSSREFS

Cf. A048793.

Sequence in context: A082827 A072484 A113698 this_sequence A082292 A066700 A038218

Adjacent sequences: A048791 A048792 A048793 this_sequence A048795 A048796 A048797

KEYWORD

nonn,easy,nice

AUTHOR

njas

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 August 19 23:53 EDT 2008. Contains 142930 sequences.


AT&T Labs Research