Skip to main content
1 of 4
DavidC
  • 25.4k
  • 2
  • 52
  • 105

#Mathematica 77

Line 1 input gets a decimal number and a base (b) from standard input. Line 2 checks whether the number in base b is a palindrome.

{n, b} = ToExpression /@ StringSplit@InputString[];
(x = n~IntegerDigits~b) == Reverse@x
DavidC
  • 25.4k
  • 2
  • 52
  • 105