OFFSET
0,3
COMMENTS
In case corresponding digits add to a 2-digit number, the "1" is inserted instead of being added to the next higher significant digit. - M. F. Hasler, Apr 18 2009
A197945(n) = length of longest common prefix of a(n) and a(n+1). [Reinhard Zumkeller, Oct 19 2011]
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..36
FORMULA
frac( log[10]( a(n) )) tends to 0.7085296011388705685015..., i.e. the first digits 51112791588989116125412156111... eventually remain the same, since on the average a(n+1) has about 1/6 of digits more than a(n). - M. F. Hasler, Apr 18 2009
EXAMPLE
a(8) = a(6) ++ a(7) = 08 ++ 13 = concatenation of (0+1 = 1 and 8+3 = 11) = 111.
a(9) = a(7) ++ a(8) = 013 ++ 111 =124.
MATHEMATICA
nxt[{a_, b_}]:={b, FromDigits[Flatten[ IntegerDigits/@ (PadLeft[ IntegerDigits[ a], IntegerLength[ b], 0] + IntegerDigits[b])]]}; Transpose[ NestList[ nxt, {1, 1}, 25]][[1]] (* Harvey P. Dale, Dec 16 2012 *)
PROG
(PARI) a=[1, 1]; for(n=2, 30, a=concat(a, a[n]+a[n-1]); my(p=10^#Str(a[n])); while(p\=10, a[n]\p%10+a[n-1]\p%10 > 9 & a[n+1]+=(a[n+1]\p\10-1)*90*p)); a \\ M. F. Hasler, Apr 18 2009
(Haskell)
import Data.List (unfoldr)
a096095 n = a096095_list !! n
a096095_list = 1 : 1 : zipWith dadd a096095_list (tail a096095_list) where
dadd x y = foldl (\v d -> (if d < 10 then 10 else 100)*v + d)
0 $ reverse $ unfoldr f (x, y) where
f (x, y) | x + y == 0 = Nothing
| otherwise = Just (xd + yd, (x', y'))
where (x', xd) = divMod x 10; (y', yd) = divMod y 10
-- Reinhard Zumkeller, Oct 19 2011
CROSSREFS
KEYWORD
base,nice,nonn
AUTHOR
Amarnath Murthy, Jun 24 2004
EXTENSIONS
Edited and extended beyond a(12) by M. F. Hasler, Apr 18 2009
STATUS
approved