Your task is to write as short as possible program preferably in Brainf**k which determines the last digit of given number after it's conversion from decimal to binary system.


An integer in decimal system consisting of up to 200 digits. There is a newline character (ASCII 10) after the given number


One digit (1 or 0) which is the last digit of given number after it's conversion to binary system.


4372667135165131576213 -> 1

  • 1
    \$\begingroup\$ Are you looking for codegolf.stackexchange.com/a/113513/17602 ? \$\endgroup\$
    – Neil
    Mar 27, 2019 at 21:14
  • \$\begingroup\$ Output has to be last digit of given number after its conversion to binary \$\endgroup\$
    – jean
    Mar 27, 2019 at 21:18
  • \$\begingroup\$ ...Which is the parity of the number (i.e. whether it is odd or even) \$\endgroup\$
    – Jo King
    Mar 27, 2019 at 22:36
  • \$\begingroup\$ A bf answer from the parity question is here. It should work for decimal-encoded strings too, since the last bit will be 1 iff the number is odd. \$\endgroup\$ Mar 27, 2019 at 22:55
  • 1
    \$\begingroup\$ Since you wanted a brainfuck answer on your last question I'd suspect that these are homework questions... except that this is brainfuck lol \$\endgroup\$
    – Jo King
    Mar 28, 2019 at 0:52

1 Answer 1


Wolfram Language (Mathematica), 13 bytes


Try it online!


Not the answer you're looking for? Browse other questions tagged or ask your own question.