OFFSET
1,2
COMMENTS
Squares k such that the squarefree kernel of k is primorial.
1 is the only primorial term.
From Michael De Vlieger, Jun 09 2024: (Start)
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A055932(n)^2.
EXAMPLE
MATHEMATICA
{1}~Join~Select[Range[2, 512, 2], Or[# == {2}, Union@ Differences@ PrimePi[#] == {1}] &@ FactorInteger[#][[All, 1]] &]^2 (* Michael De Vlieger, Jun 09 2024 *)
PROG
(Python)
from functools import lru_cache
from itertools import count
from math import isqrt
from sympy import prime, integer_log
from oeis_sequences.OEISsequences import bisection
def A373559(n):
@lru_cache(maxsize=None)
def g(x, m): return sum(g(x//(prime(m)**i), m-1) for i in range(1, integer_log(x, prime(m))[0]+1)) if m-1 else x.bit_length()-1
def f(x):
c, p, y = n-1+x, 1, isqrt(x)
for k in count(1):
p *= prime(k)
if p>y:
break
c -= g(y, k)
return c
return bisection(f, n, n) # Chai Wah Wu, Apr 02 2026
(Python)
from itertools import islice
from heapq import heappop, heappush
from sympy import nextprime
def A373559_gen(): # generator of terms if the first n terms are desired.
h, hset = [(1, (1, ))], {1}
while True:
m, ps = heappop(h)
yield m
for p in ps:
mp = m*p**2
if mp not in hset:
heappush(h, (mp, ps))
hset.add(mp)
q = nextprime(max(ps, default=1))
mp = m*q**2
if mp not in hset:
heappush(h, (mp, (ps+(q, ))))
hset.add(mp)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David James Sycamore, Jun 09 2024
EXTENSIONS
More terms from David A. Corneth, Jun 09 2024
STATUS
approved
