OFFSET
0,7
COMMENTS
This sequence is similar to Somos-5 (A006721).
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..320
FORMULA
a(-n) = a(n) for all n in Z.
PROG
(PARI) {a(n) = my(v, m); n=abs(n); if( n<6, n>0, v = vector(n, k, 1); for(k=6, n, m = (k+1)%21 - 10; v[k] = ( (-1)^( m%4==0 ) * v[k-1] * v[k-4] + (-1)^( abs((m+4)%8-4)==1 ) * v[k-2] * v[k-3]) / v[k-5]); v[n])};
(PARI) {a(n) = if( n, sqrtint( denominator( ellmul( ellinit( [1, -1, 0, -1, 1]), [0, 1], n)[1])))}; /* Michael Somos, Aug 22 2014 */
(Python)
from gmpy2 import divexact
A242107 = [0, 1, 1, 1, 1, -1]
for n in range(6, 321):
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Aug 15 2014
STATUS
approved