16
1
A strictly non-palindromic number N is a number that isn't a palindrome in any base (in bases 2 to N-2). These numbers are listed on OEIS
For example, the number 19
in base 2,3,4,5,6,...17 is: 10011
,201
,103
,34
,31
,...12
. None of these representations is palindromic, so the number is strictly non-palindromic.
For this challenge, you need to return a truthy value if the number is non-palindromic, otherwise a falsy value.
- You may assume the number passed to you is greater than or equal to 0.
- Your program should work for values up to your languages' integer size.
Test cases:
Truthy:
0
1
2
3
4
6
11
19
47
53
79
103
389
997
1459
Falsy:
5
7
8
9
10
13
16
43
48
61
62
101
113
211
1361
This is a code-golf, so make your answers as short as possible!
2
Yes, I missed that. However, answers to this challenge could basically be reused by adding a
– FryAmTheEggman – 2016-08-25T20:54:15.730result < n-2
check to them, I think.