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.

A378842 Number of compositions (ordered partitions) of n into reciprocals of positive integers <= n.

Original entry on oeis.org

1, 1, 5, 154, 127459, 1218599617, 2319241469466200, 32824171395278825785183, 115384552858168166552304749413033, 22529589324775724210737089575811718669447945, 1255772217551224641521320538899160332818484462756697922572, 885355014578065534254256068634855343582928219947780981811219956595305584
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 09 2024

Keywords

Examples

			a(2) = 5 because we have [1/2, 1/2, 1/2, 1/2], [1/2, 1/2, 1], [1/2, 1, 1/2], [1, 1/2, 1/2] and [1, 1].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, r) option remember; `if`(r=0, 1,
          add(`if`(r*j<1, 0, b(n, r-1/j)), j=1..n))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..10);  # Alois P. Heinz, Dec 12 2024
  • Python
    from functools import lru_cache
    from fractions import Fraction
    def A378842(n):
        @lru_cache(maxsize=None)
        def f(r): return 1 if r==0 else sum(f(r-Fraction(1,j)) for j in range(int(Fraction(1,r))+(r.numerator!=1),n+1))
        return f(n) # Chai Wah Wu, Dec 14 2024

Extensions

More terms from Alois P. Heinz, Dec 12 2024