OFFSET
0,3
COMMENTS
a(2^n) = n+1. - Reinhard Zumkeller, Nov 16 2013
REFERENCES
S. Hedayat, N. J. A. Sloane and J. Stufken, Orthogonal Arrays, Springer-Verlag, NY, 1999, p. 249.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
FORMULA
Constructed recursively: subsets that include n are obtained by appending n to all earlier subsets.
From Alois P. Heinz, Feb 02 2023: (Start)
a(floor(2^(n-1))) = a(A131577(n)) = n.
EXAMPLE
empty; 1; 2; 1 2; 3; 1 3; 2 3; 1 2 3;...
MAPLE
a:= n-> (l-> parse(cat(0, seq(`if`(l[i]=1, i, [][])
, i=1..nops(l)))))(Bits[Split](n)):
seq(a(n), n=0..53); # Alois P. Heinz, Feb 01 2023
MATHEMATICA
nmax = 6; s[0] = {{}}; s[n_] := s[n] = Join[s[n-1], Append[#, n]& /@ s[n-1]]; FromDigits /@ s[nmax] (* Jean-François Alcover, Nov 15 2011 *)
PROG
(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; }
(Haskell)
a048794 n = a048794_list !! n
a048794_list = map (read . concatMap show) a048793_tabf :: [Integer]
-- Reinhard Zumkeller, Nov 16 2013
CROSSREFS
KEYWORD
nonn,easy,nice,base
AUTHOR
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Apr 11 2000
Keyword base added by Reinhard Zumkeller, Nov 16 2013
STATUS
approved