login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(1) = 1, a(2) = 2, a(n) = reverse concatenation of two previous terms.
3

%I #14 Jul 01 2022 10:10:53

%S 1,2,21,122,22112,21122221,1222211221122,221122112222112222112,

%T 2112222112222112211222211221122221,

%U 1222211221122221122112222112222112211222211222211221122

%N a(1) = 1, a(2) = 2, a(n) = reverse concatenation of two previous terms.

%C Concatenation of any three successive terms is a palindrome.

%C a(17) with 1597 digits is the first term > 10^1000. - _Michael S. Branicky_, Jul 01 2022

%H Michael S. Branicky, <a href="/A091789/b091789.txt">Table of n, a(n) for n = 1..16</a>

%p Rcat := proc(a,b) local resul,digs ; digs := convert(b,base,10) ; resul := 0 ; for k in digs do resul := resul*10+k ; od ; digs := convert(a,base,10) ; for k in digs do resul := resul*10+k ; od ; RETURN(resul) ; end: A091789 := proc(nmax) local a,anxt,n,i,j; a := [1,2] ; for n from 3 to nmax do a := [op(a),Rcat(op(-2,a),op(-1,a))] ; od; RETURN(a) ; end: op(A091789(13)) ; # _R. J. Mathar_, Jul 26 2007

%o (Python)

%o from itertools import count, islice

%o def agen():

%o s, t = "1", "2"

%o yield from [1, 2]

%o while True:

%o s, t = t, (s+t)[::-1]

%o yield int(t)

%o print(list(islice(agen(), 11))) # _Michael S. Branicky_, Jul 01 2022

%Y Cf. A091790.

%K base,nonn

%O 1,2

%A _Amarnath Murthy_, Feb 18 2004

%E More terms from _R. J. Mathar_, Jul 26 2007