cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 36 results. Next

A029965 Palindromic in bases 9 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 191, 282, 373, 464, 555, 646, 656, 6886, 25752, 27472, 42324, 50605, 626626, 1540451, 1713171, 1721271, 1828281, 1877781, 1885881, 2401042, 2434342, 2442442, 2450542, 3106013, 3114113, 3122213, 3163613
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • 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, 9], AppendTo[l, a]], {n, 10000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    pQ[n_,k_]:=Reverse[x=IntegerDigits[n,k]]==x; t={}; Do[If[pQ[n,10] && pQ[n,9],AppendTo[t,n]],{n,3.2*10^6}]; t (* Jayanta Basu, May 25 2013 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 9] &] (* Robert Price, Nov 09 2019 *)

A007632 Numbers that are palindromic in bases 2 and 10.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 33, 99, 313, 585, 717, 7447, 9009, 15351, 32223, 39993, 53235, 53835, 73737, 585585, 1758571, 1934391, 1979791, 3129213, 5071705, 5259525, 5841485, 13500531, 719848917, 910373019, 939474939, 1290880921, 7451111547
Offset: 1

Views

Author

Keywords

Comments

Charlton Harrison found a new record binary-decimal palindrome: 11000101111000010101010110100001110100000100000101110000101101010101000011110100011_2 = 7475703079870789703075747_10 on Dec 01 2001. The binary string contains 83 digits! Since then he has added twenty more terms. - Robert G. Wilson v, Jul 03 2006
Intersection of A002113 and A006995. - Reinhard Zumkeller, Jan 22 2012, Feb 07 2010

References

  • M. R. Calandra, Integers which are palindromic in both decimal and binary notation, J. Rec. Math., 18 (No. 1, 1985-1986), 47.
  • S. Pilpel, Some More Double Palindromic Integers, J. Rec. Math., 18 (1985), 174-176.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

For number of terms less than or equal to 10^n, see A120764.

Programs

  • Haskell
    a007632 n = a007632_list !! (n-1)
    a007632_list = filter ((== 1) . a178225) a002113_list
    -- Reinhard Zumkeller, Jan 22 2012
    
  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 2) eq Reverse(Intseq(n, 2))]; // Vincenzo Librandi, Dec 31 2015
    
  • Maple
    N:= 12: # to get all terms <= 10^N
    ispal2:= proc(n) local L; if n::even then return false fi;
      L:= convert(n,base,2); evalb(L=ListTools:-Reverse(L)) end proc:
    rev10:= proc(n) local L; L:= convert(n,base,10); add(10^i*L[-i-1],i=0..nops(L)-1) end proc:
    pals10:= proc(d) local x,y;
      if d::even then [seq(x*10^(d/2)+rev10(x),x=10^(d/2-1)..10^(d/2)-1)]
      else [seq(seq(x*10^((d+1)/2)+y*10^((d-1)/2)+rev10(x), y=0..9), x=10^((d-1)/2-1)..10^((d-1)/2)-1)]
      fi
    end proc:
    0, 1, 3, 5, 7, 9, seq(op(select(ispal2,pals10(d))),d=2..N); # Robert Israel, Dec 31 2015
  • 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, 2], AppendTo[l, a]], {n, 1000000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    b1=2; b2=10; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 2 10^7}]; lst (* Vincenzo Librandi, Dec 31 2015 *)
    Select[Range[0,10^5], PalindromeQ[#] && # == IntegerReverse[#, 2] &] (* Robert Price, Nov 09 2019 *)
  • PARI
    isok(n) = my(d = digits(n), b=binary(n)); (d == Vecrev(d)) && (b == Vecrev(b)); \\ Michel Marcus, Dec 31 2015
  • Python
    from itertools import chain
    A007632_list = sorted([n for n in chain((int(str(x)+str(x)[::-1]) for x in range(1,10**6)),(int(str(x)+str(x)[-2::-1]) for x in range(10**6))) if bin(n)[2:] == bin(n)[:1:-1]]) # Chai Wah Wu, Nov 23 2014
    

Extensions

One more term from George Russell (ger(AT)tzi.de), Nov 20 2000
Two further terms from Harvey P. Dale, Mar 09 2001
Further terms from George Russell (ger(AT)tzi.de), Nov 02 2001

A029966 Palindromic in bases 10 and 11.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 232, 343, 454, 565, 676, 787, 898, 909, 26962, 38183, 40504, 49294, 52825, 63936, 75157, 2956592, 2968692, 3262623, 3274723, 3286823, 3298923, 3360633, 3372733, 4348434, 4410144, 4422244, 4581854
Offset: 1

Views

Author

Keywords

Comments

The first 79 terms all have an odd number of decimal digits. Is there a term with an even number of decimal digits? - Robert Israel, Nov 23 2014

Crossrefs

Programs

  • Magma
    [n: n in [0..5000000] | Intseq(n) eq Reverse(Intseq(n))and Intseq(n, 11) eq Reverse(Intseq(n, 11))]; // Vincenzo Librandi, Nov 23 2014
  • Maple
    N:= 11: # to get all terms with up to N decimal digits
    qpali:= proc(k, b) local L; L:= convert(k, base, b); if L = ListTools:-Reverse(L) then k else NULL fi end proc:
    digrev:= proc(k,b) local L,n; L:= convert(k,base,b); n:= nops(L); add(L[i]*b^(n-i),i=1..n); end proc:
    Res:= $0..9:
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Res:= Res, seq(qpali(n*10^m + digrev(n,10),11), n=10^(m-1)..10^m-1);
      else
        m:= (d-1)/2;
        Res:= Res, seq(seq(qpali(n*10^(m+1)+y*10^m+digrev(n,10),11), y=0..9), n=10^(m-1)..10^m-1);
      fi
    od:
    Res;  # Robert Israel, Nov 23 2014
  • 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, 12], AppendTo[l, a]], {n, 100000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    b1=10; b2=11; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Nov 23 2014 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 11] &] (* Robert Price, Nov 09 2019 *)

A007633 Palindromic in bases 3 and 10.

Original entry on oeis.org

0, 1, 2, 4, 8, 121, 151, 212, 242, 484, 656, 757, 29092, 48884, 74647, 75457, 76267, 92929, 93739, 848848, 1521251, 2985892, 4022204, 4219124, 4251524, 4287824, 5737375, 7875787, 7949497, 27711772, 83155138, 112969211, 123464321
Offset: 1

Views

Author

Keywords

References

  • J. Meeus, Multibasic palindromes, J. Rec. Math., 18 (No. 3, 1985-1986), 168-173.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    ND:= 12;  # to get all terms with <= ND decimal digits
    rev10:= proc(n) option remember;
      rev10(floor(n/10)) + (n mod 10)*10^ilog10(n)
    end;
    for i from 0 to 9 do rev10(i):= i od:
    rev3:= proc(n) option remember;
      rev3(floor(n/3)) + (n mod 3)*3^ilog[3](n)
    end;
    for i from 0 to 2 do rev3(i):= i od:
    pali3:= n -> rev3(n) = n;
    count:= 1:
    A[1]:= 0:
    for d from 1 to ND do
      d1:= ceil(d/2);
      for x from 10^(d1-1) to 10^d1 - 1 do
        if d::even then y:= x*10^d1+rev10(x)
        else y:= x*10^(d1-1)+rev10(floor(x/10));
        fi;
        if pali3(y) then
           count:= count+1;
           A[count]:= y;
        fi
      od:
    od:
    seq(A[i],i=1..count); # Robert Israel, Apr 20 2014
  • Mathematica
    Do[ a = IntegerDigits[n]; b = IntegerDigits[n, 3]; If[a == Reverse[a] && b == Reverse[b], Print[n] ], {n, 0, 10^9} ]
    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, 4], AppendTo[l, a]], {n, 100000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    pal3Q[n_]:=Module[{idn3=IntegerDigits[n,3]},idn3==Reverse[idn3]]; Select[ Range[ 0,1235*10^5],PalindromeQ[#]&&pal3Q[#]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 04 2019 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 3] &] (* Robert Price, Nov 09 2019 *)
  • Python
    from itertools import chain
    from gmpy2 import digits
    A007633_list = sorted([n for n in chain((int(str(x)+str(x)[::-1]) for x in range(1,10**6)),(int(str(x)+str(x)[-2::-1]) for x in range(10**6))) if digits(n,3) == digits(n,3)[::-1]]) # Chai Wah Wu, Nov 23 2014

A029961 Palindromic in bases 4 and 10.

Original entry on oeis.org

0, 1, 2, 3, 5, 55, 373, 393, 666, 787, 939, 7997, 53235, 55255, 55655, 57675, 506605, 1801081, 2215122, 3826283, 3866683, 5051505, 5226225, 5259525, 5297925, 5614165, 5679765, 53822835, 623010326, 954656459, 51717171715
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • 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, 4], AppendTo[l, a]], {n, 1000000}]; l (* Robert G. Wilson v, Sep 30 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 4] &] (* Robert Price, Nov 09 2019 *)

A029970 Numbers that are palindromic in bases 10 and 15.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 828, 858, 888, 919, 949, 979, 1551, 2772, 23632, 25552, 60106, 67576, 465564, 477774, 489984, 515515, 527725, 17577571, 26144162, 28300382, 39399393, 47999974, 69455496, 2118008112, 8050880508
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 15) eq Reverse(Intseq(n, 15))]; // Vincenzo Librandi, Nov 23 2014
  • 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, 15], AppendTo[l, a]], {n, 200000}]; l (* Robert G. Wilson v, Sep 03 2004 *)
    b1=10; b2=15; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Nov 23 2014 *)
    Select[Range[0, 10^5], PalindromeQ[#] && # == IntegerReverse[#, 15] &] (* Robert Price, Nov 09 2019 *)

A029967 Palindromic in bases 12 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 181, 555, 616, 676, 737, 797, 1111, 8008, 35953, 43934, 88888, 646646, 3192913, 5641465, 8364638, 9963699, 133373331, 139979931, 293373392, 520020025, 713171317, 796212697, 1393223931
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 10^5], PalindromeQ[#] && # == IntegerReverse[#, 12] &] (* Robert Price, Nov 09 2019 *)
  • 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): # generator of palindromes in base 10 of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,l+1):
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[-2::-1])
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[::-1])
    A029967_list = [n for n in palQgen10(5) if palQ(n,12)] # Chai Wah Wu, Dec 01 2014

A029968 Palindromic in bases 13 and 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 222, 313, 353, 444, 575, 666, 797, 1111, 6776, 8778, 24542, 25452, 26362, 56265, 311113, 2377732, 2713172, 2832382, 2906092, 8864688, 10122101, 13055031, 20244202, 20944902, 23177132, 23877832
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • 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, 13], AppendTo[l, a]], {n, 100000}]; l (* Robert G. Wilson v, Sep 03 2004 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 13] &] (* Robert Price, Nov 09 2019 *)
  • 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): # generator of palindromes in base 10 of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,l+1):
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[-2::-1])
                for y in range(10**(x-1),10**x):
                    s = str(y)
                    yield int(s+s[::-1])
    A029968_list = [n for n in palQgen10(9) if palQ(n,13)]
    # Chai Wah Wu, Dec 01 2014

A029969 Numbers that are palindromic in bases 10 and 14.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 323, 464, 717, 858, 999, 1111, 39593, 59095, 420024, 546645, 9046409, 9578759, 9813189, 535505535, 564303465, 595121595, 5736116375, 6758008576, 10476867401, 11652825611, 14203330241
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [n: n in [0..10000000] | Intseq(n, 10) eq Reverse(Intseq(n, 10))and Intseq(n, 14) eq Reverse(Intseq(n, 14))]; // Vincenzo Librandi, Nov 23 2014
  • 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, 14], AppendTo[l, a]], {n, 300000}]; l (* Robert G. Wilson v, Sep 03 2004 *)
    b1=10; b2=14; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 1000000}]; lst (* Vincenzo Librandi, Nov 23 2014 *)
    palQ[n_]:=Module[{idn14=IntegerDigits[n,14]},n==IntegerReverse[n]&&idn14==Reverse[idn14]]; Select[Range[10^7],palQ] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Apr 23 2016 *)
    Select[Range[0, 10^5],
    PalindromeQ[#] && # == IntegerReverse[#, 14] &] (* Robert Price, Nov 09 2019 *)

A029731 Palindromic in bases 10 and 16.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 353, 626, 787, 979, 1991, 3003, 39593, 41514, 90209, 94049, 96369, 98689, 333333, 512215, 666666, 749947, 845548, 1612161, 2485842, 5614165, 6487846, 9616169, 67433476, 90999909, 94355349, 94544549, 119919911
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    N:= 9: # to get all terms with up to N decimal digits
    qpali:= proc(k, b) local L; L:= convert(k, base, b); if L = ListTools:-Reverse(L) then k else NULL fi end proc:
    digrev:= proc(k,b) local L,n; L:= convert(k,base,b); n:= nops(L); add(L[i]*b^(n-i),i=1..n); end proc:
    Res:= $0..9:
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Res:= Res, seq(qpali(n*10^m + digrev(n,10),16), n=10^(m-1)..10^m-1);
      else
        m:= (d-1)/2;
        Res:= Res, seq(seq(qpali(n*10^(m+1)+y*10^m+digrev(n,10),16), y=0..9), n=10^(m-1)..10^m-1);
      fi
    od:
    Res; # Robert Israel, Nov 23 2014
  • Mathematica
    A029731Q = PalindromeQ@# && IntegerReverse[#, 16] == # &; Select[Range[10^5], A029731Q] (* JungHwan Min, Mar 02 2017 *)
    Select[Range[10^7], Times @@ Boole@ Map[# == Reverse@ # &, {IntegerDigits@ #, IntegerDigits[#, 16]}] > 0 &] (* Michael De Vlieger, Mar 03 2017 *)
  • Python
    def palQ16(n): # check if n is a palindrome in base 16
        s = hex(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])
    A029731_list = sorted([n for n in palQgen10(6) if palQ16(n)])
    # Chai Wah Wu, Nov 25 2014
Showing 1-10 of 36 results. Next