OFFSET
1,1
COMMENTS
An integer m >= 3 appears in the sequence if and only if m is a prime power or twice a prime power.
LINKS
David Radcliffe, Table of n, a(n) for n = 1..10000
Bakir Farhi, On the average asymptotic behavior of a certain type of sequences of integers, Integers 9 (2009), 555-567.
FORMULA
Sum_{n=1..N} a(n) = c*N + O((log N)^2 / (log log N)), where
c = Sum_{m >= 0} (1 + Sum_{m/2 < p^a <= m} (p-1)) / lcm(1,2,...,m) ~ 4.287434141625.
MATHEMATICA
f[n_, q_ : 1] := Module[{c, k}, c = 0; k = 2; While[If[! Divisible[n, k], c++]; c < q, k++]; k]; Table[f[n, 2], {n, 120}] (* Michael De Vlieger, Jun 08 2026 *)
PROG
(Python)
from itertools import count, islice
def A396771(n: int, rank: int = 2) -> int:
assert n > 0 and rank > 0, "Arguments must be positive integers."
return next(islice(filter(lambda x: n % x, count(2)), rank - 1, rank))
(PARI) a(n) = my(nb=0, i=1); while(nb !=2, i++; if (n % i, nb++)); i; \\ Michel Marcus, Jun 08 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Radcliffe, Jun 04 2026
STATUS
approved
