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.

A359087 a(n) is equal to the last point of a reverse pyramid summation with base 1, 2, 3, ..., n-2, n-1, n, n-1, n-2, ..., 3, 2, 1.

This page as a plain text file.
%I A359087 #52 Jan 25 2023 09:47:46
%S A359087 1,4,19,78,301,1108,3951,13758,47049,158616,528619,1745098,5715429,
%T A359087 18593032,60136183,193525002,620046513,1978886448,6293809971,
%U A359087 19955385762,63094947981,198990438408,626141673375,1966085927898,6161660863929,19276374528468,60206635741131
%N A359087 a(n) is equal to the last point of a reverse pyramid summation with base 1, 2, 3, ..., n-2, n-1, n, n-1, n-2, ..., 3, 2, 1.
%C A359087 Each element in the pyramid below the base is equal to the sum of the top left, top, and top right elements.
%C A359087 Each row has 2*n-(1+2*r) elements where r is the row number starting from 0.
%C A359087 The sum of elements in the first row is n^2.
%C A359087 The total number of elements in the pyramid is n^2.
%F A359087 a(n) = Sum_{k=1..2*n-1} A004737(k + (n-1)^2) * A027907(k + (n-1)^2 - 1).
%F A359087 Empirical g.f.: x/(1-3*x)^2 - 2*x^2/((1+x)^(1/2)*(1-3*x)^(3/2)). - _Robert Israel_, Dec 17 2022
%F A359087 a(n) = n*3^(n-1) - 2*A132894(n-1) (conjectured). - _Bernard Schott_, Dec 20 2022
%e A359087 For n = 3:
%e A359087   1  2  3  2  1
%e A359087      6  7  6
%e A359087        19
%e A359087 so a(3) = 19.
%e A359087 For n = 4:
%e A359087   1   2   3   4   3   2   1
%e A359087       6   9  10   9   6
%e A359087          25  28  25
%e A359087              78
%e A359087 so a(4) = 78.
%p A359087 f:= proc(n) local L,i;
%p A359087   L:= [seq(i,i=1..n),seq(n-i,i=1..n-1)];
%p A359087   for i from 1 to n-1 do
%p A359087     L:= L[1..-3] + L[2..-2] + L[3..-1]
%p A359087   od;
%p A359087   op(L)
%p A359087 end proc:
%p A359087 map(f, [$1..30]); # _Robert Israel_, Dec 17 2022
%t A359087 f[n_] := Module[{L, i}, L = Range[n]~Join~Table[n-i, {i, 1, n-1}]; For[i = 1, i <= n-1, i++, L = L[[1;;-3]] + L[[2;;-2]] + L[[3;;-1]]]; L[[1]]];
%t A359087 f /@ Range[30] (* _Jean-François Alcover_, Jan 25 2023, after _Robert Israel_ *)
%o A359087 (C)
%o A359087 unsigned long tri(int n, int k)
%o A359087 {
%o A359087     if (n == 0 && k == 0) return 1;
%o A359087     if(k < -n || k > n) return 0;
%o A359087     return tri(n - 1, k - 1) + tri(n - 1, k) + tri(n - 1, k + 1);
%o A359087 }
%o A359087 unsigned long a(int n)
%o A359087 {
%o A359087     unsigned long sum = 0;
%o A359087     sum += tri(n - 1,0) * n;
%o A359087     for (int i = 1; i < n; i++)
%o A359087     {
%o A359087         sum += 2 * tri(n - 1,n - i) * i;
%o A359087     }
%o A359087     return sum;
%o A359087 }
%Y A359087 Cf. A004737, A027907, A132894.
%K A359087 nonn
%O A359087 1,2
%A A359087 _Moosa Nasir_, Dec 15 2022