OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
MATHEMATICA
Array[If[CompositeQ@ #, Divisors[#][[-2]], 2 # - 1] &, 87] (* Michael De Vlieger, Jan 03 2019 *)
PROG
(PARI) A322982(n) = if((1==n)||isprime(n), n+n-1, n/vecmin(factor(n)[, 1]));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 03 2019
STATUS
approved