OFFSET
1,3
COMMENTS
The sequence can be constructed replacing the 2's with 1's in A006530.
FORMULA
a(n) = 1 for n in A000079 (powers of 2). - Michel Marcus, Apr 14 2018
MAPLE
A299766 := proc(n)
local dvs ;
dvs := sort(convert(numtheory[factorset](n) minus {2}, list)) ;
if nops(dvs) >= 1 then
op(-1, dvs) ;
else
1;
end if;
end proc: # R. J. Mathar, May 05 2018
MATHEMATICA
Array[FactorInteger[#][[-1, 1]] /. 2 -> 1 &, 86] (* Michael De Vlieger, Mar 16 2018 *)
Table[Max[Select[Divisors[n], OddQ[#]&&!CompositeQ[#]&]], {n, 100}] (* Harvey P. Dale, May 17 2024 *)
PROG
(PARI) a(n) = my(m = n >> valuation(n, 2)); if (m==1, 1, vecmax(factor(m)[, 1])); \\ Michel Marcus, Mar 15 2018
(Magma) [#f eq 1 select 1 else f[#f][1] where f is Factorization(2*n): n in [1..90]]; // Vincenzo Librandi, Mar 20 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Mar 12 2018
STATUS
approved