A225224 A continuous "look-and-say" sequence (without repetition, seed 1,1,1).
1, 1, 1, 3, 1, 1, 3, 2, 1, 1, 3, 1, 2, 2, 1, 1, 3, 1, 1, 2, 2, 2, 1, 1, 3, 2, 1, 3, 2, 2, 1, 1, 3, 1, 2, 1, 1, 1, 3, 2, 2, 2, 1, 1, 3, 1, 1, 1, 2, 3, 1, 1, 3, 3, 2, 2, 1, 1, 3, 3, 1, 1, 2, 1, 3, 2, 1, 2, 3, 2, 2, 2, 1, 2, 3, 2, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1
Offset: 1
Examples
The sequence starts with: 1, 1, 1 The first group has three 1's: 3, 1 The next group has one 3: 1, 3 The next group has two 1's: 2, 1 The next group has one 3: 1, 3 The next group has one 2: 1, 2 The next group has two 1's: 2, 1, etc.
Links
- J.-C. Hervé, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
C
/* computes first n terms in array a[] */ int *swys(int n) { int a[n] ; int see, say, c ; a[0] = 1; see = say = 0 ; while( say < n-1 ) { c = 0 ; /* count */ dg = a[see] /* digit */ if (say > 0) { /* not the first time */ while (see <= say) { if (a[see]== dg) c += 1 ; else break ; see += 1 ; } } else { c = 1 ; } a[++say] = c ; if (say < n-1) a[++say] = dg ; } return(a); }
-
Mathematica
n = 100; a[0] = 1; see = say = 0; While[ say < n - 1, c = 0; dg = a[see]; If[say > 0, While[ see <= say, If[a[see] == dg, c += 1, Break[]]; see += 1], c = 1]; a[++say] = c; If[say < n - 1, a[++say] = dg]]; Array[a, n, 0] (* Jean-François Alcover, Jul 11 2013, translated and adapted from J.-C. Hervé's C program *)
Comments