login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249158 Palindromic in bases 7 and 29. 4
0, 1, 2, 3, 4, 5, 6, 8, 16, 24, 150, 300, 5952, 7752, 7955, 9755, 9958, 11904, 13704, 13907, 14110, 15707, 15910, 392850, 751043, 4585544, 12737804, 12828748, 16380296, 19289406, 19380350, 20228253, 33115710, 395849700, 1339182534 (list; graph; refs; listen; history; text; internal format)
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]

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

Cf. A007632, A060792, A249155, A249156, A249157.

Sequence in context: A048318 A037402 A048332 * A119336 A133706 A081710

Adjacent sequences:  A249155 A249156 A249157 * A249159 A249160 A249161

KEYWORD

nonn,base

AUTHOR

Ray Chandler, Oct 27 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 15 01:56 EDT 2020. Contains 336485 sequences. (Running on oeis4.)