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

A327710 Number of compositions of n into distinct parts such that the difference between any two parts is at least two.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 5, 5, 7, 13, 15, 21, 29, 35, 43, 55, 87, 99, 137, 173, 235, 277, 363, 429, 545, 755, 895, 1135, 1443, 1827, 2285, 2837, 3463, 4285, 5199, 6309, 8237, 9755, 12091, 14743, 18351, 22251, 27833, 33125, 40819, 49045, 59691, 70869, 86033, 106163
Offset: 0

Views

Author

Alois P. Heinz, Feb 24 2020

Keywords

Comments

All terms are odd.

Examples

			a(9) = 13: 135, 153, 315, 351, 513, 531, 36, 63, 27, 72, 18, 81, 9.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 b(n$2, 0):
    seq(a(n), n=0..50);
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1,
         `if`(i<1, 0, b(n, i-1)+b(n-i, min(n-i, i))))
        end:
    a:= n-> add(k!*b(n-k^2, k), k=0..floor(sqrt(n))):
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 1, 0,
         b[n, i - 1] + b[n - i, Min[n - i, i]]]];
    a[n_] := Sum[k!*b[n - k^2, k], {k, 0, Floor[Sqrt[n]]}];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 12 2021, after Alois P. Heinz *)

Formula

a(n) = Sum_{k>=0} k! * A268187(n,k).
G.f.: Sum_{k>=0} k! * x^(k^2) / Product_{j=1..k} (1 - x^j). - Ilya Gutkovskiy, Dec 04 2020

A332829 Number of compositions of n such that the difference between adjacent parts is at least two.

Original entry on oeis.org

1, 1, 1, 1, 3, 4, 6, 9, 15, 23, 36, 55, 87, 136, 212, 329, 515, 802, 1251, 1949, 3043, 4745, 7401, 11535, 17994, 28063, 43766, 68243, 106433, 165981, 258854, 403670, 629530, 981750, 1531055, 2387660, 3723569, 5806905, 9055889, 14122638, 22024291, 34346886
Offset: 0

Views

Author

Alois P. Heinz, Feb 25 2020

Keywords

Examples

			a(4) = 3: 13, 31, 4.
a(5) = 4: 131, 14, 41, 5.
a(6) = 6: 141, 24, 42, 15, 51, 6.
a(7) = 9: 313, 142, 241, 151, 25, 52, 16, 61, 7.
a(8) = 15: 1313, 3131, 242, 314, 413, 152, 251, 35, 53, 161, 26, 62, 17, 71, 8.
a(9) = 23:  13131, 1314, 1413, 3141, 4131, 414, 252, 135, 153, 315, 351, 513, 531, 162, 261, 36, 63, 171, 27, 72, 18, 81, 9.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, add(`if`(abs
          (i-j)<2, 0, b(n-j, `if`(n<2*j-1, -1, j))), j=1..n))
        end:
    a:= n-> b(n, -1):
    seq(a(n), n=0..50);
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, 1, Sum[If[Abs[i - j] < 2, 0,
         b[n - j, If[n < 2*j - 1, -1, j]]], {j, 1, n}]];
    a[n_] := b[n, -1];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Apr 13 2022, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n, where d = 1.55950091106966174000570854045613844480247532446123619115121795622156266..., c = 0.42021981384104890468461570042297109905705539874851026797544718780579866... - Vaclav Kotesovec, Feb 28 2020
Showing 1-2 of 2 results.