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-4 of 4 results.

A039941 Alternately add and multiply.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 4, 8, 12, 96, 108, 10368, 10476, 108615168, 108625644, 11798392572168192, 11798392680793836, 139202068568601556987554268864512, 139202068568601568785946949658348, 19377215893777651167043206536157390321290709180447278572301746176
Offset: 0

Views

Author

Keywords

Crossrefs

A001696(n)=A039941(2*n), A001697(n)=A039941(2*n+1).

Programs

  • Haskell
    a039941 n = a039941_list !! (n-1)
    a039941_list = 0 : 1 : zipWith3 ($)
       (cycle [(+),(*)]) a039941_list (tail a039941_list)
    -- Reinhard Zumkeller, May 07 2012
  • Mathematica
    nxt[{n_,a_,b_}]:={n+1,b,If[EvenQ[n],a+b,a*b]}; Join[{0},Transpose[ NestList[ nxt,{0,0,1},20]][[3]]] (* Harvey P. Dale, Aug 23 2013 *)
  • PARI
    a(n)=if(n<2,n>0, if(n%2,a(n-1)*a(n-2),a(n-1)+a(n-2)))
    

Formula

a(2n) = a(2n-1) + a(2n-2); a(2n+1) = a(2n-1)*a(2n); a(0) = 0; a(1) = 1
a(n) = {a(n-1) + a(n-2), n even, a(n-1)*a(n-2), n odd}; a(0)=0; a(1)=1.

Extensions

Additional comments from Michael Somos, May 19 2000
One more term from Harvey P. Dale, Aug 23 2013

A001697 a(n+1) = a(n)(a(0) + ... + a(n)).

Original entry on oeis.org

1, 1, 2, 8, 96, 10368, 108615168, 11798392572168192, 139202068568601556987554268864512, 19377215893777651167043206536157390321290709180447278572301746176
Offset: 0

Views

Author

Keywords

Comments

Number of binary trees of height n where for each node the left subtree is at least as high as the right subtree. - Franklin T. Adams-Watters, Feb 08 2007
The next term (a(10)) has 129 digits. - Harvey P. Dale, Jan 24 2016
Number of plane trees where the root has exactly n children and the i-th child of any node has at most i-1 children. - David Eppstein, Dec 18 2021

References

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

Crossrefs

a(n) = A039941(2*n+1); first differences of A001696 give this sequence.
Cf. A064847.

Programs

  • Haskell
    a001697 n = a001697_list !! n
    a001697_list = 1 : 1 : f [1,1] where
       f xs@(x:_) = y : f (y : xs) where y = x * sum xs
    -- Reinhard Zumkeller, Apr 29 2013
    
  • Magma
    [n le 2 select 1 else Self(n-1)^2*(1+1/Self(n-2)): n in [1..12]]; // Vincenzo Librandi, Nov 25 2015
  • Mathematica
    a[0] = 1; a[1] = 1; a[n_] := a[n] = a[n - 1]^2*(1 + 1/a[n - 2]); Table[a[n], {n, 0, 9}]  (* Jean-François Alcover, Jul 02 2013 *)
    nxt[{t_,a_}]:={t+t*a,t*a}; Transpose[NestList[nxt,{1,1},10]][[2]] (* Harvey P. Dale, Jan 24 2016 *)
  • PARI
    a(n)=if(n<2,n >= 0,a(n-1)^2*(1+1/a(n-2)))
    

Formula

a(n) ~ c^(2^n), where c = 1.3352454783981919948826893254756974184778316104856161827213437094446034867599... . - Vaclav Kotesovec, May 21 2015

Extensions

Additional comments from Michael Somos, May 19 2000

A045761 Define polynomials Pn by P0 = 0, P1 = x, P2 = P1 + P0, P3 = P2 * P1, P4 = P3 + P2, etc. alternately adding or multiplying. For even n > 2k, then first k coefficients of Pn remain unchanged and their values are the first k terms of the sequence.

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 6, 12, 24, 50, 107, 232, 508, 1124, 2513, 5665, 12858, 29356, 67371, 155345, 359733, 836261, 1950829, 4565305, 10714501, 25212843, 59474318, 140609809, 333126672, 790764280, 1880489541, 4479494059, 10687448937, 25536624382, 61102431113
Offset: 0

Views

Author

James Boudinot (jboudinot(AT)yahoo.com)

Keywords

Examples

			The sequence of polynomials is 0, x, x, x^2, x^2 + x, x^4 + x^3, x^4 + x^3 + x^2 + x, ..., and after this all the even polynomials end with x^3 + x^2 + x (+ 0), so the first 4 terms of the sequence are these coefficients (in ascending order): 0, 1, 1, 1. - _Michael B. Porter_, Aug 09 2016
		

Crossrefs

Programs

  • Mathematica
    k = 32; P[0] = 0; P[1] = x;
    P[n_] := P[n] = If[EvenQ[n], P[n-1] + P[n-2], P[n-1]*P[n-2]] + O[x]^(2k+1) // Normal;
    CoefficientList[P[2k], x][[1 ;; k+1]] (* Jean-François Alcover, Aug 07 2016 *)

Formula

a(n) ~ c * d^n / n^(3/2), where d = 2.50297436517909273228379630... and c = 0.34042564735836570861482... . - Vaclav Kotesovec, Aug 08 2016, updated Aug 27 2016
Conjecture: 1/d = 0.39952466709679946... = A268107. - Jean-François Alcover, Aug 08 2016

Extensions

More terms from Michael Somos, May 19 2000

A057268 a(n-1)+k=a(n) => a(n)*k=a(n+1).

Original entry on oeis.org

1, 3, 6, 18, 216, 42768, 1819863936, 3311826913612597248, 10968197499701667312529793029329125376, 120301356392461906290006219878693096559247086148184247242087281541542576128
Offset: 0

Views

Author

Jonas Wallgren, Aug 22 2000

Keywords

Comments

For +k and ^k see A057269. (Using *k and ^k gives another formulation of A014222. In this case the sequence could start 1,2 - see A014221.)
See the Comments section in A001696 as a connection to some sieving process. - Ctibor O. Zizka, Feb 13 2025

Crossrefs

Programs

  • Mathematica
    nxt[{a_,b_}]:={b,b(b-a)}; NestList[nxt,{1,3},9][[All,1]] (* Harvey P. Dale, Sep 05 2017 *)

Formula

a(0) = 1, a(1) = 3, for n >= 2, a(n) = a(n - 1)*(a(n - 1) - a(n - 2)). - Ctibor O. Zizka, Feb 13 2025

Extensions

More terms from Harvey P. Dale, Sep 05 2017
Showing 1-4 of 4 results.