Skip to main content
added 49 characters in body
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 66 5 bytes

Saved a byte thanks to Adnan.

ÒD2Q+PÒDÈ+P 

Try it online!Try it online!

Explanation

Ò # push list of prime factors of input D # duplicate 2QÈ  # comparecheck each factor tofor 2evenness (1 if true, else 0)   +  # add list of factors and list of comparison results   P  # product 

05AB1E, 6 bytes

ÒD2Q+P 

Try it online!

Explanation

Ò # push list of prime factors of input D # duplicate 2Q # compare each factor to 2 (1 if true, else 0)   + # add list of factors and list of comparison results   P # product 

05AB1E, 6 5 bytes

Saved a byte thanks to Adnan.

ÒDÈ+P 

Try it online!

Explanation

Ò # push list of prime factors of input D # duplicate È  # check each factor for evenness (1 if true, else 0) +  # add list of factors and list of comparison results P  # product 
Source Link
Emigna
  • 53.2k
  • 5
  • 44
  • 164

05AB1E, 6 bytes

ÒD2Q+P 

Try it online!

Explanation

Ò # push list of prime factors of input D # duplicate 2Q # compare each factor to 2 (1 if true, else 0) + # add list of factors and list of comparison results P # product