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.

A129804 a(0) = 1, a(1) = 2; for n>0, a(2*n) = 3*a(2*n-1) - a(2*n-2), a(2*n+1) = 3*a(2*n) - a(2*n-1) - a(n-1).

This page as a plain text file.
%I A129804 #18 Sep 07 2025 08:59:15
%S A129804 1,2,5,12,31,79,206,534,1396,3642,9530,24917,65221,170667,446780,
%T A129804 1169467,3061621,8014862,20982965,54932637,143814946,376508559,
%U A129804 985710731,2580614104,6756131581,17687755722,46307135585,121233585812
%N A129804 a(0) = 1, a(1) = 2; for n>0, a(2*n) = 3*a(2*n-1) - a(2*n-2), a(2*n+1) = 3*a(2*n) - a(2*n-1) - a(n-1).
%C A129804 Equals the eigensequence of the correlation triangle, A003983. - _Gary W. Adamson_, Mar 14 2011
%p A129804 a:=proc(n) if n=0 or n=1 then n+1 elif n mod 2 = 0 then 3*a(n-1)-a(n-2) else 3*a(n-1)-a(n-2)-a((n-3)/2) fi end: seq(a(n),n=0..30); - _Emeric Deutsch_, May 20 2007
%o A129804 (PARI) {m=27; v=vector(m+1); v[1]=1; v[2]=2; for(n=2, m, k=3*v[n]-v[n-1]; if(n%2==1, k=k-v[(n-1)/2]); v[n+1]=k); print(v)} /* _Klaus Brockhaus_, May 20 2007 */
%Y A129804 Cf. A003983.
%K A129804 nonn,changed
%O A129804 0,2
%A A129804 _Paul Curtz_, May 19 2007
%E A129804 More terms from _Emeric Deutsch_ and _Klaus Brockhaus_, May 20 2007