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.

A339512 Number of subsets of {1..n} whose elements have the same number of distinct prime factors.

This page as a plain text file.
%I A339512 #23 Feb 16 2025 08:34:01
%S A339512 1,2,3,5,9,17,18,34,66,130,132,260,264,520,528,544,1056,2080,2112,
%T A339512 4160,4224,4352,4608,8704,9216,17408,18432,34816,36864,69632,69633,
%U A339512 135169,266241,270337,278529,294913,327681,589825,655361,786433,1048577,1572865,1572867
%N A339512 Number of subsets of {1..n} whose elements have the same number of distinct prime factors.
%H A339512 Sebastian Karlsson, <a href="/A339512/b339512.txt">Table of n, a(n) for n = 0..1000</a>
%H A339512 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DistinctPrimeFactors.html">Distinct Prime Factors</a>
%F A339512 a(n) = 1 + Sum_{k=1..n} 2^A334655(k). - _Sebastian Karlsson_, Feb 18 2021
%e A339512 a(5) = 17 subsets: {}, {1}, {2}, {3}, {4}, {5}, {2, 3}, {2, 4}, {2, 5}, {3, 4}, {3, 5}, {4, 5}, {2, 3, 4}, {2, 3, 5}, {2, 4, 5}, {3, 4, 5} and {2, 3, 4, 5}.
%o A339512 (Python)
%o A339512 from sympy import primefactors
%o A339512 def test(n):
%o A339512     if n==0: return -1
%o A339512     return len(primefactors(n))
%o A339512 def a(n):
%o A339512     tests = [test(i) for i in range(n+1)]
%o A339512     return sum(2**tests.count(v)-1 for v in set(tests))
%o A339512 print([a(n) for n in range(43)]) # _Michael S. Branicky_, Dec 07 2020
%Y A339512 Cf. A001221, A339511, A339514.
%K A339512 nonn
%O A339512 0,2
%A A339512 _Ilya Gutkovskiy_, Dec 07 2020
%E A339512 a(23)-a(42) from _Michael S. Branicky_, Dec 07 2020