Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #6 Sep 03 2017 11:27:40
%S 0,1,2,5,4,13,12,19,24,35,50,75,114,177,278,441,704,1129,1816,2927,
%T 4724,7631,12334,19943,32254,52173,84402,136549,220924,357445,578340,
%U 935755,1514064,2449787,3963818,6413571,10377354,16790889,27168206,43959057
%N a(0) = 0, a(1) = 1; for n >= 2, a(n) = a(n-1) + a(n-2) - (n-1) if that number is positive and not already in the sequence, otherwise a(n) = a(n-1) + a(n-2) + (n-1).
%p a[0]:=0: a[1]:=1: A:={0,1}: for n from 2 to 42 do if a[n-1]+a[n-2]-n+1>0 and member(a[n-1]+a[n-2]-n+1,A)=false then a[n]:=a[n-1]+a[n-2]-n+1: A:=A union {a[n-1]+a[n-2]-n+1} else a[n]:=a[n-1]+a[n-2]+n-1: A:=A union {a[n-1]+a[n-2]+n-1} fi: od: seq(a[n],n=0..42); # _Emeric Deutsch_, Apr 30 2006
%Y Cf. A005132, A079053, A117821, A117822, A117823.
%K nonn,easy
%O 0,3
%A _N. J. A. Sloane_, Apr 30 2006
%E More terms from _Emeric Deutsch_, Apr 30 2006