login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A079053 Recaman Fibonacci variation: a(1)=1; a(2)=2; for n > 2, a(n) = a(n-1)+a(n-2)-F(n) if that number is positive and not already in the sequence, otherwise a(n) = a(n-1)+a(n-2)+F(n) where F(n) denote the n-th Fibonacci number. 8
1, 2, 5, 4, 14, 10, 11, 42, 19, 6, 114, 264, 145, 32, 787, 1806, 996, 218, 5395, 12378, 6827, 1494, 36978, 84840, 46793, 10240, 253451, 581502, 320724, 70186, 1737179, 3985674, 2198275, 481062, 11906802, 27318216, 15067201, 3297248, 81610435 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

Starting with other initial values a(1)=x a(2)=y gives the same kind of recurrence relations.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..1000

FORMULA

For n>2, if n==0 or 2 (mod 4) a(n)=2*a(n-1)-a(n-2)-a(n-4); if n==1 or 3 (mod 4) a(n)=a(n-2)+2*a(n-3)+a(n-4) lim n ->infinity a(4n)/a(4n-1)=2.29433696806047607330083539....; lim n ->infinity a(4n-1)/a(4n-2)=24.7510757456062014116731647..; lim n ->infinity a(4n-2)/a(4n-3)=0.218836132868832627648170038...; lim n ->infinity a(4n-3)/a(4n-4)=0.551544105222898180785441647...

EXAMPLE

a(10)=6 because a(9)+a(8)-F(10)=19+42-55=6 and 6 is not already in the sequence. a(11)=42 because a(10)+a(9)-F(11)=6+19-89 < 0 then a(11)=6+19+89=114.

PROG

(PARI) an=vector(100); an[1]=1; an[2]=2; a(n)=if(n<0, 0, an[n]); for(n=3, 100, an[n]=if(abs(sign(a(n-1)+a(n-2)-fibonacci(n))-1)+setsearch(Set(vector(n-1, i, a(i))), a(n-1)+a(n-2)-fibonacci(n)), a(n-1)+a(n-2)+fibonacci(n), a(n-1)+a(n-2)-fibonacci(n)))

(Haskell)

import Data.Set (Set, fromList, notMember, insert)

a079053 n = a079053_list !! (n-1)

a079053_list = 1 : 2 : r (fromList [1, 2]) 1 1 1 2 where

  r :: Set Integer -> Integer -> Integer -> Integer -> Integer -> [Integer]

  r s i j x y = if v > 0 && v `notMember` s

                   then v : r (insert v s) j fib y v

                   else w : r (insert w s) j fib y w where

    fib = i + j

    v = x + y - fib

    w = x + y + fib

for_bFile = take 1000 a079053_list -- Reinhard Zumkeller, Mar 14 2011

CROSSREFS

Cf. A005132.

Sequence in context: A117824 A122212 A102468 * A189942 A002518 A093727

Adjacent sequences:  A079050 A079051 A079052 * A079054 A079055 A079056

KEYWORD

nice,nonn

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), Feb 02 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 18:47 EST 2012. Contains 205663 sequences.