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

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A029804 Numbers that are palindromic in bases 8 and 10. 38
0, 1, 2, 3, 4, 5, 6, 7, 9, 121, 292, 333, 373, 414, 585, 3663, 8778, 13131, 13331, 26462, 26662, 30103, 30303, 207702, 628826, 660066, 1496941, 1935391, 1970791, 4198914, 55366355, 130535031, 532898235, 719848917, 799535997, 1820330281 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Intersection of A002113 and A029803. - Michel Marcus, Nov 20 2014

LINKS

Robert G. Wilson v, Table of n, a(n) for n = 1..75

Patrick De Geest, Palindromic numbers beyond base 10

Rick Regan, Code to generate this sequence

MATHEMATICA

b1=8; b2=10; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 100000}]; lst (* Vincenzo Librandi, Nov 13 2014 *)

Select[Range[0, 1820331000], PalindromeQ[#]&&IntegerDigits[#, 8] == Reverse[ IntegerDigits[#, 8]]&] (* Harvey P. Dale, Mar 18 2019 *)

PROG

(PARI) isok(n) = (n==0) || ((d10=digits(n, 10)) && (d10==Vecrev(d10)) && (d8=digits(n, 8)) && (d8==Vecrev(d8))); \\ Michel Marcus, Nov 13 2014

(PARI) ispal(n, r) = my(d=digits(n, r)); d==Vecrev(d);

for(n=0, 10^7, if(ispal(n, 10)&&ispal(n, 8), print1(n, ", "))); \\ Joerg Arndt, Nov 22 2014

(MAGMA) [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 8) eq Reverse(Intseq(n, 8))]; // Vincenzo Librandi, Nov 23 2014

(Python)

def palQ8(n): # check if n is a palindrome in base 8

    s = oct(n)[2:]

    return s == s[::-1]

def palQgen10(l): # unordered generator of palindromes of length <= 2*l

    if l > 0:

        yield 0

        for x in range(1, 10**l):

            s = str(x)

            yield int(s+s[-2::-1])

            yield int(s+s[::-1])

A029804_list = sorted([n for n in palQgen10(6) if palQ8(n)])

# Chai Wah Wu, Nov 25 2014

CROSSREFS

Cf. A007632, A007633, A029961, A029962, A029963, A029964, A029965, A029966, A029967, A029968, A029969, A029970, A029731, A097855, A099165.

Sequence in context: A048333 A007496 A082274 * A084690 A194963 A072794

Adjacent sequences:  A029801 A029802 A029803 * A029805 A029806 A029807

KEYWORD

nonn,base

AUTHOR

Patrick De Geest

EXTENSIONS

More terms from Robert G. Wilson v, Sep 30 2004

Incorrect Mathematica program deleted by N. J. A. Sloane, Sep 01 2009

Terms 33 through 36 corrected by Rick Regan (exploringbinary(AT)gmail.com), Sep 01 2009

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 November 24 01:49 EST 2020. Contains 338603 sequences. (Running on oeis4.)