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”).
%I #17 Feb 19 2021 09:45:40
%S 1,4,10,110,12085,146047246,21329798064184488,
%T 454960285458888331666496499822180,
%U 206988861344833157526906045960863418528301538238377184771619952355
%N a(n+1) = a(n)^2 - (-1)^n * binomial(n+2,2) with a(1) = 1.
%H G. C. Greubel, <a href="/A118378/b118378.txt">Table of n, a(n) for n = 1..12</a>
%H <a href="/index/Aa#AHSL">Index entries for sequences of form a(n+1)=a(n)^2 + ...</a>
%F a(n) = A000290(a(n)) - A033999(n)*A000217(n+1).
%e a(2) = a(1)^2 + (-1)^2 * 2*(2+1)/2 = 1*1 + 1*3 = 4;
%e a(3) = a(2)^2 + (-1)^3 * 3*(3+1)/2 = 4*4 - 3*2 = 10;
%t a[n_]:= a[n]= If[n==1, 1, a[n-1]^2 + (-1)^n*Binomial[n+1, 2]];
%t Table[a[n], {n, 10}] (* _G. C. Greubel_, Feb 18 2021 *)
%o (Sage)
%o @CachedFunction
%o def A118378(n):
%o if (n==1): return 1
%o else: return A118378(n-1)^2 +(-1)^n*binomial(n+1, 2)
%o [A118378(n) for n in (1..10)] # _G. C. Greubel_, Feb 18 2021
%o (Magma)
%o A118378:= func< n | n eq 1 select 1 else Self(n-1)^2 + (-1)^n*Binomial(n+1,2) >;
%o [A118378(n): n in [1..10]];
%o (PARI) a(n) = if (n==1, 1, n--; a(n)^2 - (-1)^n * binomial(n+2,2)); \\ _Michel Marcus_, Feb 19 2021
%Y Cf. A000217, A000290, A033999.
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, May 16 2006
%E Corrected by _Don Reble_, Nov 22 2006