login
Smallest divisor of 2n that is > 2, or 0 if no such divisor exists.
8

%I #17 Sep 24 2017 11:59:26

%S 0,4,3,4,5,3,7,4,3,4,11,3,13,4,3,4,17,3,19,4,3,4,23,3,5,4,3,4,29,3,31,

%T 4,3,4,5,3,37,4,3,4,41,3,43,4,3,4,47,3,7,4,3,4,53,3,5,4,3,4,59,3,61,4,

%U 3,4,5,3,67,4,3,4,71,3,73,4,3,4,7,3,79,4,3,4,83,3,5,4,3,4,89,3,7,4,3,4,5

%N Smallest divisor of 2n that is > 2, or 0 if no such divisor exists.

%H Remi Eismann, <a href="/A090369/b090369.txt">Table of n, a(n) for n = 1..10000</a>

%p A090369 := proc(n) local lf,i ; lf := numtheory[divisors](2*n) ; for i from 1 to nops(lf) do if op(i,lf) > 2 then RETURN( op(i,lf) ) ; fi ; od ; RETURN(0) ; end : for n from 0 to 100 do printf("%d,",A090369(n)) ; od ; # _R. J. Mathar_, Jun 02 2006

%t Join[{0},Table[SelectFirst[Divisors[2n],#>2&],{n,2,120}]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Sep 24 2017 *)

%Y Cf. A090368, A020639, A117078, A117563, A118534.

%K nonn,easy

%O 1,2

%A _Lekraj Beedassy_, Nov 27 2003

%E More terms from _Ray Chandler_, Dec 02 2003

%E Edited by _N. J. A. Sloane_ at the suggestion of _RĂ©mi Eismann_, Sep 15 2007