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!)
A027221 Sum of squares of numbers in row n of array T given by A026736. 1

%I #15 Oct 25 2019 16:50:54

%S 1,2,6,20,79,284,1237,4542,20626,76406,354080,1317964,6173634,

%T 23051344,108628550,406513364,1922354351,7206349304,34147706833,

%U 128187589014,608151037123,2285559568866,10850577045131,40817923301712,193850277807569,729825857819924,3466587141136257

%N Sum of squares of numbers in row n of array T given by A026736.

%H G. C. Greubel, <a href="/A027221/b027221.txt">Table of n, a(n) for n = 0..1000</a>

%t T[n_, k_]:= T[n, k] = If[k==0 || k==n, 1, If[EvenQ[n] && k==(n-2)/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k]]]; Table[Sum[T[n, k]^2, {k,0,n}], {n,0,40}] (* _G. C. Greubel_, Jul 19 2019 *)

%o (PARI) T(n, k) = if(k==n || k==0, 1, k==n-1, n, if((n%2)==0 && k==(n-2)/2, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) ));

%o vector(21, n, n--; sum(k=0, n, T(n, k)^2 ) ) \\ _G. C. Greubel_, Jul 19 2019

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (k==0 or k==n): return 1

%o elif (mod(n, 2)==0 and k==(n-2)/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)

%o else: return T(n-1, k-1) + T(n-1, k)

%o [sum(T(n,k)^2 for k in (0..n)) for n in (0..40)] # _G. C. Greubel_, Jul 19 2019

%o (GAP)

%o T:= function(n, k)

%o if k=0 or k=n then return 1;

%o elif k=n-1 then return n;

%o elif (n mod 2)=0 and k=Int((n-2)/2) then return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k);

%o else return T(n-1, k-1) + T(n-1, k);

%o fi;

%o end;

%o List([0..21], n-> Sum([0..n], k-> T(n, k)^2 )); # _G. C. Greubel_, Jul 19 2019

%Y Cf. A026736.

%K nonn

%O 0,2

%A _Clark Kimberling_

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 September 8 22:43 EDT 2024. Contains 375759 sequences. (Running on oeis4.)