

A253594


Numbers n that have more than one palindromic representation in bases 2 <= b <= n2.


2



10, 15, 16, 17, 18, 20, 21, 24, 26, 27, 28, 30, 31, 32, 33, 34, 36, 38, 40, 42, 44, 45, 46, 48, 50, 51, 52, 54, 55, 56, 57, 60, 62, 63, 64, 65, 66, 67, 68, 70, 72, 73, 74, 75, 76, 78, 80, 81, 82, 84, 85, 86, 88, 90, 91, 92, 93, 96, 98, 99, 100, 102, 104, 105, 107, 108, 109, 110, 111, 112, 114, 116, 117, 118, 119, 120, 121, 122, 123, 124
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

We do not include base n1, because every n>2 is written '11' in base n1.


LINKS



EXAMPLE

10 is written '101' in base 3, and '22' in base 4.
12 is written '22' in base 5, but is not a palindrome in any other base up to 10, so does not belong to this sequence.


PROG

(Python)
from itertools import count
.
def base(n, b):
...while n:
......m = n%b
......yield m
......n = (nm)//b
.
def is_palindrome(seq):
...seq = list(seq)
...l = len(seq)//2
...return seq[:l] == seq[1:l1:1]
.
def a():
...for n in count(2):
......base_representations = [(b, list(base(n, b))) for b in range(2, n1)]
......pals = [(b, s) for b, s in base_representations if is_palindrome(s)]
......if len(pals)>1:
.........yield n
(Python)
from sympy.ntheory import digits
def ok(n):
c = 0
for b in range(2, n1):
d = digits(n, b)[1:]
c += int(d == d[::1])
if c == 2: return True
return c > 1


CROSSREFS



KEYWORD

nonn,base,easy


AUTHOR



STATUS

approved



