login
A096095
Digital Fibonacci numbers: a(0) = a(1) = 1; a(n+2) = a(n) ++ a(n+1) where ++ stands for digit-wise sum (with no carries).
2
1, 1, 2, 3, 5, 8, 13, 111, 124, 235, 359, 5814, 511613, 5161427, 567210310, 5612371737, 511795811047, 5161310711827714, 51618211410616387511, 51611337272013271110141225, 5161138888102246817264128736, 5111274911111537425910883742699511, 511127910722491311155271156169109106711171247
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
Sequence in context: A041957 A329192 A294939 * A041101 A041809 A117566
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