OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000
Z. Nedev, A Reduced Computational Complexity Strategy for the Magnus-Derek Game, International Mathematical Forum, Vol. 9, 2014, no. 7, pp. 325 - 333. See p. 326.
Z. Nedev and S. Muthukrishnan, The Nagger-Mover Game, DIMACS Tech. Report 2005-22.
MAPLE
with(numtheory): a:=proc(n) local nn: nn:=factorset(n): if n=1 then 1 elif nn={2} then n elif nn[1]=2 then (nn[2]-1)*n/nn[2] else (nn[1]-1)*n/nn[1] fi end:
MATHEMATICA
Array[If[IntegerQ@ Log2@ #1, #1, #1 (#2 - 1)/#2] & @@ {#, SelectFirst[FactorInteger[#][[All, 1]], # > 2 &]} &, 75] (* Michael De Vlieger, Oct 25 2017 *)
PROG
(PARI) first(n) = {my(res = vector(n, i, i)); forprime(p = 3, n, for(k = 1, n\p, if(res[k*p] == k*p, res[k*p]*=(p-1)/p))); res} \\ David A. Corneth, Oct 25 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
S. Muthukrishnan (muthu(AT)research.att.com), Jun 23 2005
EXTENSIONS
Definition revised by N. J. A. Sloane, Oct 28 2017 at the suggestion of Michel Marcus.
STATUS
approved