login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A099165 Palindromic in bases 10 and 32. 35
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 66, 99, 363, 858, 1441, 2882, 5445, 6886, 9449, 15951, 19891, 21012, 29692, 32223, 54945, 369963, 477774, 564465, 585585, 609906, 672276, 717717, 780087, 804408, 912219, 1251521, 2639362, 3825283 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
Ray Chandler and Robert G. Wilson v, Table of n, a(n) for n = 1..115, terms a(88)-a(111) from Ray Chandler.
MATHEMATICA
NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[ Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[ IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer] := Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l = {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 32], AppendTo[l, a]], {n, 10000}]; l
Select[Range[0, 10^5],
PalindromeQ[#] && # == IntegerReverse[#, 32] &] (* Robert Price, Nov 09 2019 *)
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 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])
A099165_list = sorted([n for n in palQgen10(6) if palQ(n, 32)])
# Chai Wah Wu, Nov 25 2014
CROSSREFS
Sequence in context: A370052 A082208 A201061 * A239480 A117055 A117056
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Sep 30 2004
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 08:22 EDT 2024. Contains 371236 sequences. (Running on oeis4.)