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

A145273 Parity sequence of A006893.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Greg Huber, Oct 06 2008

Keywords

Comments

Complement of the parity sequence of iterated triangular numbers (A117872).

Crossrefs

Cf. A145272. Complement of A117872

A007501 a(0) = 2; for n >= 0, a(n+1) = a(n)*(a(n)+1)/2.

Original entry on oeis.org

2, 3, 6, 21, 231, 26796, 359026206, 64449908476890321, 2076895351339769460477611370186681, 2156747150208372213435450937462082366919951682912789656986079991221
Offset: 0

Views

Author

Keywords

Comments

Number of nonisomorphic complete binary trees with leaves colored using two colors. - Brendan McKay, Feb 01 2001
With a(0) = 2, a(n+1) is the number of possible distinct sums between any number of elements in {1,...,a(n)}. - Derek Orr, Dec 13 2014

Examples

			Example for depth 2 (the nonisomorphic possibilities are AAAA, AAAB, AABB, ABAB, ABBB, BBBB):
         o
        / \
       /   \
      o     o
     / \   / \
    /   \ /   \
    A   B B   B
		

References

  • W. H. Cutler, Subdividing a Box into Completely Incongruent Boxes, J. Rec. Math., 12 (1979), 104-111.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A117872 (parity), A275342 (2-adic valuation).
Cf. A129440.
Cf. A013589 (start=4), A050542 (start=5), A050548 (start=7), A050536 (start=8), A050909 (start=9).

Programs

  • Haskell
    a007501 n = a007501_list !! n
    a007501_list = iterate a000217 2  -- Reinhard Zumkeller, Aug 15 2013
  • Mathematica
    f[n_Integer] := n(n + 1)/2; NestList[f, 2, 10]
  • PARI
    a(n)=if(n<1,2,a(n-1)*(1+a(n-1))/2)
    

Formula

a(n) = A006893(n+1) + 1.
a(n+1) = A000217(a(n)). - Reinhard Zumkeller, Aug 15 2013
a(n) ~ 2 * c^(2^n), where c = 1.34576817070125852633753712522207761954658547520962441996... . - Vaclav Kotesovec, Dec 17 2014
a(n) = A145272(n) + a(n-1). - J.S. Seneschal, Jul 17 2025

A057945 Number of triangular numbers needed to represent n with greedy algorithm.

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 1, 2, 3, 2, 1, 2, 3, 2, 3, 1, 2, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 2, 1, 2, 3, 2, 3, 4, 2, 3, 1, 2, 3, 2, 3, 4, 2, 3, 4, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 3, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 3, 4, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 2, 3, 4, 3
Offset: 0

Views

Author

Henry Bottomley, Oct 05 2000

Keywords

Comments

a(n) = sum of digits of A000462(n). - Reinhard Zumkeller, Mar 27 2011
The length of (number of moves in) Simon Norton's game in A006019 starting with an initial heap of n if both players always take, never put. - R. J. Mathar, May 13 2016

Examples

			a(35)=3 since 35=28+6+1
		

Crossrefs

Cf. A000217, A002262, A056944, A057944. See A006893 for records.

Programs

  • Haskell
    a057945 n = g n $ reverse $ takeWhile (<= n) $ tail a000217_list where
       g 0 _      = 0
       g x (t:ts) = g r ts + a where (a,r) = divMod x t
    -- Reinhard Zumkeller, Mar 27 2011
  • Maple
    A057945 := proc(n)
        local a,x;
        a := 0 ;
        x := n ;
        while x > 0 do
            x := x-A057944(x) ;
            a := a+1 ;
        end do:
        a ;
    end proc: # R. J. Mathar, May 13 2016
  • Mathematica
    A057944[n_] := With[{k = Floor[Sqrt[8n+1]]}, Floor[(k-1)/2]* Floor[(k+1)/2]/2];
    a[n_] := Module[{k = 0, x = n}, While[x>0, x = x - A057944[x]; k++]; k];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Mar 10 2019, after R. J. Mathar *)

Formula

a(0)=0, otherwise a(n)=a(A002262(n))+1.

A086714 a(1) = 4, a(n) = a(n-1)*(a(n-1) - 1)/2.

Original entry on oeis.org

4, 6, 15, 105, 5460, 14903070, 111050740260915, 6166133456248548335768188155, 19010600900133834176644234577571914951562754277857057935
Offset: 1

Views

Author

Jon Perry, Jul 29 2003

Keywords

Comments

The next two terms, a(10) and a(11), have 111 and 221 digits. - Harvey P. Dale, Jun 10 2011
Interpretation through plane geometry: Start with the a(n)-sided regular polygon, connect all the vertices to create a figure having a(n+1)=A000217(a(n)-1) edges. Repeat to obtain this sequence. - T. D. Noe, May 13 2016
Let y(1) = x1+x2+x3+x4, and define y(n+1) as the plethysm e2[y(n)], where e2 represents the second elementary symmetric function. Then a(n) is y(n) evaluated at x1=x2=x3=x4=1. - Per W. Alexandersson, Jun 06 2020
Each term is the number of coordinate planes in Euclidean space of the dimensionality of the previous term. - Shel Kaphan, Feb 06 2023

Examples

			a(2) = a(1)*(a(1)-1)/2 = 4*3/2 = 6.
		

Crossrefs

Programs

  • Mathematica
    RecurrenceTable[{a[1]==4,a[n]==(a[n-1](a[n-1]-1))/2},a[n],{n,10}] (* Harvey P. Dale, Jun 10 2011 *)
  • PARI
    v=vector(10,i,(i==1)*4); for(i=2,10,v[i]=v[i-1]*(v[i-1]-1)/2); v
    
  • PARI
    a086714(upto)={my(a217(n)=n*(n+1)/2,a=4);for(k=1,upto,print1(a,", ");a=a217(a-1))};
    a086714(9) \\ Hugo Pfoertner, Sep 18 2021

Formula

Limit_{n->oo} a(n)^(1/2^n) = 1.280497808541657066685323460209089278782... (see A251794). - Vaclav Kotesovec, Feb 15 2014, updated Dec 09 2014
a(n) ~ 2 * A251794^(2^n). - Vaclav Kotesovec, Dec 09 2014
a(n+1) = binomial(a(n), 2). - Shel Kaphan, Feb 06 2023

A299037 a(n) is the number of rooted binary trees with minimal Sackin index and n leaves.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 5, 3, 3, 1, 1, 1, 4, 6, 14, 17, 27, 28, 35, 28, 27, 17, 14, 6, 4, 1, 1, 1, 5, 10, 30, 55, 121, 207, 378, 575, 894, 1217, 1651, 1993, 2373, 2546, 2682, 2546, 2373, 1993, 1651, 1217, 894, 575, 378, 207, 121, 55, 30, 10, 5, 1, 1, 1, 6, 15, 55, 135, 381, 903, 2205, 4848, 10599, 21631
Offset: 1

Views

Author

Mareike Fischer, Feb 01 2018

Keywords

Comments

a(n) is also the number of maximally balanced trees with n leaves according to the Sackin index.
From Omar E. Pol, Feb 02 2018: (Start)
Also the sequence can be written as an irregular triangle read by rows in which the row lengths are the terms of A011782 (see example section).
Column 1 gives A000012. Column 2 gives A000027.
Conjecture 1: column 3 gives the nonzero terms of A000217.
Conjecture 2: column 4 gives the nonzero terms of A000330. (End)
Comment from the author, Feb 02 2018: Denote the (i,j)-th entry of the irregular triangle described above (row i, column j) with T(i,j), i >= 1 and 1 <= j <= A011782(i-1). Then, rows 1 and 2 contain a 1 each (and they denote the number of trees minimizing the Sackin index with 1 and two leaves, respectively) and row i ranges from 2^(i-2) + 1 to 2^(i-1) leaves and for each of these numbers gives the number of trees with minimum Sackin index. E.g., row 4 gives the number of such trees for 2^(4-2) + 1 = 5 leaves up to 2^(4-1) = 8 leaves.
From Omar E. Pol, Mar 01 2018: (Start)
Conjecture 3: column 5 gives the nonzero terms of A212415.
Conjecture 4: row sums give 1 together with A006893.
Conjecture 5: T(i,j) has i >= 0 where "i" is the height of the rooted trees.
Conjecture 6: For i >= 1, j is the number of leaves minus 2^(i-1). (End)

Examples

			Whenever n = 2^k, i.e., n is a power of 2, then the tree minimizing the Sackin index is unique, namely the so-called fully balanced tree of height k.
From _Omar E. Pol_, Feb 01 2018: (Start)
Written as an irregular triangle the sequence begins:
  1;
  1;
  1, 1;
  1, 2, 1,  1;
  1, 3, 3,  5,  3,  3,  1,  1;
  1, 4, 6, 14, 17, 27, 28, 35, 28, 27, 17, 14, 6, 4, 1, 1;
  ... (End)
		

Crossrefs

Cf. A001190 (number of rooted binary trees with n leaves), A011782.

Programs

  • Mathematica
    maxnumber = 1024;
    minlist = {1}; For[n = 2, n <= maxnumber, n++,
    parts = IntegerPartitions[n, {2}];
    total = 0;
    For[s = 1, s <= Length[parts], s++,
      na = parts[[s]][[1]]; nb = parts[[s]][[2]]; k = Ceiling[Log2[n]];
      ka = Ceiling[Log2[na]]; kb = Ceiling[Log2[nb]];
      If[na >= n/2 && ka == k - 1 && kb == k - 1 && na != nb,
       total = total + minlist[[na]]*minlist[[nb]],
       If[na >= n/2 && ka == k - 1 && kb == k - 1 && na == nb,
        total = total + Binomial[minlist[[na]] - 1 + 2, 2],
        If[na >= n/2 && nb == 2^(k - 2) && ka == k - 1,
         total = total + minlist[[na]]]]];
      ]; AppendTo[minlist, total];
    ]

Formula

a(1) = 1.
a(n) = Sum_{(n_a,n_b): n_a+n_b=n, n_a>=n/2, ceiling(log_2(n_a)) = ceiling(log_2(n))-1, ceiling(log_2(n_b)) = ceiling(log_2(n))-1,n_a!=n_b} a(n_a)*a(n_b) + Sum_{(n_a,n_b): n_a+n_b=n, ceiling(log_2(n_a)) = ceiling(log_2(n)) - 1, ceiling(log_2(n_b)) = ceiling(log_2(n)) - 1, n_a = n_b} binomial(a(n_a)+1,2) + Sum_{(n_a,n_b): n_a+n_b=n, ceiling(log_2(n_a)) = ceiling(log_2(n)) - 1, n_b = 2^(ceiling(log_2(n))-2)} a(n_a).

A365080 Inverse permutation to A364885.

Original entry on oeis.org

0, 1, 3, 2, 6, 4, 9, 5, 10, 7, 13, 8, 27, 14, 54, 20, 15, 11, 18, 12, 34, 19, 64, 26, 65, 35, 104, 44, 405, 119, 1539, 230, 21, 16, 24, 17, 42, 25, 75, 33, 76, 43, 118, 53, 433, 134, 1594, 251, 135, 77, 189, 90, 629, 209, 2144, 377, 2210, 665, 5564, 1034
Offset: 0

Views

Author

Rémy Sigrist, Aug 20 2023

Keywords

Examples

			A364885(42) = 36, hence a(36) = 42.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(2^k) = A000217(k + 1) for any k >= 0.
Apparently, a(2^k-1) = A006893(k) for any k > 0.

A345236 Triangle read by rows: The rightmost column contains the terms of A002262 starting at A002262(1). Each time a column's value is zero (except for a(0)), the column to its left starts at the next term in A002262, or if that column does not yet exist, it starts at A002262(2).

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 1, 2, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 3, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 2, 0, 1, 2, 1, 1, 2, 2, 1, 2, 3, 1, 2, 4, 1, 2, 5, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 0, 3, 1, 0, 0, 4, 1, 0, 0, 5, 1, 0, 0, 6, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 3
Offset: 0

Views

Author

John-Vincent Saddic, Jul 14 2021

Keywords

Comments

The first row with k columns is the A006893(k)-th. The last row with k columns comprises the first k terms of A006893.

Examples

			Triangle begins as:
  0
  1
  1 0
  1 1
  1 2
  1 0 0
  1 0 1
  1 0 2
  1 0 3
  1 1 0
		

Crossrefs

First row with n values: A006893(n).

Programs

  • Java
    See Links. Rows are printed with values concatenated. Values greater than 10 are represented between parentheses, e.g., row 100 is 113(10).

Formula

To calculate the values of the n-th row:
c(m) = floor((sqrt(9 + 8*m) - 3)/2) = A052146(m+1).
r(m) = m - (c(m)^2)/2 - 3*c(m)/2 = A002262(m+1).
The last value of row m is r(m), the second to last value is r(c(m)), the third to last value is r(c(c(m))), and so on until c(m) equals 0.

A086742 Start with a(0)=1, then k-th run is 1,2,3,..., a(0) + a(1) + a(2) + ... + a(k-1).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47
Offset: 0

Views

Author

Benoit Cloitre, Jul 29 2003

Keywords

Examples

			The first 3 runs are (1), (1), (1, 2) and a(0) + a(1) + a(2) + a(3) = 1+1+1+2 = 5, so the 4th run is 1, 2, 3, 4, 5 and the sequence continues: (1), (1), (1, 2), (1, 2, 3, 4, 5), ...
		

Crossrefs

Cf. A006893.

Formula

a(0) + a(1) + a(2) + ... + a(r(k)) = A006893(k) where r(k) denotes the index of the end of the k-th run. I.e., the first 4 runs are (1), (1), (1, 2), (1, 2, 3, 4, 5), so the 4th run ends with 5=a(8), so r(4)=8 and a(0) + a(1) + a(2) + ... + a(r(4)) = 1+1+1+2+1+2+3+4+5 = 20 which is A006893(4).

A331753 Let m(k) be the index of the largest triangular number <= k; then a(n) is the smallest number k that can be written as the sum of three triangular numbers if the largest is the (m(k)-n)-th triangular number, but no larger.

Original entry on oeis.org

20, 50, 176, 110, 578, 614, 1163, 1070, 5135, 9503, 14648, 7928, 6035, 18653, 22130, 119204, 18128, 68258, 57335, 304799, 84725, 1024532, 215928, 692858, 688850, 637853, 736835, 1406105, 1801547, 1987469, 3673403, 654155, 8576861, 808718, 810146, 21515948
Offset: 1

Views

Author

Jon E. Schoenfield, Feb 02 2020

Keywords

Comments

Fermat asserted, and Gauss proved, that every number is the sum of three triangular numbers (cf. A002636).
For exactly half of the integers k in 1..11898, decomposing k into triangular numbers by the greedy algorithm (i.e., letting T1 be the largest triangular number <= k, then letting T2 be the largest triangular number <= k-T1, etc.) yields a decomposition of k into three or fewer positive triangular numbers, but for any K > 11898, the greedy algorithm decomposes more than half of the integers k in 1..K into four or more positive triangular numbers.
Even an approach that assigns only T1 "greedily" but allows T2 to be any triangular number will usually not yield a set of three triangular numbers whose sum is k: for more than half of the integers k in 1..K for any K > 40304762, no such sum exists in which the largest of the three triangular numbers is the largest triangular number <= k. The smallest such k is a(1)=20 (see Example section).
For some values of k, there exists no set of three triangular numbers summing to k unless the largest of the three is neither T(m(k)) nor T(m(k)-1); the smallest of these is a(2)=50, for which a solution to T(m(k)-2) + T2 + T3 = k does exist (see Example section).

Examples

			The largest triangular number <= 20 is T(5) = 5*6/2 = 15, and 20 cannot be expressed as the sum of 3 triangular numbers T1 + T2 + T3 if T1=15, but at T1 = T(5-1) = T(4) = 4*5/2 = 10, 20 can be expressed as T(4) + T(4) + T(0) = 10 + 10 + 0, and 20 is the smallest number with this property, so a(1)=20.
The largest triangular number <= 50 is T(9) = 9*10/2 = 45, and 50 can be expressed as T1 + T2 + T3 neither with T1 = T(9) = 45 nor with T1 = T(9-1) = T(8) = 36; however, at T1 = T(9-2) = T(7) = 28, 50 can be expressed as T(7) + T(6) + T(1) = 28 + 21 + 1, and 50 is the smallest number with this property, so a(2)=50.
		

Crossrefs

Cf. A000217 (triangular numbers), A002636 (number of ways of writing n as an unordered sum of at most 3 nonzero triangular numbers), A006893 (smallest number whose greedy decomposition uses n triangular numbers).
Showing 1-9 of 9 results.