OFFSET
1,3
LINKS
Ray Chandler, Table of n, a(n) for n = 1..80 (terms < 10^18)
Attila Bérczes and Volker Ziegler, On Simultaneous Palindromes, arXiv:1403.0787 [math.NT], 2014.
EXAMPLE
150 is a term since 150 = 303 base 7 and 150 = 55 base 27.
MATHEMATICA
palQ[n_Integer, base_Integer]:=Block[{idn=IntegerDigits[n, base]}, idn==Reverse[idn]]; Select[Range[10^6]-1, palQ[#, 7]&&palQ[#, 29]&]
PROG
(Python)
from gmpy2 import digits
def palQ(n, b): # check if n is a palindrome in base b
s = digits(n, b)
return s == s[::-1]
def palQgen(l, b): # unordered generator of palindromes in base b of length <= 2*l
if l > 0:
yield 0
for x in range(1, b**l):
s = digits(x, b)
yield int(s+s[-2::-1], b)
yield int(s+s[::-1], b)
A249158_list = sorted([n for n in palQgen(8, 7) if palQ(n, 29)])
# Chai Wah Wu, Nov 25 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ray Chandler, Oct 27 2014
STATUS
approved