OFFSET
0,3
COMMENTS
This is a generalized Somos-4 sequence. - Michael Somos, Mar 14 2020
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..114
FORMULA
a(n) = (sqrt(1/4 - sqrt(2)/8)*sin(7*Pi*n/4 + 3*Pi/8) + sqrt(sqrt(2)/8 + 1/4)*sin(5*Pi*n/4 + Pi/8) + sqrt(sqrt(2)/8 + 1/4)*cos(3*Pi*n/4 + 3*Pi/8) + sqrt(1/4 - sqrt(2)/8)*cos(Pi*n/4 + Pi/8))*(-2)^floor(binomial(n+1,2)/2).
From Michael Somos, Mar 14 2020: (Start)
a(n) = (-1)^(n + floor(n/4)) * A160637(n).
a(n) = a(-1-n) for all n in Z.
0 = a(n)*a(n+4) + 6*a(n+1)*a(n+3) + 4*a(n+2)^2 for all n in Z.
0 = a(n)*a(n+5) - 4*a(n+1)*a(n+4) for all n in Z. (End)
a(n) = (-1)^n * b(n+2), b() defined by 0 = b(n) * b(n+2) * b(n+3)^2 + b(n+4) * b(n+2) * b(n+1)^2 + b(n+1)^2 * b(n+3)^2, for n in N, all initial values +1. - Helmut Ruhland, Feb 22 2024
MATHEMATICA
Table[(-1)^Floor[(n+1)/2]*2^Floor[n*(n+1)/4], {n, 0, 30}] (* G. C. Greubel, Feb 21 2018; Mar 18 2024 *)
a[ n_] := (-1)^(n + Quotient[n, 4])*(-2)^Quotient[n (n + 1), 4]; (* Michael Somos, Mar 14 2020 *)
PROG
(PARI) for(n=0, 30, print1((-1)^((n+1)\2)*2^(n*(n+1)\4), ", ")) \\ G. C. Greubel, Feb 21 2018; Mar 18 2024
(PARI) {a(n) = (-1)^(n + n\4) * (-2)^(n*(n+1)\4)}; /* Michael Somos, Mar 14 2020 */
(Magma) [(-1)^Binomial(n+1, 2)*2^Floor(n*(n+1)/4): n in [0..30]]; // G. C. Greubel, Feb 21 2018; Mar 18 2024
(SageMath) [(-1)^((n+1)//2)*2^(n*(n+1)//4) for n in range(31)] # G. C. Greubel, Mar 18 2024
CROSSREFS
KEYWORD
sign
AUTHOR
Paul Barry, Jan 07 2011
STATUS
approved