login

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”).

a(n) = n for n <= 2; for n > 2, a(n) = 2a(n-1) - a(n - floor(1/2 + sqrt(2(n-1)))).
3

%I #13 Jul 26 2015 01:52:48

%S 0,1,2,3,4,6,9,14,24,42,75,136,258,492,942,1809,3482,6828,13398,26304,

%T 51666,101523,199564,395646,784464,1555530,3084756,6117846,12134169,

%U 24068774,47937984,95480322,190176180,378796830,754508904,1502899962

%N a(n) = n for n <= 2; for n > 2, a(n) = 2a(n-1) - a(n - floor(1/2 + sqrt(2(n-1)))).

%H Reinhard Zumkeller, <a href="/A096824/b096824.txt">Table of n, a(n) for n = 0..1000</a>

%t a[n_] := a[n] = If[n < 3, a[n] = n, 2a[n - 1] - a[n - Floor[1/2 + Sqrt[2(n - 1)]]]]; Table[ a[n], {n, 0, 35}] (* _Robert G. Wilson v_, Aug 20 2004 *)

%o (PARI) {m=36;v=vector(m+1);for(n=0,m,if(n<=2,a=n,k=n-floor(1/2+sqrt(2*(n-1)));a=2*v[n]-v[k+1]);v[n+1]=a;print1(a,","))} \\ _Klaus Brockhaus_, Aug 20 2004

%o (Haskell)

%o a096824 n = a096824_list !! n

%o a096824_list = 0 : 1 : 2 : zipWith (-)

%o (map (* 2) $ drop 2 a096824_list) (map a096824 $ tail a122797_list)

%o -- _Reinhard Zumkeller_, Feb 12 2012

%Y Cf. A005318, A096796.

%Y Cf. A122797, A003056.

%K nonn,easy

%O 0,3

%A _N. J. A. Sloane_, Aug 17 2004

%E More terms from _Klaus Brockhaus_ and _Robert G. Wilson v_, Aug 20 2004