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-9 of 9 results.

A002113 Palindromes in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 404, 414, 424, 434, 444, 454, 464, 474, 484, 494, 505, 515
Offset: 1

Views

Author

Keywords

Comments

n is a palindrome (i.e., a(k) = n for some k) if and only if n = A004086(n). - Reinhard Zumkeller, Mar 10 2002
It seems that if n*reversal(n) is in the sequence then n = 3 or all digits of n are less than 3. - Farideh Firoozbakht, Nov 02 2014
The position of a palindrome within the sequence can be determined almost without calculation: If the palindrome has an even number of digits, prepend a 1 to the front half of the palindrome's digits. If the number of digits is odd, prepend the value of front digit + 1 to the digits from position 2 ... central digit. Examples: 98766789 = a(19876), 515 = a(61), 8206028 = a(9206), 9230329 = a(10230). - Hugo Pfoertner, Aug 14 2015
This sequence is an additive basis of order at most 49, see Banks link. - Charles R Greathouse IV, Aug 23 2015
The order has been reduced from 49 to 3; see the Cilleruelo-Luca and Cilleruelo-Luca-Baxter links. - Jonathan Sondow, Nov 27 2017
See A262038 for the "next palindrome" and A261423 for the "preceding palindrome" functions. - M. F. Hasler, Sep 09 2015
The number of palindromes with d digits is 10 if d = 1, and otherwise it is 9 * 10^(floor((d - 1)/2)). - N. J. A. Sloane, Dec 06 2015
Sequence A033665 tells how many iterations of the Reverse-then-add function A056964 are needed to reach a palindrome; numbers for which this will never happen are Lychrel numbers (A088753) or rather Kin numbers (A023108). - M. F. Hasler, Apr 13 2019
This sequence is an additive basis of order 3, see Cilleruelo, Luca, & Baxter and Sigg. - Charles R Greathouse IV, Apr 08 2025

References

  • Karl G. Kröber, "Palindrome, Perioden und Chaoten: 66 Streifzüge durch die palindromischen Gefilde" (1997, Deutsch-Taschenbücher; Bd. 99) ISBN 3-8171-1522-9.
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 71.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 50-52.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 120.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Subsequence of A061917 and A221221.
A110745 is a subsequence.
Union of A056524 and A056525.
Palindromes in bases 2 through 11: A006995 and A057148, A014190 and A118594, A014192 and A118595, A029952 and A118596, A029953 and A118597, A029954 and A118598, A029803 and A118599, A029955 and A118600, this sequence, A029956. Also A262065 (base 60), A262069 (subsequence).
Palindromic primes: A002385. Palindromic nonprimes: A032350.
Palindromic-pi: A136687.
Cf. A029742 (complement), A086862 (first differences).
Palindromic floor function: A261423, also A261424. Palindromic ceiling: A262038.
Cf. A004086 (read n backwards), A064834, A118031, A136522 (characteristic function), A178788.
Ways to write n as a sum of three palindromes: A261132, A261422.
Minimal number of palindromes that add to n using greedy algorithm: A088601.
Minimal number of palindromes that add to n: A261675.

Programs

  • GAP
    Filtered([0..550],n->ListOfDigits(n)=Reversed(ListOfDigits(n))); # Muniru A Asiru, Mar 08 2019
    
  • Haskell
    a002113 n = a002113_list !! (n-1)
      a002113_list = filter ((== 1) . a136522) [1..] -- Reinhard Zumkeller, Oct 09 2011
    
  • Haskell
    import Data.List.Ordered (union)
      a002113_list = union a056524_list a056525_list -- Reinhard Zumkeller, Jul 29 2015, Dec 28 2011
    
  • Magma
    [n: n in [0..600] | Intseq(n, 10) eq Reverse(Intseq(n, 10))]; // Vincenzo Librandi, Nov 03 2014
    
  • Maple
    read transforms; t0:=[]; for n from 0 to 2000 do if digrev(n) = n then t0:=[op(t0),n]; fi; od: t0;
    # Alternatively, to get all palindromes with <= N digits in the list "Res":
    N:=5;
    Res:= $0..9:
    for d from 2 to N do
      if d::even then
        m:= d/2;
        Res:= Res, seq(n*10^m + digrev(n),n=10^(m-1)..10^m-1);
      else
        m:= (d-1)/2;
        Res:= Res, seq(seq(n*10^(m+1)+y*10^m+digrev(n),y=0..9),n=10^(m-1)..10^m-1);
      fi
    od: Res:=[Res]: # Robert Israel, Aug 10 2014
    # A variant: Gets all base-10 palindromes with exactly d digits, in the list "Res"
    d:=4:
    if d=1 then Res:= [$0..9]:
    elif d::even then
        m:= d/2:
        Res:= [seq(n*10^m + digrev(n), n=10^(m-1)..10^m-1)]:
    else
        m:= (d-1)/2:
        Res:= [seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1)]:
    fi:
    Res; # N. J. A. Sloane, Oct 18 2015
    isA002113 := proc(n)
        simplify(digrev(n) = n) ;
    end proc: # R. J. Mathar, Sep 09 2015
  • Mathematica
    palQ[n_Integer, base_Integer] := Module[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; (* then to generate any base-b sequence for 1 < b < 37, replace the 10 in the following instruction with b: *) Select[Range[0, 1000], palQ[#, 10] &]
    base10Pals = {0}; r = 2; Do[Do[AppendTo[base10Pals, n * 10^(IntegerLength[n] - 1) + FromDigits@Rest@Reverse@IntegerDigits[n]], {n, 10^(e - 1), 10^e - 1}]; Do[AppendTo[base10Pals, n * 10^IntegerLength[n] + FromDigits@Reverse@IntegerDigits[n]], {n, 10^(e - 1), 10^e - 1}], {e, r}]; base10Pals (* Arkadiusz Wesolowski, May 04 2012 *)
    nthPalindromeBase[n_, b_] := Block[{q = n + 1 - b^Floor[Log[b, n + 1 - b^Floor[Log[b, n/b]]]], c = Sum[Floor[Floor[n/((b + 1) b^(k - 1) - 1)]/(Floor[n/((b + 1) b^(k - 1) - 1)] - 1/b)] - Floor[Floor[n/(2 b^k - 1)]/(Floor[n/(2 b^k - 1)] - 1/ b)], {k, Floor[Log[b, n]]}]}, Mod[q, b] (b + 1)^c * b^Floor[Log[b, q]] + Sum[Floor[Mod[q, b^(k + 1)]/b^k] b^(Floor[Log[b, q]] - k) (b^(2 k + c) + 1), {k, Floor[Log[b, q]]}]] (* after the work of Eric A. Schmidt, works for all integer bases b > 2 *)
    Array[nthPalindromeBase[#, 10] &, 61, 0] (* please note that Schmidt uses a different, a more natural and intuitive offset, that of a(1) = 1. - Robert G. Wilson v, Sep 22 2014 and modified Nov 28 2014 *)
    Select[Range[10^3], PalindromeQ] (* Michael De Vlieger, Nov 27 2017 *)
    nLP[cn_Integer]:=Module[{s,len,half,left,pal,fdpal},s=IntegerDigits[cn]; len=Length[s]; half=Ceiling[len/2]; left=Take[s,half]; pal=Join[left,Reverse[ Take[left,Floor[len/2]]]]; fdpal=FromDigits[pal]; Which[cn==9,11,fdpal>cn,fdpal,True,left=IntegerDigits[ FromDigits[left]+1]; pal=Join[left,Reverse[Take[left,Floor[len/2]]]]; FromDigits[pal]]]; NestList[nLP,0,100] (* Harvey P. Dale, Dec 10 2024 *)
  • PARI
    is_A002113(n)=Vecrev(n=digits(n))==n \\ M. F. Hasler, Nov 17 2008, updated Apr 26 2014, Jun 19 2018
    
  • PARI
    is(n)=n=digits(n);for(i=1,#n\2,if(n[i]!=n[#n+1-i],return(0))); 1 \\ Charles R Greathouse IV, Jan 04 2013
    
  • PARI
    a(n)={my(d,i,r);r=vector(#digits(n-10^(#digits(n\11)))+#digits(n\11));n=n-10^(#digits(n\11));d=digits(n);for(i=1,#d,r[i]=d[i];r[#r+1-i]=d[i]);sum(i=1,#r,10^(#r-i)*r[i])} \\ David A. Corneth, Jun 06 2014
    
  • PARI
    \\ recursive--feed an element a(n) and it gives a(n+1)
    nxt(n)=my(d=digits(n));i=(#d+1)\2;while(i&&d[i]==9,d[i]=0;d[#d+1-i]=0;i--);if(i,d[i]++;d[#d+1-i]=d[i],d=vector(#d+1);d[1]=d[#d]=1);sum(i=1,#d,10^(#d-i)*d[i]) \\ David A. Corneth, Jun 06 2014
    
  • PARI
    \\ feed a(n), returns n.
    inv(n)={my(d=digits(n));q=ceil(#d/2);sum(i=1,q,10^(q-i)*d[i])+10^floor(#d/2)} \\ David A. Corneth, Jun 18 2014
    
  • PARI
    inv_A002113(P)={P\(P=10^(logint(P+!P,10)\/2))+P} \\ index n of palindrome P = a(n), much faster than above: no sum is needed. - M. F. Hasler, Sep 09 2018
    
  • PARI
    A002113(n,L=logint(n,10))=(n-=L=10^max(L-(n<11*10^(L-1)),0))*L+fromdigits(Vecrev(digits(if(nM. F. Hasler, Sep 11 2018
    
  • Python
    # edited by M. F. Hasler, Jun 19 2018
    def A002113_list(nMax):
      mlist=[]
      for n in range(nMax+1):
         mstr=str(n)
         if mstr==mstr[::-1]:
            mlist.append(n)
      return mlist # Bill McEachen, Dec 17 2010
    
  • Python
    from itertools import chain
    A002113 = sorted(chain(map(lambda x:int(str(x)+str(x)[::-1]),range(1,10**3)),map(lambda x:int(str(x)+str(x)[-2::-1]), range(10**3)))) # Chai Wah Wu, Aug 09 2014
    
  • Python
    from itertools import chain, count
    A002113 = chain(k for k in count(0) if str(k) == str(k)[::-1])
    print([next(A002113) for k in range(60)]) # Jan P. Hartkopf, Apr 10 2021
    
  • Python
    is_A002113 = lambda n: (s:=str(n))[::-1]==s # M. F. Hasler, May 23 2024
    
  • Python
    from math import log10, floor
    def A002113(n):
      if n < 2: return 0
      P = 10**floor(log10(n//2)); M = 11*P
      s = str(n - (P if n < M else M-P))
      return int(s + s[-2 if n < M else -1::-1]) # M. F. Hasler, Jun 06 2024
    
  • SageMath
    [n for n in (0..515) if Word(n.digits()).is_palindrome()] # Peter Luschny, Sep 13 2018
    
  • Scala
    def palQ(n: Int, b: Int = 10): Boolean = n - Integer.parseInt(n.toString.reverse) == 0
    (0 to 999).filter(palQ()) // _Alonso del Arte, Nov 10 2019

Formula

A136522(a(n)) = 1.
A178788(a(n)) = 0 for n > 9. - Reinhard Zumkeller, Jun 30 2010
A064834(a(n)) = 0. - Reinhard Zumkeller, Sep 18 2013
a(n+1) = A262038(a(n)+1). - M. F. Hasler, Sep 09 2015
Sum_{n>=2} 1/a(n) = A118031. - Amiram Eldar, Oct 17 2020
a(n) = (floor(d(n)/(c(n)*9 + 1)))*10^A055642(d(n)) + A004086(d(n)) where b(n, k) = ceiling(log((n + 1)/k)/log(10)), c(n) = b(n, 2) - b(n, 11) and d(n) = (n - A086573(b(n*(2 - c(n)), 2) - 1)/2 - 1). - Alan Michael Gómez Calderón, Mar 11 2025

A029958 Numbers that are palindromic in base 13.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 28, 42, 56, 70, 84, 98, 112, 126, 140, 154, 168, 170, 183, 196, 209, 222, 235, 248, 261, 274, 287, 300, 313, 326, 340, 353, 366, 379, 392, 405, 418, 431, 444, 457, 470, 483, 496, 510, 523, 536, 549, 562
Offset: 1

Views

Author

Keywords

Comments

Cilleruelo, Luca, & Baxter prove that this sequence is an additive basis of order (exactly) 3. - Charles R Greathouse IV, May 04 2020

Crossrefs

Palindromes in bases 2 through 12: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113, A029956, A029957.

Programs

  • Mathematica
    f[n_,b_]:=Module[{i=IntegerDigits[n,b]},i==Reverse[i]];lst={};Do[If[f[n,13],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
    Select[Range[0,600],IntegerDigits[#,13]==Reverse[IntegerDigits[#,13]]&] (* Harvey P. Dale, Nov 16 2022 *)
  • PARI
    isok(n) = my(d=digits(n, 13)); d == Vecrev(d); \\ Michel Marcus, May 13 2017
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A029958(n):
        if n == 1: return 0
        y = 13*(x:=13**integer_log(n>>1,13)[0])
        return int((c:=n-x)*x+int(digits(c,13)[-2::-1]or'0',13) if nChai Wah Wu, Jun 14 2024

Formula

Sum_{n>=2} 1/a(n) = 3.55686013... (Phunphayap and Pongsriiam, 2019). - Amiram Eldar, Oct 17 2020

A029959 Numbers that are palindromic in base 14.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 197, 211, 225, 239, 253, 267, 281, 295, 309, 323, 337, 351, 365, 379, 394, 408, 422, 436, 450, 464, 478, 492, 506, 520, 534, 548, 562, 576, 591
Offset: 1

Views

Author

Keywords

Comments

Cilleruelo, Luca, & Baxter prove that this sequence is an additive basis of order (exactly) 3. - Charles R Greathouse IV, May 04 2020

Examples

			195 is DD in base 14.
196 is 100 in base 14, so it's not in the sequence.
197 is 101 in base 14.
		

Crossrefs

Palindromes in bases 2 through 13: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113, A029956, A029957, A029958.

Programs

  • Mathematica
    palQ[n_, b_:10] := Module[{idn = IntegerDigits[n, b]}, idn == Reverse[idn]]; Select[ Range[0, 600], palQ[#, 14] &] (* Harvey P. Dale, Aug 03 2014 *)
  • PARI
    isok(n) = Pol(d=digits(n, 14)) == Polrev(d); \\ Michel Marcus, Mar 12 2017
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A029959(n):
        if n == 1: return 0
        y = 14*(x:=14**integer_log(n>>1,14)[0])
        return int((c:=n-x)*x+int(digits(c,14)[-2::-1]or'0',14) if nChai Wah Wu, Jun 14 2024

Formula

Sum_{n>=2} 1/a(n) = 3.6112482... (Phunphayap and Pongsriiam, 2019). - Amiram Eldar, Oct 17 2020

A029960 Numbers that are palindromic in base 15.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 226, 241, 256, 271, 286, 301, 316, 331, 346, 361, 376, 391, 406, 421, 436, 452, 467, 482, 497, 512, 527, 542, 557, 572, 587, 602, 617
Offset: 1

Views

Author

Keywords

Comments

Cilleruelo, Luca, & Baxter prove that this sequence is an additive basis of order (exactly) 3. - Charles R Greathouse IV, May 04 2020

Crossrefs

Programs

  • Mathematica
    f[n_,b_]:=Module[{i=IntegerDigits[n,b]},i==Reverse[i]];lst={};Do[If[f[n,15],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
    Select[Range@ 620, PalindromeQ@ IntegerDigits[#, 15] &] (* Michael De Vlieger, May 13 2017, Version 10.3 *)
  • PARI
    isok(n) = my(d=digits(n, 15)); d == Vecrev(d); \\ Michel Marcus, May 14 2017
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A029960(n):
        if n == 1: return 0
        y = 15*(x:=15**integer_log(n>>1,15)[0])
        return int((c:=n-x)*x+int(digits(c,15)[-2::-1]or'0',15) if nChai Wah Wu, Jun 14 2024

Formula

Sum_{n>=2} 1/a(n) = 3.66254285... (Phunphayap and Pongsriiam, 2019). - Amiram Eldar, Oct 17 2020

A262065 Numbers that are palindromes in base-60 representation.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 122, 183, 244, 305, 366
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 10 2015

Keywords

Examples

			.      n | a(n) |  base 60          n |  a(n) |  base 60
.   -----+------+-----------    ------+-------+--------------
.    100 | 2440 | [40, 40]       1000 | 56415 | [15, 40, 15]
.    101 | 2501 | [41, 41]       1001 | 56475 | [15, 41, 15]
.    102 | 2562 | [42, 42]       1002 | 56535 | [15, 42, 15]
.    103 | 2623 | [43, 43]       1003 | 56595 | [15, 43, 15]
.    104 | 2684 | [44, 44]       1004 | 56655 | [15, 44, 15]
.    105 | 2745 | [45, 45]       1005 | 56715 | [15, 45, 15]
.    106 | 2806 | [46, 46]       1006 | 56775 | [15, 46, 15]
.    107 | 2867 | [47, 47]       1007 | 56835 | [15, 47, 15]
.    108 | 2928 | [48, 48]       1008 | 56895 | [15, 48, 15]
.    109 | 2989 | [49, 49]       1009 | 56955 | [15, 49, 15]
.    110 | 3050 | [50, 50]       1010 | 57015 | [15, 50, 15]
.    111 | 3111 | [51, 51]       1011 | 57075 | [15, 51, 15]
.    112 | 3172 | [52, 52]       1012 | 57135 | [15, 52, 15]
.    113 | 3233 | [53, 53]       1013 | 57195 | [15, 53, 15]
.    114 | 3294 | [54, 54]       1014 | 57255 | [15, 54, 15]
.    115 | 3355 | [55, 55]       1015 | 57315 | [15, 55, 15]
.    116 | 3416 | [56, 56]       1016 | 57375 | [15, 56, 15]
.    117 | 3477 | [57, 57]       1017 | 57435 | [15, 57, 15]
.    118 | 3538 | [58, 58]       1018 | 57495 | [15, 58, 15]
.    119 | 3599 | [59, 59]       1019 | 57555 | [15, 59, 15]
.    120 | 3601 | [1, 0, 1]      1020 | 57616 | [16, 0, 16]
.    121 | 3661 | [1, 1, 1]      1021 | 57676 | [16, 1, 16]
.    122 | 3721 | [1, 2, 1]      1022 | 57736 | [16, 2, 16]
.    123 | 3781 | [1, 3, 1]      1023 | 57796 | [16, 3, 16]
.    124 | 3841 | [1, 4, 1]      1024 | 57856 | [16, 4, 16]
.    125 | 3901 | [1, 5, 1]      1025 | 57916 | [16, 5, 16]  .
		

Crossrefs

Cf. A262079 (first differences).
Intersection with A002113: A262069.
Corresponding sequences for bases 2 through 12: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113, A029956, A029957.

Programs

  • Haskell
    import Data.List.Ordered (union)
    a262065 n = a262065_list !! (n-1)
    a262065_list = union us vs where
       us = [val60 $ bs ++ reverse bs | bs <- bss]
       vs = [0..59] ++ [val60 $ bs ++ cs ++ reverse bs |
              bs <- tail bss, cs <- take 60 bss]
       bss = iterate s [0] where
             s [] = [1]; s (59:ds) = 0 : s ds; s (d:ds) = (d + 1) : ds
       val60 = foldr (\b v -> 60 * v + b) 0
    
  • Magma
    [n: n in [0..600] | Intseq(n, 60) eq Reverse(Intseq(n, 60))]; // Vincenzo Librandi, Aug 24 2016
    
  • Mathematica
    f[n_, b_]:=Module[{i=IntegerDigits[n, b]}, i==Reverse[i]]; lst={}; Do[If[f[n, 60], AppendTo[lst, n]], {n, 400}]; lst (* Vincenzo Librandi, Aug 24 2016 *)
    pal60Q[n_]:=Module[{idn60=IntegerDigits[n,60]},idn60==Reverse[idn60]]; Select[Range[0,400],pal60Q] (* Harvey P. Dale, Nov 04 2017 *)
  • PARI
    isok(m) = my(d=digits(m, 60)); d == Vecrev(d); \\ Michel Marcus, Jan 22 2022
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits, mpz
    def A262065(n):
        if n == 1: return 0
        y = 60*(x:=60**integer_log(n>>1,60)[0])
        return int((c:=n-x)*x+mpz(digits(c,60)[-2::-1]or'0',60) if nChai Wah Wu, Jun 13-14 2024

A249157 Palindromic in bases 11 and 13.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 84, 366, 510, 732, 876, 1020, 1098, 1242, 1464, 10248, 30252, 31110, 62220, 103704, 146541, 3382050, 3698730, 4391268, 225622530, 272466250, 413186676, 713998530, 801837204, 848770222, 912265732
Offset: 1

Views

Author

Ray Chandler, Oct 27 2014

Keywords

Comments

Intersection of A029956 and A029958.

Examples

			366 is a term since 366 = 303 base 11 and 366 = 222 base 13.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_Integer,base_Integer]:=Block[{idn=IntegerDigits[n,base]},idn==Reverse[idn]];Select[Range[10^6]-1,palQ[#,11]&&palQ[#,13]&]
    Select[Range[0,44*10^5],AllTrue[IntegerDigits[#,{11,13}],PalindromeQ]&] (* The program generates the first 30 terms of the sequence. *) (* Harvey P. Dale, May 15 2025 *)
  • 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)
    A249157_list = sorted([n for n in palQgen(6,11) if palQ(n,13)]) # Chai Wah Wu, Nov 25 2014

A297274 Numbers whose base-11 digits have equal down-variation and up-variation; see Comments.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 122, 133, 144, 155, 166, 177, 188, 199, 210, 221, 232, 244, 255, 266, 277, 288, 299, 310, 321, 332, 343, 354, 366, 377, 388, 399, 410, 421, 432, 443, 454, 465, 476, 488, 499, 510, 521
Offset: 1

Views

Author

Clark Kimberling, Jan 16 2018

Keywords

Comments

Suppose that n has base-b digits b(m), b(m-1), ..., b(0). The base-b down-variation of n is the sum DV(n,b) of all d(i)-d(i-1) for which d(i) > d(i-1); the base-b up-variation of n is the sum UV(n,b) of all d(k-1)-d(k) for which d(k) < d(k-1). The total base-b variation of n is the sum TV(n,b) = DV(n,b) + UV(n,b). See the guide at A297330.
Differs after the zero from A029956 first at 1343 = 1011_11, which is not a palindrome in base 11 but has DV(1343,11) = UV(1343,11) =1. - R. J. Mathar, Jan 23 2018

Examples

			521 in base-11:  4,3,4, having DV = 1, UV = 1, so that 521 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];
    x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];
    b = 11; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];
    w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];
    Take[Flatten[Position[w, -1]], 120]   (* A297273 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297274 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297275 *)

A046244 Cubes which are palindromes in base 11.

Original entry on oeis.org

0, 1, 8, 343, 1728, 1815848, 2352637, 2363266368, 3139071497288, 3217539292947, 4083724283904, 4177325982172608, 4291332507800064, 5424315547313664, 5559926728782676328, 5572467905087005957, 7218419297194266624
Offset: 1

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

Note that 7^3 = 1331_6 = 363_10 = 292_11 is a palindromic street !

Crossrefs

Intersection of A029956 and A000578.
Cf. A046243.

Programs

  • Mathematica
    pal11Q[n_]:=Module[{id=IntegerDigits[n,11]},id==Reverse[id]]; Select[ Range[0,2000000]^3,pal11Q] (* Harvey P. Dale, Nov 27 2012 *)

Formula

a(n) = A046243(n)^3. - Andrew Howroyd, Aug 11 2024

Extensions

Offset corrected by Andrew Howroyd, Aug 11 2024

A043270 Sum of the digits of the n-th base 11 palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 10, 11, 12, 13, 14, 15, 16
Offset: 1

Views

Author

Keywords

Crossrefs

A029956 (base 11 palindromes)
Showing 1-9 of 9 results.