OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
A096015(n) = a(n)/2.
If n (mod 6) = 2, 3 or 4, then a(n) = 6. If n (mod 6) = 0, 1 or 5, then a(n) belongs to A001747 less the first three terms or belongs to A073582 less the first two terms. - Robert G. Wilson v, Jun 15 2004
From Bill McEachen, Jul 26 2024_: (Start)
a(n) <= 2*n, except when n = 2.
a(n) = 2*n for n an odd prime. (End)
MAPLE
f:= proc(n) local p;
p:= 3;
if n::even then
while type(n/p, integer) do p:= nextprime(p) od;
else
while not type(n/p, integer) do p:= nextprime(p) od:
fi;
2*p;
end proc:
f(1):= 2:
map(f, [$1..100]); # Robert Israel, Jun 22 2018
MATHEMATICA
PrimeFactors[n_] := Flatten[ Table[ #[[1]], {1} ] & /@ FactorInteger[n]]; f[1] = 2; f[n_] := Block[ {k = 1}, While[ Mod[ n, Prime[k]] == 0, k++ ]; Prime[k]PrimeFactors[n][[1]]]; Table[ f[n], {n, 83}] (* Robert G. Wilson v, Jun 15 2004 *)
spfn[n_]:=Module[{fi=FactorInteger[n][[;; , 1]], k=2}, While[MemberQ[fi, k], k=NextPrime[k]]; fi[[1]]*k]; Array[spfn, 90] (* Harvey P. Dale, Sep 22 2024 *)
PROG
(PARI) dnd(n) = forprime(p=2, , if (n % p, return(p)));
lpf(n) = if (n==1, 1, forprime(p=2, , if (!(n % p), return(p))));
a(n) = dnd(n)*lpf(n); \\ Michel Marcus, Jun 22 2018
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, Jun 15 2004
STATUS
approved