cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A117822 a(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).

This page as a plain text file.
%I A117822 #6 Sep 03 2017 11:26:52
%S A117822 1,1,3,2,8,6,9,21,23,36,50,76,115,179,281,446,712,1142,1837,2961,4779,
%T A117822 7720,12478,20176,32631,52783,85389,138146,223508,361626,585105,
%U A117822 946701,1531775,2478444,4010186,6488596,10498747,16987307,27486017,44473286
%N A117822 a(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 A117822 a[0]:=1: a[1]:=1: A:={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 A117822 Cf. A005132, A079053, A117821, A117823, A117824.
%K A117822 nonn,easy
%O A117822 0,3
%A A117822 _N. J. A. Sloane_, Apr 30 2006
%E A117822 More terms from _Emeric Deutsch_, Apr 30 2006