login
A242108
a(n) = abs(A242107(n)).
2
0, 1, 1, 1, 1, 1, 2, 3, 1, 5, 7, 13, 16, 11, 57, 131, 113, 389, 670, 2311, 3983, 9, 23647, 81511, 140576, 484247, 833503, 5751815, 14871471, 17124617, 147165662, 710017141, 2273917871, 9644648819, 11396432249, 204006839259, 808162720720, 2405317965859
OFFSET
0,7
COMMENTS
This sequence is similar to Somos-5 (A006721).
LINKS
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):
....A242107.append(divexact(-A242107[n-1]*A242107[n-4]+
........A242107[n-2]*A242107[n-3], A242107[n-5]))
A242108 = [int(abs(x)) for x in A242107] # Chai Wah Wu, Aug 15 2014
CROSSREFS
Sequence in context: A197701 A292770 A242107 * A238941 A247582 A359795
KEYWORD
nonn
AUTHOR
Michael Somos, Aug 15 2014
STATUS
approved