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 32 results. Next

A333251 Tropical version of Somos-5 sequence A006721.

Original entry on oeis.org

-1, 0, 0, 0, 0, 1, 1, 1, 2, 3, 3, 4, 5, 6, 6, 8, 9, 10, 11, 13, 14, 15, 17, 19, 20, 22, 24, 26, 27, 30, 32, 34, 36, 39, 41, 43, 46, 49, 51, 54, 57, 60, 62, 66, 69, 72, 75, 79, 82, 85, 89, 93, 96, 100, 104, 108, 111, 116, 120, 124, 128, 133, 137, 141, 146, 151
Offset: 0

Views

Author

Michael Somos, Mar 13 2020

Keywords

Comments

If (x, y, s(0), .., s(4)) are 7 variables and s(n) = (x*s(n-1)*s(n-4) + y*s(n-2)*s(n-3))/s(n-5) for n>=5 is the generalized Somos-5 sequence, then s(n) is a Laurent polynomial in the variables with the numerator being irreducible and the denominator is Product_{k=0..4} s(k)^a(n-k).

Examples

			G.f. = -1 + x^5 + x^6 + x^7 + 2*x^8 + 3*x^9 + 3*x^10 + 4*x^11 + ...
s(7) = ((s(0)*s(3)^2*s(4) + s(1)^2*s(4)^2)*x*y + s(1)*s(2)*s(3)*s(4)*(y^2+x^3) + s(2)^2*s(3)^2*x^2*y)/(s(0)^1*s(1)^1*s(2)^1*s(3)^0*s(4)^0).
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := With[{m = Mod[n, 14]}, Quotient[n^2, 28] - Boole[m==0] + Boole[m==5] + Boole[m==9]];
    a[ n_] := SeriesCoefficient[ -(1 - x - x^2 + x^3 - x^5) / ((1 - x) * (1 - x^2) * (1 - x^7)), {x, 0, Abs@n}];
  • PARI
    {a(n) = n^2\28 - (n%14==0) + (n%14==5) + (n%14==9)};
    
  • PARI
    {a(n) = n=abs(n); polcoeff( -(1 - x - x^2 + x^3 - x^5) / ((1 - x) * (1 - x^2) * (1 - x^7)) + x * O(x^n), n)};

Formula

G.f.: -(1 - x - x^2 + x^3 - x^5)/((1 - x)*(1 - x^2)*(1 - x^7)).
a(n) = max( a(n-1) + a(n-4), a(n-2) + a(n-3) ) - a(n-5) for all n in Z.
a(n) = a(n+7) - 2 - floor(n/2) for all n in Z.
Second difference has period 14.

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

A060006 Decimal expansion of real root of x^3 - x - 1 (the plastic constant).

Original entry on oeis.org

1, 3, 2, 4, 7, 1, 7, 9, 5, 7, 2, 4, 4, 7, 4, 6, 0, 2, 5, 9, 6, 0, 9, 0, 8, 8, 5, 4, 4, 7, 8, 0, 9, 7, 3, 4, 0, 7, 3, 4, 4, 0, 4, 0, 5, 6, 9, 0, 1, 7, 3, 3, 3, 6, 4, 5, 3, 4, 0, 1, 5, 0, 5, 0, 3, 0, 2, 8, 2, 7, 8, 5, 1, 2, 4, 5, 5, 4, 7, 5, 9, 4, 0, 5, 4, 6, 9, 9, 3, 4, 7, 9, 8, 1, 7, 8, 7, 2, 8, 0, 3, 2, 9, 9, 1
Offset: 1

Views

Author

Fabian Rothelius, Mar 14 2001

Keywords

Comments

Has been also called the silver number, also the plastic number.
This is the smallest Pisot-Vijayaraghavan number.
The name "plastic number" goes back to the Dutch Benedictine monk and architect Dom Hans van der Laan, who gave this name 4 years after the discovery of the number by the French engineer Gérard Cordonnier in 1924, who used the name "radiant number". - Hugo Pfoertner, Oct 07 2018
Sometimes denoted by the symbol rho. - Ed Pegg Jr, Feb 01 2019
Also the solution of 1/x + 1/(1+x+x^2) = 1. - Clark Kimberling, Jan 02 2020
Given any complex p such that real(p)>-1, this constant is the only real solution of the equation z^p+z^(p+1)=z^(p+3), and the only attractor of the complex mapping z->M(z,p), where M(z,p)=(z^p+z^(p+1))^(1/(p+3)), convergent from any complex plane point. - Stanislav Sykora, Oct 14 2021
The Pisot-Vijayaraghavan numbers were named after the French mathematician Charles Pisot (1910-1984) and the Indian mathematician Tirukkannapuram Vijayaraghavan (1902-1955). - Amiram Eldar, Apr 02 2022
The sequence a(n) = v_3^floor(n^2/4) where v_n is the smallest, positive, real solution to the equation (v_n)^n = v_n + 1 satisfies the Somos-5 recursion a(n+3)*a(n-2) = a(n+2)*a(n-1) + a(n+1)*a(n) for all n in Z. Also true if floor is removed. - Michael Somos, Mar 24 2023

Examples

			1.32471795724474602596090885447809734...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 1.2.2.
  • Midhat J. Gazalé, Gnomon: From Pharaohs to Fractals, Princeton University Press, Princeton, NJ, 1999, see Chap. VII.
  • Donald E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.4, p. 236.
  • Ian Stewart, A Guide to Computer Dating (Feedback), Scientific American, Vol. 275 No. 5, November 1996, p. 118.

Crossrefs

Cf. A001622. A072117 gives continued fraction.
Other Pisot numbers: A086106, A092526, A228777, A293506, A293508, A293509, A293557.

Programs

  • Magma
    SetDefaultRealField(RealField(100)); ((3+Sqrt(23/3))/6)^(1/3) + ((3-Sqrt(23/3))/6)^(1/3); // G. C. Greubel, Mar 15 2019
    
  • Maple
    (1/2 +sqrt(23/3)/6)^(1/3) + (1/2-sqrt(23/3)/6)^(1/3) ; evalf(%,130) ; # R. J. Mathar, Jan 22 2013
  • Mathematica
    RealDigits[ Solve[x^3 - x - 1 == 0, x][[1, 1, 2]], 10, 111][[1]] (* Robert G. Wilson v, Sep 30 2009 *)
    s = Sqrt[23/108]; RealDigits[(1/2 + s)^(1/3) + (1/2 - s)^(1/3), 10, 111][[1]] (* Robert G. Wilson v, Dec 12 2017 *)
    RealDigits[Root[x^3-x-1,1],10,120][[1]] (* or *) RealDigits[(Surd[9-Sqrt[69],3]+Surd[9+Sqrt[69],3])/(Surd[2,3]Surd[9,3]),10,120][[1]] (* Harvey P. Dale, Sep 04 2018 *)
  • PARI
    allocatemem(932245000); default(realprecision, 20080); x=solve(x=1, 2, x^3 - x - 1); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b060006.txt", n, " ", d)); \\ Harry J. Smith, Jul 01 2009
    
  • PARI
    (1/2 +sqrt(23/3)/6)^(1/3) + (1/2-sqrt(23/3)/6)^(1/3) \\ Altug Alkan, Apr 10 2016
    
  • PARI
    polrootsreal(x^3-x-1)[1] \\ Charles R Greathouse IV, Aug 28 2016
    
  • PARI
    default(realprecision, 110); digits(floor(solve(x=1, 2, x^3 - x - 1)*10^105)) /* Michael Somos, Mar 24 2023 */
    
  • Sage
    numerical_approx(((3+sqrt(23/3))/6)^(1/3) + ((3-sqrt(23/3))/6)^(1/3), digits=100) # G. C. Greubel, Mar 15 2019

Formula

Equals (1/2+sqrt(23/108))^(1/3) + (1/2-sqrt(23/108))^(1/3). - Henry Bottomley, May 22 2003
Equals CubeRoot(1 + CubeRoot(1 + CubeRoot(1 + CubeRoot(1 + ...)))). - Gerald McGarvey, Nov 26 2004
Equals sqrt(1+1/sqrt(1+1/sqrt(1+1/sqrt(1+...)))). - Gerald McGarvey, Mar 18 2006
Equals (1/2 +sqrt(23/3)/6)^(1/3) + (1/2-sqrt(23/3)/6)^(1/3). - Eric Desbiaux, Oct 17 2008
Equals Sum_{k >= 0} 27^(-k)/k!*(Gamma(2*k+1/3)/(9*Gamma(k+4/3)) - Gamma(2*k-1/3)/(3*Gamma(k+2/3))). - Robert Israel, Jan 13 2015
Equals sqrt(Phi) = sqrt(1.754877666246...) (see A109134). - Philippe Deléham, Sep 29 2020
Equals cosh(arccosh(3*c)/3)/c, where c = sqrt(3)/2 (A010527). - Amiram Eldar, May 15 2021
Equals 1/hypergeom([1/5, 2/5, 3/5, 4/5], [2/4, 3/4, 5/4], -5^5/4^4). - Gerry Martens, Mar 16 2025

Extensions

Edited and extended by Robert G. Wilson v, Aug 03 2002
Removed incorrect comments, Joerg Arndt, Apr 10 2016

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

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

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 5, 9, 23, 75, 421, 1103, 5047, 41783, 281527, 2534423, 14161887, 232663909, 3988834875, 45788778247, 805144998681, 14980361322965, 620933643034787, 16379818848380849, 369622905371172929, 20278641689337631649, 995586066665500470689
Offset: 0

Views

Author

Keywords

References

  • C. Pickover, Mazes for the Mind, St. Martin's Press, NY, 1992, p. 350.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a006722 n = a006722_list !! n
    a006722_list = [1,1,1,1,1,1] ++
      zipWith div (foldr1 (zipWith (+)) (map b [1..3])) a006722_list
      where b i = zipWith (*) (drop i a006722_list) (drop (6-i) a006722_list)
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Magma
    [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]]; // Vincenzo Librandi, Dec 02 2015
  • Mathematica
    a[n_ /; 0 <= n <= 5] = 1; a[n_] := a[n] = (a[n-1]*a[n-5] + a[n-2]*a[n-4] + a[n-3]^2) / a[n-6]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Nov 22 2013 *)
    RecurrenceTable[{a[0]==a[1]==a[2]==a[3]==a[4]==a[5]==1,a[n]==(a[n-1]a[n-5]+ a[n-2]a[n-4]+a[n-3]^2)/a[n-6]},a,{n,30}] (* Harvey P. Dale, Dec 20 2014 *)
  • PARI
    {a(n) = if( n>-1 && n<6, 1, if( n<0, a(5 - n), (a(n - 1) * a(n - 5) + a(n - 2) * a(n - 4) + a(n-3) * a(n-3)) / a(n - 6)))}; /* Michael Somos, Jan 30 2012 */
    
  • Python
    from gmpy2 import divexact
    A006722 = [1,1,1,1,1,1]
    for n in range(6,101):
        A006722.append(divexact(A006722[n-1]*A006722[n-5]+A006722[n-2]*A006722[n-4]+A006722[n-3]**2,A006722[n-6]))
    # Chai Wah Wu, Sep 01 2014
    

Formula

a(n) = a(5-n).
Michael Somos found an explicit formula for a(n) in 1993, which is not as widely known as it should be. The following is a quotation from the "Somos 6 sequence" document mentioned in the Links section: (Start)
This sequence is one of a large class of sequences of numbers that satisfy a non-linear recurrence relation depending on previous terms. It is also one of the class of sequences which can be computed from a theta series, hence I call them theta sequences. Here are the details:
Fix the following seven constants:
c1 = 0.875782749065950194217251...,
c2 = 1.084125925473763343779968...,
c3 = 0.114986002186402203509006...,
c4 = 0.077115634258697284328024...,
c5 = 1.180397390176742642553759...,
c6 = 1.508030831265086447098989..., and
c7 = 2.551548771413081602906643... .
Consider the doubly indexed series: f(x,y) = c1*c2^(x*y)*sum(k2, (-1)^k2*sum(k1, g(k1,k2,x,y))) , where g(k1,k2,x,y) = c3^(k1*k1)*c4^(k2*k2)*c5^(k1*k2)*cos(c6*k1*x+c7*k2*y) . Here both sums range over all integers.
Then the sequence defined by a(n) = f(n-2.5,n-2.5) is the Somos 6 sequence. I announced this in 1993. (End) - N. J. A. Sloane, Dec 06 2015
From Andrew Hone and Yuri Fedorov, Nov 27 2015: (Start)
The following is an exact formula for a(n):
a(n+3) = A*B^n*C^(n^2 -1)*sigma(v_0 + n*v) / sigma(v)^(n^2),
where
A = C / sigma(v_0),
B = A^(-1)*sigma(v) / sigma(v_0+v),
C = i/sqrt(20) (with i the imaginary unit),
sigma is the two-variable Kleinian sigma-function associated with the genus two curve X: y^2 = 4*x^5 - 233*x^4 + 1624*x^3 - 422*x^2 + 36*x - 1, and
v and v_0 are two-component vectors in the Jacobian of X, being the images under the Abel map of the divisors P_1+P_2 - 2*infinity, Q_1 + Q_2 - 2*infinity, respectively, where points P_j and Q_j on X are given by
P_1 = ( -8 + sqrt(65), 20*i*(129 -16*sqrt(65)) ),
P_2 = ( -8 - sqrt(65), 20*i*(129 +16*sqrt(65)) ),
Q_1 = ( 5 + 2*sqrt(6), 4*i*(71 +sqrt(6)) ),
Q_2 = ( 5 - 2*sqrt{6}, 4*i*(71 -sqrt(6)) ).
The Abel map is based at infinity and calculated with respect to the basis of holomorphic differentials dx/y, x dx/y.
Approximate values from Maple are A = 0.0619-0.0317*i, B = -0.0000973-0.0000158*i, v = (-.341*i, .477*i), v_0 = (-.379-.150*i, -.259+.576*i).
(End)

Extensions

More terms from James A. Sellers, Aug 22 2000

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

A078495 a(n) = (a(n-1) * a(n-6) + a(n-3) * a(n-4)) / a(n-7) (a variant of Somos-7).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 6, 12, 24, 72, 144, 288, 864, 3456, 10368, 41472, 124416, 497664, 2985984, 17915904, 71663616, 429981696, 2579890176, 20639121408, 185752092672, 1486016741376, 8916100448256, 106993205379072
Offset: 0

Views

Author

Michael Somos, Nov 26 2002

Keywords

Comments

From Vladimir Shevelev, Apr 16 2016: (Start)
For k >= 0, an infinite sequence {b(k,n)} of Somos's sequences (n >= 0) is:
b(k,0) = b(k,1) = ... = b(k,2*k+2) = 1;
and then for n >= 2*k+3,
b(k,n) = (b(k,n-1)*b(k,n-2*k-2) + b(k,n-k-1)*b(k,n-k-2))/b(k,n-2*k-3).
In particular, {b(0,n)} is essentially A060656, {b(1,n)}=A006721, {a(2,n)}=A078495.
One can prove that the sequence {b(k,n)} has the first 4*(k+1) simple differences: 2k+2 zeros, after that k+1 1's and after that k+1 consecutive doubled triangular numbers (A000217), beginning with 2.
Further we have nontrivial differences. The first of them for k=0,1,2,... are 12, 26, 48, 80, 124, 182, 256, 348, 460, 594, ..., that is, {k^3/3 + 3*k^2 + 32*k/3 + 12}.
(End)

References

  • G. Everest, A. van der Poorten, I. Shparlinski and T. Ward, Recurrence Sequences, Amer. Math. Soc., 2003; see esp. p. 255.

Crossrefs

Programs

  • Haskell
    a078495 n = a078495_list !! n
    a078495_list = [1, 1, 1, 1, 1, 1, 1] ++
      zipWith div (foldr1 (zipWith (+)) (map b [1,3])) a078495_list
      where b i = zipWith (*) (drop i a078495_list) (drop (7-i) a078495_list)
    -- Reinhard Zumkeller, May 05 2013
    
  • Magma
    I:=[1,1,1,1,1,1,1]; [n le 7 select I[n] else (Self(n-1)*Self(n-6) + 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-3]*a[n-4])/a[n-7]},a,{n,40}] (* Harvey P. Dale, Apr 20 2012 *)
  • PARI
    {a(n) = if( n<0, a(6-n), if( n<7, 1, (a(n-1) * a(n-6) + a(n-3) * a(n-4)) / a(n-7)))};
    
  • PARI
    {a(n) = 2^(b(n-9) + b(n-7)) * 3^b(n-8)}; {b(n) = (n^2 + 10*n + 1 - n%2*13) \ 60 + 1}; /* b(n) = A025795(n) */
    

Formula

a(n) = 144 * a(n-6) * a(n-10) / a(n-16), a(n) = a(6-n) for all n in Z.

A268199 Somos's sequence {b(3,n)} defined in comment in A078495: a(0)=a(1)=...=a(8)=1; for n>=9, a(n)=(a(n-1)*a(n-8)+a(n-4)*a(n-5))/a(n-9).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 7, 13, 25, 45, 125, 233, 419, 805, 2252, 8343, 23554, 55889, 195533, 514781, 1769117, 6540689, 31873013, 162776741, 568710437, 1840702289, 10169970946, 53308101423, 363030298268, 1933899726085, 12286029791291
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n le 9 select 1 else (Self(n-1)*Self(n-8) + Self(n-4)*Self(n-5)) /Self(n-9): n in [1..40]]; // G. C. Greubel, Feb 21 2018
  • Mathematica
    a[k_,n_]:=a[k,n]=If[n>2k+2,(a[k,(n-1)]*a[k,(n-2k-2)]+a[k,(n-k-1)]*a[k,(n-k-2)])/a[k,(n-2k-3)],1];
    Map[a[3,#]&,Range[0,50]] (* Peter J. C. Moses, Apr 16 2016 *)
    a[ n_] := a[n] = Which[ n<0, a[8-n], n<9, 1, True, (a[n - 1] a[n - 8] + a[n - 4] a[n - 5]) / a[n - 9]]; (* Michael Somos, Nov 16 2016 *)
  • PARI
    {a(n) = if(n<= 8, 1, (a(n-1)*a(n-8)+a(n-4)*a(n-5))/a(n-9))};
    for(n=1,40, print1(a(n), ", ")) \\ G. C. Greubel, Feb 21 2018
    

Formula

a(n) = a(8-n) for all n in Z. - Michael Somos, Nov 16 2016

A271949 Somos's sequence {b(4,n)} defined in comment in A078495: a(0)=a(1)=...=a(10)=1; for n>=11, a(n)=(a(n-1)*a(n-10)+a(n-5)*a(n-6))/a(n-11).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 8, 14, 26, 46, 76, 200, 356, 596, 1044, 1952, 5136, 17888, 48376, 109520, 225248, 724672, 1749280, 5359328, 18277312, 57803136, 235710976, 1067767168, 3411743616, 9748806656, 29696723456, 156028988416
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n le 11 select 1 else (Self(n-1)*Self(n-10) + Self(n-5)*Self(n- 6))/Self(n-11): n in [1..30]]; // G. C. Greubel, Feb 21 2018
  • Mathematica
    a[k_,n_]:=a[k,n]=If[n>2k+2,(a[k,(n-1)]*a[k,(n-2k-2)]+a[k,(n-k-1)]*a[k,(n-k-2)])/a[k,(n-2k-3)],1];
    Map[a[4,#]&,Range[0,50]] (* Peter J. C. Moses, Apr 17 2016 *)
    RecurrenceTable[{Table[a[d]==1,{d,0,10}],a[n]==(a[n-1]a[n-10]+ a[n-5]a[n-6])/ a[n-11]},a,{n,50}] (* Harvey P. Dale, Oct 18 2021 *)
  • PARI
    {a(n) = if(n< 11, 1, (a(n-1)*a(n-10) + a(n-5)*a(n-6))/a(n-11))};
    for(n=0,30, print1(a(n), ", ")) \\ G. C. Greubel, Feb 21 2018
    
Showing 1-10 of 32 results. Next