|
|
A091789
|
|
a(1) = 1, a(2) = 2, a(n) = reverse concatenation of two previous terms.
|
|
3
|
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Concatenation of any three successive terms is a palindrome.
|
|
LINKS
|
|
|
MAPLE
|
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
|
|
PROG
|
(Python)
from itertools import count, islice
def agen():
s, t = "1", "2"
yield from [1, 2]
while True:
s, t = t, (s+t)[::-1]
yield int(t)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|