

A221646


A continuous "Look and Say" sequence (without repetition, method 2).


14



1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 2, 2, 1, 3, 2, 1, 1, 1, 3, 1, 2, 3, 1, 1, 3, 1, 1, 1, 2, 1, 3, 2, 1, 1, 3, 3, 1, 1, 2, 1, 1, 1, 3, 1, 2, 2, 1, 2, 3, 2, 1, 1, 2, 3, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 2, 1, 3, 1, 2, 2, 1, 1, 2, 1, 3, 2, 1, 1, 3, 2, 1, 2, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,4


COMMENTS

A variant of Conway's 'LookandSay' sequence A005150, without run cutoff. It describes at each step the preceding digits taken altogether.
There are different optional rules to build such a sequence. This method 2 does not consider already said digits.
As in the original LookandSay sequence, a(n) is always equal to 1, 2 or 3. The subsequence 3,3,3 never appears.
The sequence is determined by pairs of digits. Terms of even ranks are counts while odd ranks are figures.


LINKS

J.C. Hervé, Table of n, a(n) for n = 1..10000


EXAMPLE

a(1) = 1, then a(2) = 1 and a(3) = 1 (one 1). Leaving out the first 1 already said, we have now two 1, then a(4) = 2 and a(5) = 1, and then a(6) = 1, a(7) = 2, a(8) = 2, a(9) = 1, etc.


MATHEMATICA

n = 100; a[0] = 1; see = say = 0; While[say < n  1, c = 0; dg = a[see]; While[see <= say, If[a[see] == dg, c += 1, Break[]]; see += 1]; a[++say] = c; If[say < n  1, a[++say] = dg]]; Array[a, n, 0] (* JeanFrançois Alcover, Jul 11 2013, translated and adapted from J.C. Hervé's C program *)


PROG

(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 < n1 ) {
c = 0 ; /* count */
dg = a[see] /* digit */
while (see <= say) {
if (a[see]== dg) c += 1 ;
else break ;
see += 1 ;
}
a[++say] = c ;
if (say < n1) a[++say] = dg ;
}
return(a);
}


CROSSREFS

Cf. A005150 (original lookandsay sequence).
Cf. A225212, A225224 (other continuous variants).
Sequence in context: A213408 A183953 A080236 * A249161 A025142 A245936
Adjacent sequences: A221643 A221644 A221645 * A221647 A221648 A221649


KEYWORD

nonn,easy


AUTHOR

JeanChristophe Hervé, May 05 2013


STATUS

approved



