login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A212658
Number of multisets {1^k1, 2^k2, ..., n^kn}, ki >= 0, with the sum of reciprocals <= 1.
2
1, 2, 4, 8, 17, 37, 86, 199, 475, 1138, 2769, 6748, 16613, 40904, 101317, 251401, 624958, 1555940, 3882708, 9701790, 24276866, 60817940, 152508653, 382828565, 961859364, 2418662434, 6086480305, 15327208770, 38622901484, 97384378728, 245686368946, 620158662562
OFFSET
0,2
COMMENTS
The number of distinct sums of reciprocals is given by A212606.
LINKS
PROG
(C#)
/* For n=43 or greater, the least common multiple of the numbers 1..n requires more than 64 bits to represent, and C# has no such native data type. */
using System;
using System.Collections.Generic;
namespace A212658 {
class Program {
static long Result;
static long GCD(long n, long m) {
long mod;
long j = n<m ? m : n;
long k = n<m ? n : m;
while (true) if ((mod = k%j) == 0)
return j; else { k=j; j=mod; }
}
static long LCM(int n) { // This produces A003418
return n<=1 ? 1 : LCM(n-1) / GCD(LCM(n-1), n) * n;
}
static void Main(string[] args) {
List<long> numbers = new List<long>();
for (int n=1; n<=42; n++) {
long lcm= LCM(n);
numbers.Clear();
Result = 0;
for (int i=2; i<=n; i++) numbers.Add(lcm/i);
Count(lcm, numbers, 0);
Console.Write(n.ToString() + ": " + (Result+2).ToString() + "\n");
}
}
static void Count(long Target, List<long> L, int At) {
if (At >= L.Count) return;
if (L[At] <= Target) {
Result++;
long AmtLeft = Target - L[At];
if (AmtLeft >= L[L.Count-1]) Count(AmtLeft, L, At);
}
Count(Target, L, At+1);
return;
}
}
}
/* Dexter Senft, Feb 07 2019 */
KEYWORD
nonn
AUTHOR
Max Alekseyev, May 23 2012
EXTENSIONS
a(24)-a(25) from Alois P. Heinz, Nov 20 2017
a(26)-a(31) from Dexter Senft, Feb 07 2019
STATUS
approved