OFFSET
1,2
COMMENTS
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
From Peter Luschny and Michael De Vlieger, May 17 2023: (Start)
k is in this sequence <=> k divides lcm(1, 2, ..., k-1). (End)
MAPLE
isa := n -> is(irem(ilcm(seq(1..n-1)), n) = 0):
aList := upto -> select(isa, [seq(1..upto)]):
aList(112); # Peter Luschny, May 17 2023
MATHEMATICA
Select[Range[120], Not@*PrimePowerQ] (* Michael De Vlieger, May 17 2023 *)
PROG
(SageMath)
def A361102List(upto: int) -> list[int]:
return sorted(Set(1..upto).difference(prime_powers(upto)))
print(A361102List(112)) # Peter Luschny, May 17 2023
(Python)
from sympy import primepi, integer_nthroot
def A361102(n):
def f(x): return int(n+sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
return bisection(f) # Chai Wah Wu, Aug 31 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon and N. J. A. Sloane, Mar 02 2023
EXTENSIONS
Offset set to 1 by Peter Luschny, May 17 2023
STATUS
approved