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

A003229 a(n) = a(n-1) + 2*a(n-3) with a(0)=a(1)=1, a(2)=3.

Original entry on oeis.org

1, 1, 3, 5, 7, 13, 23, 37, 63, 109, 183, 309, 527, 893, 1511, 2565, 4351, 7373, 12503, 21205, 35951, 60957, 103367, 175269, 297183, 503917, 854455, 1448821, 2456655, 4165565, 7063207, 11976517, 20307647, 34434061, 58387095, 99002389
Offset: 0

Views

Author

Keywords

Comments

Equals eigensequence of an infinite lower triangular matrix with 1's in the main diagonal, 0's in the subdiagonal and 2's in the subsubdiagonal (the triangle in the lower section of A155761). - Gary W. Adamson, Jan 28 2009
The operation in the comment of Jan 28 2009 is equivalent to the INVERT transform of (1, 0, 2, 0, 0, 0, ...). - Gary W. Adamson, Jan 21 2017
For n>=1, a(n) equals the number of ternary words of length n-1 having at least 2 zeros between every two successive nonzero letters. - Milan Janjic, Mar 09 2015

References

  • D. E. Daykin and S. J. Tucker, Introduction to Dragon Curves. Unpublished, 1976. See links below for an earlier version.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A077949, A077974. First differences of A003479. Partial sums of A052537. Equals |A077906(n)|+|A077906(n+1)|.

Programs

  • Haskell
    a003229 n = a003229_list !! n
    a003229_list = 1 : 1 : 3 : zipWith (+)
                               (map (* 2) a003229_list) (drop 2 a003229_list)
    -- Reinhard Zumkeller, Jan 01 2014
  • Magma
    I:=[1, 1, 3]; [n le 3 select I[n] else Self(n-1)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jun 12 2012
    
  • Maple
    seq(add(binomial(n-2*k,k)*2^k,k=0..floor(n/3)),n=1..38); # Zerinvary Lajos, Apr 03 2007
    with(combstruct): SeqSeqSeqL := [T, {T=Sequence(S), S=Sequence(U, card >= 1), U=Sequence(Z, card >=3)}, unlabeled]: seq(count(SeqSeqSeqL, size=n+4), n=0..35); # Zerinvary Lajos, Apr 04 2009
    a := n -> `if`(n<3,[1,1,3][n+1], hypergeom([-n/3, -(1+n)/3, (1-n)/3], [-n/2, -(1+n)/2], -27/2)); seq(simplify(a(n)),n=0..35); # Peter Luschny, Mar 09 2015
  • Mathematica
    LinearRecurrence[{1,0, 2},{1,1,3},40] (* Vincenzo Librandi, Jun 12 2012 *)

Formula

G.f.: (1+2*z^2)/(1-z-2*z^3). - Simon Plouffe in his 1992 dissertation
a(n) = A077949(n+1) = |A077974(n+1)|.
a(n) = u(n+1) - 3*u(n) + 2*u(n-1) where u(i) = A003230(i) [Daykin and Tucker]. - N. J. A. Sloane, Jul 08 2014
a(n) = hypergeom([-n/3,-(1+n)/3,(1-n)/3],[-n/2,-(1+n)/2],-27/2) for n>=3. - Peter Luschny, Mar 09 2015

A289265 Decimal expansion of the real root of x^3 - x^2 - 2 = 0.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jul 14 2017

Keywords

Examples

			1.6956207695598620574163671001175353426181793882085077...
		

References

  • D. E. Daykin and S. J. Tucker, Introduction to Dragon Curves, unpublished, 1976, end of section 2. See links in A003229.

Crossrefs

Cf. A078140 (includes guide to constants similar to A289260).

Programs

  • Mathematica
    z = 2000; r = 8/5;
    u = CoefficientList[Series[1/Sum[Floor[(k + 1)*r] (-x)^k, {k, 0, z}], {x, 0, z}], x];  (* A289260 *)
    v = N[u[[z]]/u[[z - 1]], 200]
    RealDigits[v, 10][[1]] (* A289265 *)
  • PARI
    solve(x=1, 2, x^3 - x^2 - 2) \\ Michel Marcus, Oct 26 2019

Formula

r = D^(1/3) + (1/9)*D^(-1/3) + 1/3 where D = 28/27 + (1/9)*sqrt(29*3) [Chang and Zhang] from the usual cubic solution formula. Or similarly r = (1/3)*(1 + C + 1/C) where C = (28 + sqrt(29*27))^(1/3). - Kevin Ryde, Oct 25 2019

A366525 Irregular triangular array read by rows: T(n,k) = number of partitions p of n such that f(p) = k >= 0, where f is defined in Comments.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 4, 3, 3, 6, 2, 6, 6, 3, 5, 9, 5, 3, 7, 9, 9, 4, 1, 7, 13, 12, 6, 4, 10, 12, 15, 12, 5, 2, 7, 16, 19, 16, 12, 5, 2, 12, 16, 24, 22, 18, 6, 3, 11, 20, 28, 29, 24, 14, 6, 3, 12, 19, 31, 34, 36, 24, 13, 4, 3, 12, 23, 36, 42, 50, 30, 25, 8, 4
Offset: 1

Views

Author

Clark Kimberling, Oct 12 2023

Keywords

Comments

For a partition p = (p(1),p(2),...,p(k)) of n, where p(1) >= p(2) >= ... >= p(k), define r(p) by subtracting 1 from p(1) and adding 1 to p(k) and then arranging the result in nonincreasing order. Iterating r eventually results in repetition; the function f(p) is the number of iterations of r up to but not including the first repeat. For example, starting with (5,3,2,2,1,1,1,1), the r-iterates are (4,3,2,2,2,1,1,1), (3,3,2,2,2,2,1,1), (3,2,2,2,2,2,2,1), (2,2,2,2,2,2,2,2), (3,2,2,2,2,2,2,1), so that f(5,3,2,2,1,1,1,1) = 3.

Examples

			First 18 rows:
   1
   1     1
   2     1
   2     3
   4     3
   3     6     2
   6     6     3
   5     9     5     3
   7     9     9     4     1
   7    13    12     6     4
  10    12    15    12     5     2
   7    16    19    16    12     5    2
  12    16    24    22    18     6    3
  11    20    28    29    24    14    6      3
  12    19    31    34    36    24    13     4     3
  12    23    36    42    50    30    25     8     4    1
  16    23    42    54    59    45    34    15     5    4
  13    28    47    57    74    61    52    28    16    5    4
Row 6 represents 3 partitions p that are self-repeating (i.e., k = 0), 6 such that f(p) = 1, and 2 such that f(p) = 2. Specifically,
  f(p) = 0 for these partitions: [6], [2,2,1,1], [2,1,1,1].
f(p) = 1 for these: [4,2], [3,3], [3,2,1], [3,1,1,1], [2,2,2], [1,1,1,1,1,1].
f(p) = 2 for these: [5,1], [4,1,1].
		

Crossrefs

Cf. A000041 (row sums), A003479 (row lengths, after 2nd term).
Cf. A062968 (1st column).

Programs

  • Mathematica
    r[list_] := If[Length[list] == 1, list, Reverse[Sort[# +
    Join[{-1}, ConstantArray[0, Length[#] - 2], {1}]] &[Reverse[Sort[list]]]]];
    f[list_] := NestWhileList[r, Reverse[Sort[list]], Unequal, All];
    t = Table[BinCounts[#, {0, Max[#] + 1, 1}] &[Map[-1 + Length[Union[#]] &[f[#]] &, IntegerPartitions[n]]], {n, 1,20}]
    Map[Length, t]; t1 = Take[t, 18]; TableForm[t1]
    Flatten[t1]
    (* Peter J. C. Moses, Oct 10 2023 *)
  • Python
    from sympy .utilities.iterables import ordered_partitions
    from collections import Counter
    def A366525_rowlist(row_n):
        A = []
        for i in range(1,row_n+1):
            A.append([]); p,C = list(ordered_partitions(i)),Counter()
            for j in range(0,len(p)):
                x,a1,a,b = 0,[],list(p[j]),list(p[j])
                while i:
                    b[-1] -= 1; b[0] += 1
                    if b[-1] == 0: b.pop(-1)
                    b = sorted(b); x += 1
                    if a == b or a1 == b:
                        C.update({x}); break
                    else:
                        a1 = a.copy(); a = b.copy()
            for z in range(1,len(C)+1): A[i-1].append(C[z])
        return(A) # John Tyler Rascoe, Nov 09 2023
Showing 1-3 of 3 results.