OFFSET
1,1
COMMENTS
This sequence is the subsequence of superior highly composite numbers (A002201) where a new prime factor is introduced for the first time. Because superior highly composite numbers are primorial-regular and their prime factors are added strictly in increasing order, a(n) is the first superior highly composite number to be divisible by the n-th prime.
LINKS
James McKay, Table of n, a(n) for n = 1..343
Wikipedia, Superior highly composite number.
EXAMPLE
a(1) = 2 because it is the first superior highly composite number with 1 distinct prime factor (2).
a(2) = 6 because it is the first superior highly composite number with 2 distinct prime factors (2 and 3).
a(3) = 60 because the preceding superior highly composite numbers (2, 6, 12) have at most 2 distinct prime factors, making 60 (2^2 * 3 * 5) the first to have 3 distinct prime factors.
MAPLE
# Assuming shcnList is a pre-defined list of Superior Highly Composite Numbers
with(NumberTheory):
result := [];
seen := 0;
for x in shcnList do
d := NumberOfPrimeFactors(x, 'distinct');
if d > seen then
result := [op(result), x];
seen := d;
fi;
od:
print(result);
MATHEMATICA
(* Selects the first SHCN for each unique count of distinct prime factors *)
shcnList = Import["https://oeis.org/A002201/b002201.txt", "Data"][[All, -1]]; DeleteDuplicatesBy[shcnList, PrimeNu]
PROG
(Python)
import urllib.request
def get_prime_factors(n):
"""Efficiently finds unique prime factors of n."""
factors = set()
if n % 2 == 0:
factors.add(2)
while n % 2 == 0:
n //= 2
d = 3
while d * d <= n:
if n % d == 0:
factors.add(d)
while n % d == 0:
n //= d
d += 2
if n > 1:
factors.add(n)
return factors
def main():
url = "https://oeis.org/A002201/b002201.txt"
output_filename = "b395742.txt"
print(f"Fetching data from {url}...")
try:
req = urllib.request.Request(
url,
headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'}
)
with urllib.request.urlopen(req) as response:
lines = response.read().decode('utf-8').splitlines()
except Exception as e:
print(f"Error fetching the file: {e}")
return
seen_primes = set()
output_index = 1 # Sequential numbering starting at 1
print(f"Writing strict OEIS-compliant b-file to {output_filename}...")
# 'newline="\n"' forces Unix LF endings. 'encoding="utf-8"' writes without BOM.
with open(output_filename, 'w', encoding='utf-8', newline='\n') as f:
for line in lines:
line = line.strip()
if not line or line.startswith('#'):
continue
parts = line.split()
if len(parts) != 2:
continue
value = int(parts[1])
factors = get_prime_factors(value)
new_primes = factors - seen_primes
if new_primes:
# Format: "index value\n" (Strictly no trailing spaces or comments)
f.write(f"{output_index} {value}\n")
seen_primes.update(new_primes)
output_index += 1
print(f"Done! '{output_filename}' has been created with {output_index - 1} terms.")
if __name__ == "__main__":
main()
CROSSREFS
KEYWORD
nonn
AUTHOR
James McKay, Jun 08 2026
STATUS
approved
