OFFSET
0,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..150
FORMULA
0 = a(n) * a(n+4) - a(n+1) * a(n+3) + (-1)^n * a(n+2)^2 for all n in Z.
0 = a(n) * a(n+9) + a(n+1) * a(n+8) + 9 * a(n+3) * a(n+6) + 9 * a(n+4) * a(n+5) for all n in Z.
a(-n) = A247378(n) for all n in Z.
MATHEMATICA
RecurrenceTable[{a[0]==-3, a[1]==7, a[2]==1, a[3]==46, a[n]==(a[n-1]a[n-3]- (-1)^n a[n-2]^2)/a[n-4]}, a, {n, 30}] (* Harvey P. Dale, Aug 22 2016 *)
PROG
(PARI) {a(n) = if( n<-4, (a(n+1) * a(n+3) - (-1)^n * a(n+2)^2) / a(n+4), if( n<0, [1, -2, 1, 1][-n], (a(n-1) * a(n-3) - (-1)^n * a(n-2)^2) / a(n-4)))};
(PARI) {a(n) = my(A); n=-n; A = if( n<1, n = 6-n; [-1, 1, 1, -2], [1, -2, 1, 1]); A = concat(A, vector(max(0, n-4))); for(k=5, n, A[k] = (A[k-1] * A[k-3] - (-1)^k * A[k-2]^2) / A[k-4]); A[n]};
(Haskell)
a247382 n = a247382_list !! n
a247382_list = [-3, 7, 1, 46] ++ zipWith (flip div) a247382_list
(zipWith (+)
(zipWith (*) (tail a247382_list) (drop 3 a247382_list))
(zipWith (*) (cycle [-1, 1]) (map (^ 2) $ drop 2 a247382_list)))
-- Reinhard Zumkeller, Sep 17 2014
(Magma) I:=[-3, 7, 1, 46]; [n le 4 select I[n] else ( Self(n-1)*Self(n-3) + (-1)^n*Self(n-2)^2 )/Self(n-4): n in [1..30]]; // G. C. Greubel, Aug 05 2018
(GAP) a:=[-3, 7, 1, 46];; for n in [5..25] do a[n]:=(a[n-1]*a[n-3]-(-1)^(n-1)*a[n-2]^2)/a[n-4]; od; a; # Muniru A Asiru, Aug 05 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Sep 15 2014
STATUS
approved