cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A299766 Greatest odd noncomposite divisor of n.

This page as a plain text file.
%I A299766 #23 May 17 2024 19:42:22
%S A299766 1,1,3,1,5,3,7,1,3,5,11,3,13,7,5,1,17,3,19,5,7,11,23,3,5,13,3,7,29,5,
%T A299766 31,1,11,17,7,3,37,19,13,5,41,7,43,11,5,23,47,3,7,5,17,13,53,3,11,7,
%U A299766 19,29,59,5,61,31,7,1,13,11,67,17,23,7,71,3,73,37,5,19,11,13,79,5,3,41,83,7,17,43
%N A299766 Greatest odd noncomposite divisor of n.
%C A299766 The sequence can be constructed replacing the 2's with 1's in A006530.
%F A299766 a(n) = A006530(A000265(n)). - _Michel Marcus_, Mar 15 2018
%F A299766 a(n) = 1 for n in A000079 (powers of 2). - _Michel Marcus_, Apr 14 2018
%p A299766 A299766 := proc(n)
%p A299766     local dvs ;
%p A299766     dvs := sort(convert(numtheory[factorset](n) minus {2},list)) ;
%p A299766     if nops(dvs) >= 1 then
%p A299766         op(-1,dvs) ;
%p A299766     else
%p A299766         1;
%p A299766     end if;
%p A299766 end proc: # _R. J. Mathar_, May 05 2018
%t A299766 Array[FactorInteger[#][[-1, 1]] /. 2 -> 1 &, 86] (* _Michael De Vlieger_, Mar 16 2018 *)
%t A299766 Table[Max[Select[Divisors[n],OddQ[#]&&!CompositeQ[#]&]],{n,100}] (* _Harvey P. Dale_, May 17 2024 *)
%o A299766 (PARI) a(n) = my(m = n >> valuation(n, 2)); if (m==1, 1, vecmax(factor(m)[,1])); \\ _Michel Marcus_, Mar 15 2018
%o A299766 (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
%Y A299766 Cf. A000265 (odd part), A008578 (noncomposite numbers), A006005 (odd noncomposite numbers), A006530 (greatest noncomposite divisor).
%K A299766 nonn,easy
%O A299766 1,3
%A A299766 _Omar E. Pol_, Mar 12 2018