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.

A349146 Number of ordered n-tuples (x_1, x_2, x_3, ..., x_n) such that Sum_{k=1..n} 1/x_k is an integer and x_k is an integer between 1 and n for 1 <= k <= n.

This page as a plain text file.
%I A349146 #34 Jul 15 2023 14:02:10
%S A349146 1,1,2,5,25,82,1310,6757,73204,612534,12021898,100648935,3293923530,
%T A349146 30781757528,543076024093,22444907405573,490532466616585,
%U A349146 6321096033756031,293288707966712654,4209069624596495601,231798923882314673793,15160706809349856453181,265850457583646602080422,4542630089978045405518910
%N A349146 Number of ordered n-tuples (x_1, x_2, x_3, ..., x_n) such that Sum_{k=1..n} 1/x_k is an integer and x_k is an integer between 1 and n for 1 <= k <= n.
%e A349146 1/1 + 1/1 = 2 and 2 is an integer.
%e A349146 1/1 + 1/2 = 3/2.
%e A349146 1/2 + 1/1 = 3/2.
%e A349146 1/2 + 1/2 = 1 and 1 is an integer.
%e A349146 So a(2) = 2.
%o A349146 (Ruby)
%o A349146 def A(n)
%o A349146   return 1 if n == 0
%o A349146   cnt = 0
%o A349146   (1..n).to_a.repeated_permutation(n){|i|
%o A349146     cnt += 1 if (1..n).inject(0){|s, j| s + 1 / i[j - 1].to_r}.denominator == 1
%o A349146   }
%o A349146   cnt
%o A349146 end
%o A349146 def A349146(n)
%o A349146   (0..n).map{|i| A(i)}
%o A349146 end
%o A349146 p A349146(6)
%o A349146 (Python)
%o A349146 from math import lcm, factorial, prod
%o A349146 from collections import Counter
%o A349146 from itertools import combinations_with_replacement
%o A349146 def multiset_count(x): return factorial(len(x))//prod(factorial(d) for d in Counter(x).values())
%o A349146 def A349146(n):
%o A349146     k = lcm(*range(2,n+1))
%o A349146     dlist = tuple(k//d for d in range(1,n+1))
%o A349146     return sum(multiset_count(d) for d in combinations_with_replacement(range(1,n+1),n) if sum(dlist[e-1] for e in d) % k == 0) # _Chai Wah Wu_, Nov 09 2021
%Y A349146 Cf. A349145, A349148.
%K A349146 nonn
%O A349146 0,3
%A A349146 _Seiichi Manyama_, Nov 08 2021
%E A349146 a(10)-a(23) from _Alois P. Heinz_, Nov 08 2021