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!)
A249156 Palindromic in bases 5 and 7. 20
0, 1, 2, 3, 4, 6, 24, 57, 78, 114, 342, 624, 856, 1432, 10308, 12654, 27616, 100056, 537856, 593836, 769621, 1434168, 1473368, 1636104, 1823544, 1862744, 17968646, 18108296, 22412057, 34713713, 34853363, 39280254, 159690408, 663706192 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Intersection of A029952 and A029954.

LINKS

G. Resta, Table of n, a(n) for n = 1..72 (first 60 terms from Ray Chandler)

Attila Bérczes and Volker Ziegler, On Simultaneous Palindromes, arXiv:1403.0787 [math.NT], 2014.

EXAMPLE

114 is a term since 114 = 424 base 5 and 114 = 222 base 7.

MATHEMATICA

palQ[n_Integer, base_Integer]:=Block[{idn=IntegerDigits[n, base]}, idn==Reverse[idn]]; Select[Range[10^6]-1, palQ[#, 5]&&palQ[#, 7]&]

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)

A249156_list = sorted([n for n in palQgen(8, 5) if palQ(n, 7)]) # Chai Wah Wu, Nov 25 2014

(PARI) isok(n) = my(df = digits(n, 5), ds = digits(n, 7)); (Vecrev(df)==df) && (Vecrev(ds)==ds); \\ Michel Marcus, Oct 31 2017

CROSSREFS

Cf. A007632, A060792, A249155, A249157, A249158.

Sequence in context: A329577 A217442 A065199 * A033179 A067244 A084811

Adjacent sequences:  A249153 A249154 A249155 * A249157 A249158 A249159

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 July 13 07:30 EDT 2020. Contains 335676 sequences. (Running on oeis4.)