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.

A335941 Number of partitions of n such that the set s of parts and multiplicities satisfies s = {1..max(s)}.

Original entry on oeis.org

1, 1, 2, 1, 1, 4, 2, 5, 5, 9, 8, 15, 11, 14, 22, 28, 30, 36, 37, 53, 60, 80, 83, 104, 114, 148, 157, 201, 218, 283, 284, 362, 400, 455, 518, 624, 697, 807, 907, 1036, 1181, 1368, 1531, 1727, 1990, 2197, 2563, 2849, 3182, 3568, 4095, 4548, 5143, 5720, 6420
Offset: 0

Views

Author

Alois P. Heinz, Jun 30 2020

Keywords

Examples

			a(0) = 1: the empty partition.
a(1) = 1: 1.
a(2) = 2: 11, 2.
a(3) = 1: 21.
a(4) = 1: 211.
a(5) = 4: 2111, 221, 311, 32.
a(6) = 2: 2211, 321.
a(7) = 5: 22111, 2221, 3211, 322, 331.
a(8) = 5: 22211, 32111, 3221, 3311, 332.
a(9) = 9: 222111, 321111, 32211, 3222, 33111, 3321, 42111, 4311, 432.
a(10) = 8: 2221111, 322111, 32221, 331111, 33211, 4222, 4321, 433.
		

Crossrefs

Programs

  • Maple
    b:= proc(n,i,s) option remember;
         `if`(n=0, `if`(s={$0..max(s)}, 1, 0), `if`(i<1, 0, add(
            b(n-i*j, i-1, {s[], j, `if`(j=0, 0, i)}), j=0..n/i)))
        end:
    a:= n-> b(n, floor((sqrt(1+8*(n+1))-1)/2), {0}):
    seq(a(n), n=0..55);
  • Mathematica
    b[n_, i_, s_] := b[n, i, s] =
         If[n == 0, If[s == Range[0, Max[s]], 1, 0], If[i < 1, 0, Sum[
         b[n-i*j, i-1, Union@Flatten@{s, j, If[j == 0, 0, i]}], {j, 0, n/i}]]];
    a[n_] := b[n, Floor[(Sqrt[1 + 8*(n + 1)] - 1)/2], {0}];
    Table[a[n], {n, 0, 55}] (* Jean-François Alcover, May 30 2022, after Alois P. Heinz *)

A338271 a(n) is the number of compositions of n, b_1 + ... + b_t = n such that sqrt(b_1 + sqrt(b_2 + ... + sqrt(b_t)...)) is an integer.

Original entry on oeis.org

1, 0, 0, 2, 0, 2, 0, 2, 2, 4, 2, 6, 2, 8, 4, 14, 6, 20, 8, 28, 14, 44, 20, 66, 30, 96, 46, 146, 70, 220, 102, 326, 154, 490, 232, 740, 346, 1102, 520, 1652, 782, 2484, 1166, 3716, 1750, 5568, 2628, 8358, 3936, 12518, 5900, 18760, 8848, 28138, 13256, 42170
Offset: 1

Views

Author

Peter Kagey, Oct 19 2020

Keywords

Comments

a(n) <= Sum_{k=1..floor(sqrt(n)/2)} A338286(floor((n-4*k^2)/2)) when n is even.
a(n) <= Sum_{k=1..floor((sqrt(n) - 1)/2)} A338286(floor((n-4*k^2-4*k-1)/2)) when n is odd and greater than 1.

Examples

			(Let s(k) = sqrt(k) for brevity.)
For n = 14, the a(14) = 8 valid compositions are:
14 = 2+2+2+2+2+3+1 and 2 = s(2+s(2+s(2+s(2+s(2+s(3+s(1)))))))
14 = 1+7+2+3+1     and 2 = s(1+s(7+s(2+s(3+s(1)))))
14 = 2+1+7+3+1     and 2 = s(2+s(1+s(7+s(3+s(1)))))
14 = 2+2+1+8+1     and 2 = s(2+s(2+s(1+s(8+s(1)))))
14 = 2+2+2+2+2+4   and 2 = s(2+s(2+s(2+s(2+s(2+s(4))))))
14 = 1+7+2+4       and 2 = s(1+s(7+s(2+s(4))))
14 = 2+1+7+4       and 2 = s(2+s(1+s(7+s(4))))
14 = 2+2+1+9       and 2 = s(2+s(2+s(1+s(9))))
		

Crossrefs

Formula

a(n) = Sum_{i=k..A000196(n)} A338268(n,k).

A335443 Number of compositions of n where neighboring runs have different lengths.

Original entry on oeis.org

1, 1, 2, 2, 5, 8, 13, 24, 42, 68, 122, 210, 360, 622, 1077, 1858, 3198, 5519, 9549, 16460, 28386, 49031, 84595, 145988, 251956, 434805, 750418, 1294998, 2234971, 3857106, 6656383, 11487641, 19825318, 34214136, 59046458, 101901743, 175860875, 303498779
Offset: 0

Views

Author

Alois P. Heinz, Jul 06 2020

Keywords

Examples

			a(0) = 1: the empty composition.
a(1) = 1: 1.
a(2) = 2: 2, 11.
a(3) = 2: 3, 111.
a(4) = 5: 4, 22, 112, 211, 1111.
a(5) = 8: 5, 113, 122, 221, 311, 1112, 2111, 11111.
a(6) = 13: 6, 33, 114, 222, 411, 1113, 1221, 2112, 3111, 11112, 11211, 21111, 111111.
a(7) = 24: 7, 115, 133, 223, 322, 331, 511, 1114, 1222, 2113, 2221, 3112, 4111, 11113, 11122, 11311, 21112, 22111, 31111, 111112, 111211, 112111, 211111, 1111111.
a(8) = 42: 8, 44, 116, 224, 233, 332, 422, 611, 1115, 1223, 1331, 2114, 2222, 3113, 3221, 4112, 5111, 11114, 11222, 11411, 12221, 21113, 22211, 31112, 41111, 111113, 111122, 111221, 111311, 112112, 113111, 122111, 211112, 211211, 221111, 311111, 1111112, 1111211, 1112111, 1121111, 2111111, 11111111.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l, t) option remember; `if`(n=0, 1, add(add(
          `if`(j=t, 0, b(n-i*j, i, j)), j=1..n/i), i={$1..n} minus {l}))
        end:
    a:= n-> b(n, 0$2):
    seq(a(n), n=0..40);
  • Mathematica
    b[n_, l_, t_] := b[n, l, t] = If[n == 0, 1, Sum[Sum[If[j == t, 0,
         b[n-i*j, i, j]], {j, 1, n/i}], {i, Range[n]~Complement~{l}}]];
    a[n_] := b[n, 0, 0];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 13 2022, after Alois P. Heinz *)
Showing 1-3 of 3 results.