cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 15 results. Next

A369113 Tropical version of Somos-6 sequence A006722.

Original entry on oeis.org

-1, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 8, 9, 9, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 24, 25, 27, 29, 30, 32, 34, 36, 38, 39, 42, 44, 46, 48, 50, 53, 55, 57, 60, 62, 65, 67, 70, 73, 75, 78, 81, 84, 87, 89, 93, 96, 99, 102, 105, 109, 112, 115, 119, 122, 126, 129, 133, 137, 140, 144, 148, 152
Offset: 0

Views

Author

Helmut Ruhland, Jan 13 2024

Keywords

Comments

Given the Somos-6 sequence with variables s(1), s(2), s(3), s(4), s(5), s(6) and recursion s(n) = (s(n-1)*s(n-5) + s(n-2)*s(n-4) + s(n-3)^2)/s(n-6), then s(n) is a Laurent polynomial in the variables with the numerator being irreducible and the denominator is Product_{k=0..5} s(k+1)^a(n-k).
Second difference has period 20.

Crossrefs

Cf. A006722.

Programs

  • Maxima
    N : 6$ Len : 50$  /* tropical version of Somos-N, 2 <= N <= 7, Len = length of the calculated list */
    NofRT : floor (N / 2)$  /* number of terms in a Somos-N recurrence */
    A : makelist (0, Len)$  A[1] : -1$ for i: 2 thru N do ( A[i] : 0 )$
    for i: N + 1 thru Len do (
       M : minf, for j : 1 thru NofRT do ( M : max ( M, A[i - j] + A[i - N + j] ) ),     A[i] : M - A[i - N]
    )$ A;

Formula

a(n) = max( a(n-1) + a(n-5), a(n-2) + a(n-4), 2*a(n-3) ) - a(n-6) for all n in Z.
G.f.: (-1 + x + x^4)/((1 - x)^3*(1 + x)*(1 + x^2)*(1 + x + x^2 + x^3 + x^4)). - Stefano Spezia, Jan 14 2024

A141605 Triangle read by rows: T(n, k) = A006722(n)/(A006722(k)*A006722(n-k)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 2, 5, 5, 5, 5, 2, 1, 1, 2, 3, 9, 9, 9, 3, 2, 1, 1, 3, 5, 8, 23, 23, 8, 5, 3, 1, 1, 3, 8, 15, 25, 75, 25, 15, 8, 3, 1, 1, 6, 18, 47, 84, 140, 140, 84, 47, 18, 6, 1
Offset: 0

Views

Author

Roger L. Bagula and Gary W. Adamson, Aug 21 2008

Keywords

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  1,  1;
  1,  1,  1,  1;
  1,  1,  1,  1,  1;
  1,  1,  1,  1,  1,  1;
  1,  3,  3,  3,  3,  3,  1;
  1,  2,  5,  5,  5,  5,  2,  1;
  1,  2,  3,  9,  9,  9,  3,  2,  1;
  1,  3,  5,  8, 23, 23,  8,  5,  3,  1;
  1,  3,  8, 15, 25, 75, 25, 15,  8,  3,  1;
  ...
		

Crossrefs

Programs

  • Magma
    A006722:= [n le 6 select 1 else (Self(n-1)*Self(n-5) + Self(n-2)*Self(n-4) + Self(n-3)^2)/Self(n-6): n in [1..30]];
    A141605:= func< n, k | Round(A006722[n+1]/(A006722[k+1]*A006722[n-k+1])) >;
    [A141605(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Sep 21 2024
    
  • Mathematica
    f[n_]:= f[n]= If[n<6, 1, (f[n-1]*f[n-5] +f[n-2]*f[n-4] +f[n-3]^2)/f[n-6]] (*A006722*)
    A141605[n_, k_]:= Round[f[n]/(f[k]*f[n-k])];
    Table[A141605[n, k], {n,0,12}, {k,0,n}]//Flatten
  • SageMath
    def f(n): # f = A006722
        if n<6: return 1
        else: return (f(n-1)*f(n-5) +f(n-2)*f(n-4) +f(n-3)^2)/f(n-6)
    def A141605(n, k): return round(f(n)/(f(k)*f(n-k)))
    flatten([[A141605(n, k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Sep 21 2024

Formula

T(n, k) = A006722(n)/(A006722(n-k)*A006722(m)).

Extensions

Edited and new name by G. C. Greubel, Sep 21 2024

A276402 A sequence related to the Somos-6 sequence A006722.

Original entry on oeis.org

1, 1, -1, 1, -3, -3, 1, -25, 49, 1, 385, 1489, 503, 10753, -82371, -196419, -1575551, -12482641, 95770849, -739310591, 5684060161, 45018762529, 359479836623, 7751171129473, -59488778593731, -137028961472835, -29749898850946559, -441962130410844841
Offset: 0

Views

Author

N. J. A. Sloane, Sep 12 2016

Keywords

Comments

This is the right-hand portion of a two-way infinite sequence ..., 1, -1, 1, 1, 1, 1, -1, 1, -3, -3, 1, -25, 49, 1, 385, 1489, 503, 10753, -82371, ...
0 = a(n+5)*a(n-4) + 2*a(n+4)*a(n-3) - 2*a(n+3)*a(n-2) - 4*a(n+2)*a(n-1) - 5*a(n+1)*a(n) = 2*a(n+5)*a(n-5) + 4*a(n+4)*a(n-4) + 5*a(n+3)*a(n-3) + 19*a(n+2)*a(n-2) + 18*a(n+1)*a(n-1) for all n in Z. - Michael Somos, Aug 14 2023

Crossrefs

Cf. A006722.

Programs

  • Mathematica
    a[0] = a[1] = 1; a[2] = -1; a[3] = 1; a[4] = a[5] = -3;
    a[n_] := a[n] = (-2a[n-3]^2 + 2a[n-4] a[n-2] + a[n-5] a[n-1])/a[n-6];
    Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Aug 13 2018, after Seiichi Manyama *)
  • PARI
    {a(n) = if( n>-1 && n<3, [1, 1, -1][n+1], if( n<0, a(-1-n), (a(n-1)*a(n-5) + 2*a(n-2)*a(n-4) - 2*a(n-3)*a(n-3)) / a(n-6)))}; /* Michael Somos, Aug 14 2023 */

Formula

a(0) = a(1) = 1, a(2) = -1, a(3) = 1, a(4) = a(5)= -3, a(n+6)*a(n) = a(n+5)*a(n+1) + 2*a(n+4)*a(n+2) - 2*a(n+3)^2. - Seiichi Manyama, Sep 12 2016
a(n) = a(-1-n) for all n in Z. - Michael Somos, Aug 14 2023

Extensions

More terms from Seiichi Manyama, Sep 12 2016

A038754 a(2n) = 3^n, a(2n+1) = 2*3^n.

Original entry on oeis.org

1, 2, 3, 6, 9, 18, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049, 118098, 177147, 354294, 531441, 1062882, 1594323, 3188646, 4782969, 9565938, 14348907, 28697814, 43046721, 86093442, 129140163, 258280326, 387420489
Offset: 0

Views

Author

Henry Bottomley, May 03 2000

Keywords

Comments

In general, for the recurrence a(n) = a(n-1)*a(n-2)/a(n-3), all terms are integers iff a(0) divides a(2) and first three terms are positive integers, since a(2n+k) = a(k)*(a(2)/a(0))^n for all nonnegative integers n and k.
Equals eigensequence of triangle A070909; (1, 1, 2, 3, 6, 9, 18, ...) shifts to the left with multiplication by triangle A070909. - Gary W. Adamson, May 15 2010
The a(n) represent all paths of length (n+1), n >= 0, starting at the initial node on the path graph P_5, see the second Maple program. - Johannes W. Meijer, May 29 2010
a(n) is the difference between numbers of multiple of 3 evil (A001969) and odious (A000069) numbers in interval [0, 2^(n+1)). - Vladimir Shevelev, May 16 2012
A "half-geometric progression": to obtain a term (beginning with the third one) we multiply the before previous one by 3. - Vladimir Shevelev, May 21 2012
Pisano periods: 1, 2, 1, 4, 8, 2, 12, 4, 1, 8, 10, 4, 6, 12, 8, 8, 32, 2, 36, 8, ... . - R. J. Mathar, Aug 10 2012
Numbers k such that the k-th cyclotomic polynomial has a root mod 3. - Eric M. Schmidt, Jul 31 2013
Range of row n of the circular Pascal array of order 6. - Shaun V. Ault, Jun 05 2014
Also, the number of walks of length n on the graph 0--1--2--3--4 starting at vertex 1. - Sean A. Irvine, Jun 03 2025

Examples

			In the interval [0,2^5) we have 11 multiples of 3 numbers, from which 10 are evil and only one (21) is odious. Thus a(4) = 10 - 1 = 9. - _Vladimir Shevelev_, May 16 2012
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a038754 n = a038754_list !! n
    a038754_list = concat $ transpose [a000244_list, a008776_list]
    -- Reinhard Zumkeller, Oct 19 2015
    
  • Magma
    [n le 2 select n else 3*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Aug 18 2016
    
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 50 do a[n]:=3*a[n-2]+2 od: seq(a[n]+1, n=0..34); # Zerinvary Lajos, Mar 20 2008
    with(GraphTheory): P:=5: G:=PathGraph(P): A:= AdjacencyMatrix(G): nmax:=35; for n from 1 to nmax do B(n):=A^n; a(n):=add(B(n)[1,k],k=1..P) od: seq(a(n),n=1..nmax); # Johannes W. Meijer, May 29 2010
  • Mathematica
    LinearRecurrence[{0,3},{1,2},40] (* Harvey P. Dale, Jan 26 2014 *)
    CoefficientList[Series[(1+2x)/(1-3x^2), {x, 0, 40}], x] (* Vincenzo Librandi, Aug 18 2016 *)
    Module[{nn=20,c},c=3^Range[0,nn];Riffle[c,2c]] (* Harvey P. Dale, Aug 21 2021 *)
  • PARI
    a(n)=(1/6)*(5-(-1)^n)*3^floor(n/2)
    
  • PARI
    a(n)=3^(n>>1)<
    				
  • SageMath
    [2^(n%2)*3^((n-(n%2))/2) for n in range(61)] # G. C. Greubel, Oct 10 2022

Formula

a(n) = a(n-1)*a(n-2)/a(n-3) with a(0)=1, a(1)=2, a(2)=3.
a(2*n) = (3/2)*a(2*n-1) = 3^n, a(2*n+1) = 2*a(2*n) = 2*3^n.
From Benoit Cloitre, Apr 27 2003: (Start)
a(1)=1, a(n)= 2*a(n-1) if a(n-1) is odd, or a(n)= (3/2)*a(n-1) if a(n-1) is even.
a(n) = (1/6)*(5-(-1)^n)*3^floor(n/2).
a(2*n) = a(2*n-1) + a(2*n-2) + a(2*n-3).
a(2*n+1) = a(2*n) + a(2*n-1). (End)
G.f.: (1+2*x)/(1-3*x^2). - Paul Barry, Aug 25 2003
From Reinhard Zumkeller, Sep 11 2003: (Start)
a(n) = (1 + n mod 2) * 3^floor(n/2).
a(n) = A087503(n) - A087503(n-1). (End)
a(n) = sqrt(3)*(2+sqrt(3))*(sqrt(3))^n/6 - sqrt(3)*(2-sqrt(3))*(-sqrt(3))^n/6. - Paul Barry, Sep 16 2003
From Reinhard Zumkeller, May 26 2008: (Start)
a(n) = A140740(n+2,2).
a(n+1) = a(n) + a(n - n mod 2). (End)
If p(i) = Fibonacci(i-3) and if A is the Hessenberg matrix of order n defined by A(i,j) = p(j-i+1), (i<=j), A(i,j)=-1, (i=j+1), and A(i,j)=0 otherwise. Then, for n>=1, a(n-1) = (-1)^n det A. - Milan Janjic, May 08 2010
a(n) = A182751(n) for n >= 2. - Jaroslav Krizek, Nov 27 2010
a(n) = Sum_{i=0..2^(n+1), i==0 (mod 3)} (-1)^A000120(i). - Vladimir Shevelev, May 16 2012
a(0)=1, a(1)=2, for n>=3, a(n)=3*a(n-2). - Vladimir Shevelev, May 21 2012
Sum_(n>=0) 1/a(n) = 9/4. - Alexander R. Povolotsky, Aug 24 2012
a(n) = sqrt(3*a(n-1)^2 + (-3)^(n-1)). - Richard R. Forberg, Sep 04 2013
a(n) = 2^((1-(-1)^n)/2)*3^((2*n-1+(-1)^n)/4). - Luce ETIENNE, Aug 11 2014
From Reinhard Zumkeller, Oct 19 2015: (Start)
a(2*n) = A000244(n), a(2*n+1) = A008776(n).
For n > 0: a(n+1) = a(n) + if a(n) odd then min{a(n), a(n-1)} else max{a(n), a(n-1)}, see also A128588. (End)
E.g.f.: (7*cosh(sqrt(3)*x) + 4*sqrt(3)*sinh(sqrt(3)*x) - 4)/3. - Stefano Spezia, Feb 17 2022
Sum_{n>=0} (-1)^n/a(n) = 3/4. - Amiram Eldar, Dec 02 2022

A006720 Somos-4 sequence: a(0)=a(1)=a(2)=a(3)=1; for n >= 4, a(n) = (a(n-1) * a(n-3) + a(n-2)^2) / a(n-4).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 7, 23, 59, 314, 1529, 8209, 83313, 620297, 7869898, 126742987, 1687054711, 47301104551, 1123424582771, 32606721084786, 1662315215971057, 61958046554226593, 4257998884448335457, 334806306946199122193, 23385756731869683322514, 3416372868727801226636179
Offset: 0

Views

Author

Keywords

Comments

From the 5th term on, all terms have a primitive divisor; in other words, a prime divisor that divides no earlier term in the sequence. A proof appears in the Everest-McLaren-Ward paper. - Graham Everest (g.everest(AT)uea.ac.uk), Oct 26 2005
Twelve prime terms are known, occurring at indices 4, 5, 6, 7, 8, 11, 13, 16, 43, 52, 206, 647. The last two have been checked for probable primality only. The 647th term has 18498 decimal digits. Possibly these are the only prime terms in the entire sequence. - Graham Everest (g.everest(AT)uea.ac.uk), Nov 28 2006
The density of primes dividing some term in the sequence is 11/21. - Jeremy Rouse, Sep 18 2013
a(n) is a divisor of a(n+k*(2*n-3)) for all integers n and k. - Peter H van der Kamp, May 18 2015
a(n) is a divisor of A051138(k*(2*n-3)) for all integers n and k. - Helmut Ruhland, Jan 26 2024

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 565.
  • G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; pp. 9, 179.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

For primes see A129739, A129740, A129741.
Cf. A227199 (primes dividing some term).

Programs

  • Haskell
    a006720 n = a006720_list !! n
    a006720_list = [1,1,1,1] ++
       zipWith div (foldr1 (zipWith (+)) (map b [1..2])) a006720_list
       where b i = zipWith (*) (drop i a006720_list) (drop (4-i) a006720_list)
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Magma
    I:=[1,1,1,1]; [n le 4 select I[n] else (Self(n-1)*Self(n-3)+Self(n-2)^2)/Self(n-4): n in [1..30]]; // Vincenzo Librandi, Aug 07 2017
  • Maple
    Digits:=11; f(x):=4*x^3-4*x+1;sols:=evalf(solve(f(x),x)); e1:=Re(sols[1]); e3:=Re(sols[2]); w1:=evalf(Int((f(x))^(-0.5),x=e1..infinity)); w3:=I*evalf(Int((-f(x))^(-0.5),x=-infinity..e3)); k:=2*w1-evalf(Int((f(x))^(-0.5),x=1..infinity)); z0:=w3+evalf(Int((f(x))^(-0.5),x=e3..-1)); A:=1/WeierstrassSigma(z0,4.0,-1.0); B:=WeierstrassSigma(k,4.0,-1.0)/WeierstrassSigma(z0+k,4.0,-1.0)/A; for n from 0 to 10 do a[n]:=A*B^n*WeierstrassSigma(z0+n*k,4.0,-1.0)/(WeierstrassSigma(k,4.0,-1.0))^(n^2) od; # Andrew Hone, Oct 12 2005
    A006720 := proc(n)
        option remember;
        if n <= 3 then
            1;
        else
            (procname(n-1)*procname(n-3)+procname(n-2)^2)/procname(n-4) ;
        end if;
    end proc: # R. J. Mathar, Jul 12 2012
  • Mathematica
    a[0] = a[1] = a[2] = a[3] = 1; a[n_] := a[n] = (a[n - 1] a[n - 3] + a[n - 2]^2)/a[n - 4]; Array[a, 23] (* Robert G. Wilson v, Jul 04 2007 *)
    RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==1,a[n]==(a[n-1]a[n-3]+a[n-2]^2)/ a[n-4]},a,{n,30}] (* Harvey P. Dale, Apr 07 2018 *)
    b[ n_] := If[-2<=n<=2, {2, 1, 1, 3, 23}[[n+3]], 2*a[n+2]^3*a[n+3] + a[n+1]^2*(a[n+3]*a[n+4] - a[n+2]*a[n+5])]; a[ n_] := If[OddQ[n], b[(n-3)/2], b[-n/2]]; (* Michael Somos, Feb 28 2022 *)
  • PARI
    a=vector(99);a[1]=a[2]=a[3]=a[4]=1;for(n=5,#a,a[n]=(a[n-1]*a[n-3]+a[n-2]^2)/a[n-4]); a \\ Charles R Greathouse IV, Jun 16 2011
    
  • Python
    from gmpy2 import divexact
    A006720 = [1, 1, 1, 1]
    for n in range(4, 101):
        A006720.append(divexact(A006720[n-1]*A006720[n-3]+A006720[n-2]**2,A006720[n-4]))
    # Chai Wah Wu, Sep 01 2014
    

Formula

a(n) = a(3-n) = (-1)^n * A006769(2*n-3) for all n in Z.
a(n+1)/a(n) seems to be asymptotic to C^n with C = 1.226.... - Benoit Cloitre, Aug 07 2002. Confirmed by Hone - see below.
The terms of the sequence have the leading order asymptotics log a(n) ~ D n^2 with D = zeta(w1)*k^2/(2*w1) - log|sigma(k)| = 0.10222281... where zeta and sigma are the Weierstrass functions with invariants g2 = 4, g3 = -1, w1 = 1.496729323 is the real half-period of the corresponding elliptic curve, k = -1.134273216 as above. This agrees with Benoit Cloitre's numerical result with C = exp(2D) = 1.2268447... - Andrew Hone, Feb 09 2005
a(n) = (a(n-1)*a(n-3) + a(n-2)^2)/a(n-4); a(0) = a(1) = a(2) = a(3) = 1; exact formula is a(n) = A*B^n*sigma (z_0+nk)/(sigma (k))^(n^2), where sigma is the Weierstrass sigma function associated to the elliptic curve y^2 = 4*x^3-4*x+1, A = 1/sigma(z_0) = 0.112724016 - 0.824911687*i, B = sigma(k)*sigma (z_0)/sigma (z_0+k) = 0.215971963 + 0.616028193*i, k = 1.859185431, z_0 = 0.204680500 + 1.225694691*i, sigma(k) = 1.555836426, all to 9 decimal places. This is a special case of a general formula for 4th-order bilinear recurrences. The Somos-4 sequence corresponds to the sequence of points (2n-3)P on the curve, where P = (0, 1). - Andrew Hone, Oct 12 2005
a(2*n) = b(-n), a(2*n+1) = b(n-1) where b(n) = A188313(n) for all n in Z. - Michael Somos, Feb 27 2022

A006721 Somos-5 sequence: a(n) = (a(n-1) * a(n-4) + a(n-2) * a(n-3)) / a(n-5), with a(0) = a(1) = a(2) = a(3) = a(4) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 5, 11, 37, 83, 274, 1217, 6161, 22833, 165713, 1249441, 9434290, 68570323, 1013908933, 11548470571, 142844426789, 2279343327171, 57760865728994, 979023970244321, 23510036246274433, 771025645214210753
Offset: 0

Views

Author

Keywords

Comments

Using the addition formula for the Weierstrass sigma function it is simple to prove that the subsequence of even terms of a Somos-5 type sequence satisfy a 4th-order recurrence of Somos-4 type and similarly the odd subsequence satisfies the same 4th-order recurrence. - Andrew Hone, Aug 24 2004
log(a(n)) ~ 0.071626946 * n^2. (Hone)
The Brown link article gives interesting information about related sequences including recurrences and numerical approximations.
The n-th term is a divisor of the (n+k*(2*n-4))-th term for all integers n and k. - Peter H van der Kamp, May 18 2015
The elliptic curve y^2 + xy = x^3 + x^2 - 2x (LMFDB label 102.a1) has infinite order point P = (2, 2) and 2-torsion point T = (0, 0). Define d(n) = a(n+2). The x and y coordinates of nP + T have denominators d(n)^2 and d(n)^3. - Michael Somos, Oct 29 2022

References

  • Paul C. Kainen, Fibonacci in Somos-5 ..., Fib. Q., 60:4 (2022), 362-364.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006721 n = a006721_list !! n
    a006721_list = [1,1,1,1,1] ++
      zipWith div (foldr1 (zipWith (+)) (map b [1..2])) a006721_list
      where b i = zipWith (*) (drop i a006721_list) (drop (5-i) a006721_list)
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Magma
    I:=[1,1,1,1,1]; [n le 5 select I[n] else (Self(n-1) * Self(n-4) + Self(n-2) * Self(n-3)) div Self(n-5): n in [1..30]]; // Vincenzo Librandi, May 18 2015
  • Maple
    for n from 0 to 4 do a[n]:= 1 od:
    for n from 5 to 50 do a[n]:=(a[n-1] * a[n-4] + a[n-2] * a[n-3]) / a[n-5] od:
    seq(a[i],i=0..50); # Robert Israel, May 19 2015
  • Mathematica
    a[0] = a[1] = a[2] = a[3] = a[4] = 1; a[n_] := a[n] = (a[n - 1] a[n - 4] + a[n - 2] a[n - 3])/a[n - 5]; Array[a, 27, 0] (* Robert G. Wilson v, Aug 15 2010 *)
    a[ n_] := If[ Abs [n - 2] < 3, 1, If[ n < 0, a[4 - n], a[n] = (a[n - 1] a[n - 4] + a[n - 2] a[n - 3]) / a[n - 5]]]; (* Michael Somos, Jul 15 2011 *)
    RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==a[4]==1,a[n]==(a[n-1]a[n-4]+ a[n-2]a[n-3])/a[n-5]},a,{n,30}] (* Harvey P. Dale, Dec 25 2011 *)
  • PARI
    {a(n) = if( abs(n-2) < 3, 1, if( n<0, a(4-n), (a(n-1) * a(n-4) + a(n-2) * a(n-3)) / a(n-5)))}; /* Michael Somos, Jul 15 2011 */
    
  • PARI
    {a(n) = my(E = ellinit([1, 1, 0, -2, 0]), P = [2, 2], T = [0, 0]); if(n == 2, 1, n = abs(n-2); sqrtint(denominator(elladd(E, T, ellmul(E, P, n))[1])))}; /* Michael Somos, Oct 29 2022 */
    
  • Python
    from gmpy2 import divexact
    A006721 = [1,1,1,1,1]
    for n in range(5,1001):
        A006721.append(int(divexact(A006721[n-1]*A006721[n-4]+A006721[n-2]*A006721[n-3], A006721[n-5]))) # Chai Wah Wu, Aug 15 2014
    

Formula

Comments from Andrew Hone, Aug 24 2004: "Both the even terms b(n)=a(2n) and odd terms b(n)=a(2n+1) satisfy the fourth-order recurrence b(n)=(b(n-1)*b(n-3)+8*b(n-2)^2)/b(n-4).
"Hence the general formula is a(2n)=A*B^n*sigma(c+n*k)/sigma(k)^(n^2), a(2n+1)=D*E^n*sigma(f+n*k)/sigma(k)^(n^2) where sigma is the Weierstrass sigma function associated to the elliptic curve y^2=4*x^3-(121/12)*x+845/216 (this is birationally equivalent to the minimal model V^2+U*V+6*V=U^3+7*U^2+12*U given by van der Poorten).
"The real/imaginary half-periods of the curve are w1=1.181965956, w3=0.973928783*I and the constants are A=0.142427718-1.037985022*I, B=0.341936209+0.389300717*I, c=0.163392411+w3, k=1.018573545, D=-0.363554228-0.803200610*I, E=0.644801269+0.734118205*I, f=c+k/2-w1 all to 9 decimal places."
a(4 - n) = a(n). a(n+2) * a(n-2) = 2 * a(n+1) * a(n-1) - a(n)^2 if n is even. a(n+2) * a(n-2) = 3 * a(n+1) * a(n-1) - a(n)^2 if n is odd.

Extensions

a(26)-a(27) from Robert G. Wilson v, Aug 15 2010
Definition corrected by Chai Wah Wu, Aug 15 2014

A048736 Dana Scott's sequence: a(n) = (a(n-2) + a(n-1) * a(n-3)) / a(n-4), a(0) = a(1) = a(2) = a(3) = 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 5, 13, 22, 41, 111, 191, 361, 982, 1693, 3205, 8723, 15042, 28481, 77521, 133681, 253121, 688962, 1188083, 2249605, 6123133, 10559062, 19993321, 54419231, 93843471, 177690281, 483649942, 834032173, 1579219205, 4298430243, 7412446082, 14035282561, 38202222241, 65877982561
Offset: 0

Views

Author

Keywords

Comments

The recursion has the Laurent property. If a(0), a(1), a(2), a(3) are variables, then a(n) is a Laurent polynomial (a rational function with a monic monomial denominator). - Michael Somos, Feb 05 2012
A generalization is if the recursion is modified to a(n) = (a(n-2) + a(n-1) * b*a(n-3)) / a(n-4) where b is a constant, and with arbitrary nonzero initial values, (a(0), a(1), a(2), a(3)), then a(n) = c*(a(n-3) - a(n-6)) + a(n-9) for all n in Z where c is another constant. - Michael Somos, Oct 28 2021

Examples

			G.f. = 1 + x + x^2 + x^3 + 2*x^4 + 3*x^5 + 13*x^6 + 22*x^7 + 41*x^8 + 111*x^9 + ...
		

Crossrefs

Cf. A192241, A192242 (primes and where they occur).
Cf. A276531.

Programs

  • Haskell
    a048736 n = a048736_list !! n
    a048736_list = 1 : 1 : 1 : 1 :
       zipWith div
         (zipWith (+)
           (zipWith (*) (drop 3 a048736_list)
                        (drop 1 a048736_list))
           (drop 2 a048736_list))
         a048736_list
    -- Reinhard Zumkeller, Jun 26 2011
    
  • Magma
    I:=[1,1,1,1]; [n le 4 select I[n] else (Self(n-2) + Self(n-1)*Self(n-3)) / Self(n-4): n in [1..30]]; // G. C. Greubel, Feb 20 2018
  • Maple
    P:=proc(q) local n,v; v:=[1,1,1,1]; for n from 1 to q do
    v:=[op(v),(v[-2]+v[-1]*v[-3])/v[-4]] od: op(v); end: P(35); # Paolo P. Lava, Aug 24 2025
  • Mathematica
    RecurrenceTable[{a[0] == a[1] == a[2] == a[3] == 1, a[n] == (a[n - 2] + a[n - 1]a[n - 3])/a[n - 4]}, a[n], {n, 40}] (* or *) LinearRecurrence[{0, 0, 10, 0, 0, -10, 0, 0, 1}, {1, 1, 1, 1, 2, 3, 5, 13, 22}, 41] (* Harvey P. Dale, Oct 22 2011 *)
  • PARI
    Vec((1+x+x^2-9*x^3-8*x^4-7*x^5+5*x^6+3*x^7+2*x^8) / (1-10*x^3+10*x^6-x^9)+O(x^99)) \\ Charles R Greathouse IV, Jul 01 2011
    

Formula

a(n) = 9*a(n-3) - a(n-6) - 3 - ( ceiling(n/3) - floor(n/3) ), with a(0) = a(1) = a(2) = a(3) = 1, a(4) = 2, a(5) = 3. - Michael Somos
From Jaume Oliver Lafont, Sep 17 2009: (Start)
a(n) = 10*a(n-3) - 10*a(n-6) + a(n-9).
G.f.: (1 + x + x^2 - 9*x^3 - 8*x^4 - 7*x^5 + 5*x^6 + 3*x^7 + 2*x^8)/(1 - 10*x^3 + 10*x^6 - x^9). (End)
a(n) = a(3-n) for all n in Z. - Michael Somos, Feb 05 2012

Extensions

More terms from Michael Somos

A006723 Somos-7 sequence: a(n) = (a(n-1) * a(n-6) + a(n-2) * a(n-5) + a(n-3) * a(n-4)) / a(n-7), a(0) = ... = a(6) = 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 5, 9, 17, 41, 137, 769, 1925, 7203, 34081, 227321, 1737001, 14736001, 63232441, 702617001, 8873580481, 122337693603, 1705473647525, 22511386506929, 251582370867257, 9254211194697641, 215321535159114017
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006723 n = a006723_list !! n
    a006723_list = [1,1,1,1,1,1,1] ++
      zipWith div (foldr1 (zipWith (+)) (map b [1..3])) a006723_list
      where b i = zipWith (*) (drop i a006723_list) (drop (7-i) a006723_list)
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Magma
    I:=[1,1,1,1,1,1,1]; [n le 7 select I[n] else (Self(n-1)*Self(n-6) + Self(n-2)*Self(n-5) + Self(n-3)*Self(n-4))/Self(n-7): n in [1..30]]; // G. C. Greubel, Feb 21 2018
  • Mathematica
    RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==a[4]==a[5]==a[6]==1,a[n] == (a[n-1]a[n-6]+a[n-2]a[n-5]+a[n-3]a[n-4])/a[n-7]},a,{n,30}] (* Harvey P. Dale, Jan 19 2012 *)
  • PARI
    {a(n) = my(v); if( n<0, n = 6-n); if( n<7, 1, n++; v = vector(n, k, 1); for( k=8, n, v[k] = (v[k-1] * v[k-6] + v[k-2] * v[k-5] + v[k-3] * v[k-4]) / v[k-7]); v[n])};
    
  • Python
    from gmpy2 import divexact
    A006723 = [1,1,1,1,1,1,1]
    for n in range(7,101):
        A006723.append(divexact(A006723[n-1]*A006723[n-6]+A006723[n-2]*A006723[n-5]+A006723[n-3]*A006723[n-4],A006723[n-7]))
    # Chai Wah Wu, Sep 01 2014
    

Formula

a(6 - n) = a(n) for all n in Z.
a(n) = ((8-2*(-1)^n)*a(n-5)*a(n-3)-a(n-4)^2)/a(n-8). - Bruno Langlois, Aug 09 2016

Extensions

More terms from James A. Sellers, Aug 22 2000

A102276 a(n) = (a(n-1) * a(n-5) + a(n-3)^2) / a(n-6) with a(0) = ... = a(5) = 1, a(n) = a(5-n) for all n in Z.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 3, 4, 8, 17, 50, 107, 239, 1103, 3775, 14463, 55283, 256666, 2059753, 9820288, 55075036, 503857819, 4083736906, 44590046729, 335845998321, 3581731774609, 68868876045617, 782035904796497, 11680434156713849, 194342679446776442
Offset: 0

Views

Author

Michael Somos, Jan 02 2005

Keywords

Comments

Sequence defined by recursion derived from a genus 2 curve.
Similar to the Somos-6 and Somos-7 sequences with many bilinear identities.
If a0 := a(n), a1 := a(n+1), ..., a5 := a(n+5), a6 := a(n+6) and a6 = (a5*a1 + a3^2)/a0 for all n in Z, then c := (a0^2*a1*a4*a5^2 + a0^2*a3*a4^3 + a1^3*a2*a5^2 + a0*a2^2*a3*a4^2 + a1^2*a2*a3^2*a5 + a0*a2*a3^3*a4 + a1*a2^3*a3*a5 + a2^3*a3^3)/(a0*a1*a2*a3*a4*a5) is constant. - Michael Somos, Jun 30 2024

Crossrefs

Programs

  • Magma
    I:=[1, 2, 3, 4, 8, 17]; [1, 1, 1, 1, 1] cat [n le 6 select I[n] else (Self(n-1)*Self(n-5) + Self(n-3)^2)/Self(n-6): n in [1..30]]; // G. C. Greubel, Aug 03 2018
  • Mathematica
    Join[{1, 1, 1, 1, 1}, RecurrenceTable[{a[n] == (a[n-1]*a[n-5] + a[n-3]^2)/a[n-6], a[6] == 1, a[7] == 2, a[8] == 3, a[9] == 4, a[10] == 8, a[11] == 17}, a, {n, 6, 60}]] (* G. C. Greubel, Aug 03 2018 *)
  • PARI
    {a(n) = my(an); if( n<0, a(5-n), n++; an = vector(n,i,1); for(k=7, n, an[k] = (an[k-1]*an[k-5] + an[k-3]^2) / an[k-6]); an[n])};
    

Formula

a(n) = A256858(2*n - 5) for all n in Z. - Michael Somos, Apr 13 2015
Let b(n) = A256916(n). Then 0 = a(n) * b(n) - a(n-2) * b(n+2) + a(n-3) * b(n+3) for all n in Z. - Michael Somos, Apr 13 2015
0 = a(n) * a(n+6) - a(n+1) * a(n+5) - a(n+3) * a(n+3) for all n in Z. - Michael Somos, Apr 13 2015
0 = a(n) * a(n+9) + a(n+2) * a(n+7) - a(n+3) * a(n+6) - 9 * a(n+4) * a(n+5) for all n in Z. - Michael Somos, Apr 13 2015

A368482 The degree of polynomials related to Somos-6 sequences. Also for n > 4 the degree of the (n-5)-th involution in a family of involutions in the Cremona group of rank 5 defined by a Somos-6 sequence.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 3, 4, 6, 8, 11, 13, 16, 20, 23, 27, 31, 36, 41, 45, 51, 57, 63, 69, 75, 83, 90, 97, 105, 113, 122, 130, 139, 149, 158, 168, 178, 189, 200, 210, 222, 234, 246, 258, 270, 284, 297, 310, 324, 338, 353, 367, 382, 398, 413, 429, 445, 462
Offset: 0

Views

Author

Helmut Ruhland, Dec 26 2023

Keywords

Comments

Let s(0), s(1), ..., s(4), s(5) be the 6 initial values in a Somos-6 sequence. The following terms s(6), s(7), ... are rational expressions in the 6 initial values derived from the Somos-6 recurrence: s(n) = ( s(n-1)*s(n-5) + s(n-2)*s(n-4) + s(n-3)^2 ) / s(n-6). E.g., s(6) = (s(1)*s(5) + s(2)*s(4) + s(3)^2) / s(0), s(7) = ... .
Because of the Laurent property of a Somos-6 sequence the denominator of these terms is a monomial in the initial values.
With the sequence e(n) = A369113(n), the tropical version of the Somos-6 sequence, the monomial D(n) is defined as Product_{k=0..5} s(k)^a(n-k). Define the polynomial G(n) to be s(n) * D(n). G(n) is 1 for n < 4, else G(n) is the numerator of s(n), so ..., G(4) = 1, G(5) = 1, G(6) = s(1)*s(5) + s(2)*s(4) + s(3)^2, ...
For n >= 0, a term a(n) of the actual sequence is the degree of G(n). The degree of the denominator of s(n) is a(n) - 1.
This Somos-6 sequence defines a family (proposed name: Somos family) S of (birational) involutions in Cr_5(R), the Cremona group of rank 5.
A Somos involution S(n) in this family is defined as S(n) : RP^5 -> RP^5, (s(0) : s(1) : ... : s(4) : s(5)) -> (s(n+5) : s(n+4) : ... : s(n+1) : s(n)). For n > 0 S(n) = (G(n+5) : G(n+4)*m1 : ... : G(n+1)*m4 : G(n)*m5 ), with m1, m2, ..., m4, m5 monomials. The involutions generate an infinite dihedral group. Already 2 consecutive involutions S(n), S(n+1) generate this group too. This group as a dihedral group has 2 conjugacy classes { ..., S(0), S(2), S(4), ... } and { ..., S(1), S(3), S(5), ... } of involutions. The degree of such an involution S(n) equals the degree of G(n+5) and the term a(n+5) in the actual sequence.

Crossrefs

Programs

  • Maxima
    (Maxima) N : 6$ Len : 12$     /* Somos-N, N >= 2, Len = length of the calculated lists */
    NofRT : floor (N / 2)$  /* number of terms in a Somos-N recurrence */
    S : makelist (0, Len)$
    G : makelist (0, Len)$ DegG : makelist (0, Len)$   /* G, the numerator of s() */
    for i: 1 thru N do ( S[i] : s[i - 1], G[i] : 1, DegG[i] : 0 )$
    for i: N + 1 thru Len do (
       SS : 0,
       for j : 1 thru NofRT do (
          SS : SS + S[i - j] * S[i - N + j]
       ),
       S[i] : factor (SS / S[i - N]), G[i] : num (S[i]),
       /* for N > 3 G is a homogenous polynomial, take the first monomial to determine the degree */
       Mon : G[i], if N > 3 then ( Mon : args (Mon)[1] ),
       DegG[i] : 0, for j : 0 thru N - 1 do ( DegG[i] : DegG[i] + hipow (Mon, s[j]) )
    )$ DegG;

Formula

a(n) = 1 + e(n-5) + e(n-4) + e(n-3) + e(n-2) + e(n-1) + e(n), where e(n) = A369113(n) is the exponent of one of the initial values in the denominator of s(n).
The growth rate is quadratic, a(n) = (3/20) * n^2 + O(n).
For n > 5 a(n) = (A212979(n-3) - 4) / 3. - Helmut Ruhland, Jan 31 2024
Showing 1-10 of 15 results. Next