OFFSET
0,6
COMMENTS
This is similar to Somos-4 (A006720) except for the alternating coefficient of a(n-2)^2.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..250
FORMULA
0 = a(n)*a(n+9) + a(n+1)*a(n+8) - 3*a(n+3)*a(n+6) - 3*a(n+4)*a(n+5) for all n in Z.
a(n) = a(-n), a(2*n) = A178384(n)^2 for all n in Z.
MATHEMATICA
Join[{0}, RecurrenceTable[{a[1]==1, a[2]==1, a[3]==1, a[4]==1, a[n]==(a[n-1]a[n-3] - (-1)^n a[n-2]^2)/a[n-4]}, a, {n, 4, 30}]] (* G. C. Greubel, Aug 05 2018 *)
PROG
(PARI) {a(n) = n=abs(n); if( n<5, n>0, (a(n-1) * a(n-3) - (-1)^n * a(n-2)^2) / a(n-4))};
(PARI) {a(n) = my(A); n=abs(n); if( n<5, n>0, A = vector(n, k, 1); for(k=5, n, A[k] = (A[k-1] * A[k-3] - (-1)^k * A[k-2]^2) / A[k-4]); A[n])};
(Haskell)
a247368 n = a247368_list !! n
a247368_list = 0 : xs where
xs = [1, 1, 1, 1] ++ zipWith (flip div) xs (zipWith (+)
(zipWith (*) (tail xs) (drop 3 xs))
(zipWith (*) (cycle [1, -1]) (map (^ 2) $ drop 2 xs)))
-- Reinhard Zumkeller, Sep 15 2014
(Magma) I:=[1, 1, 1, 1]; [0] cat [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
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Sep 14 2014
STATUS
approved