OFFSET
1,3
COMMENTS
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
KEYWORD
nonn,base
AUTHOR
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