login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A117821 a(0) = a(1) = 1; for n >= 2, a(n) = a(n-1) + a(n-2) - n if that number is positive and not already in the sequence, otherwise a(n) = a(n-1) + a(n-2) + n. 3

%I #6 Sep 03 2017 11:26:28

%S 1,1,4,2,10,7,11,25,28,44,62,95,145,227,358,570,912,1465,2359,3805,

%T 6144,9928,16050,25955,41981,67911,109866,177750,287588,465309,752867,

%U 1218145,1970980,3189092,5160038,8349095,13509097,21858155,35367214

%N a(0) = a(1) = 1; for n >= 2, a(n) = a(n-1) + a(n-2) - n if that number is positive and not already in the sequence, otherwise a(n) = a(n-1) + a(n-2) + n.

%p a[0]:=1: a[1]:=1: A:={1}: for n from 2 to 40 do if a[n-1]+a[n-2]-n>0 and member(a[n-1]+a[n-2]-n,A)=false then a[n]:=a[n-1]+a[n-2]-n: A:=A union {a[n-1]+a[n-2]-n} else a[n]:=a[n-1]+a[n-2]+n: A:=A union {a[n-1]+a[n-2]+n} fi: od: seq(a[n],n=0..40); # _Emeric Deutsch_, Apr 30 2006

%Y Cf. A005132, A079053, A117822, A117823, A117824.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_, Apr 30 2006

%E More terms from _Benoit Cloitre_ and _Emeric Deutsch_, Apr 30 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 06:04 EDT 2024. Contains 371906 sequences. (Running on oeis4.)