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.

Previous Showing 11-20 of 55 results. Next

A331191 Numbers whose dual Zeckendorf representations (A104326) are palindromic.

Original entry on oeis.org

0, 1, 3, 4, 6, 11, 12, 16, 19, 22, 32, 33, 38, 42, 48, 53, 64, 71, 87, 88, 98, 106, 110, 118, 124, 134, 142, 148, 174, 194, 205, 231, 232, 245, 255, 271, 284, 288, 304, 317, 323, 336, 346, 362, 375, 402, 420, 462, 474, 516, 548, 566, 608, 609, 635, 656, 666, 687
Offset: 1

Views

Author

Amiram Eldar, Jan 11 2020

Keywords

Comments

Pairs of numbers of the form {F(2*k-1)-2, F(2*k-1)-1}, for k >= 2, where F(k) is the k-th Fibonacci number, are consecutive terms in this sequence: {0, 1}, {3, 4}, {11, 12}, {32, 33}, ... - Amiram Eldar, Sep 03 2022

Examples

			4 is a term since its dual Zeckendorf representation, 101, is palindromic.
		

Crossrefs

Programs

  • Mathematica
    mirror[dig_, s_] := Join[dig, s, Reverse[dig]];
    select[v_, mid_] := Select[v, Length[#] == 0 || Last[#] != mid &];
    fib[dig_] := Plus @@ (dig * Fibonacci[Range[2, Length[dig] + 1]]);
    pals = Join[{{}}, Rest[Select[IntegerDigits[Range[0, 2^6 - 1], 2], SequenceCount[#, {0, 0}] == 0 &]]];
    Union@Join[{0}, fib /@ Join[mirror[#, {}] & /@ (select[pals, 0]), mirror[#, {0}] & /@ (select[pals, 0]), mirror[#, {1}] & /@ pals]]

A259374 Palindromic numbers in bases 3 and 5 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 26, 52, 1066, 1667, 2188, 32152, 67834, 423176, 437576, 14752936, 26513692, 27711772, 33274388, 320785556, 1065805109, 9012701786, 9256436186, 12814126552, 18814619428, 201241053056, 478999841578, 670919564984, 18432110906024, 158312796835916, 278737550525722
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 14 2015

Keywords

Comments

0 is only 0 regardless of the base,
1 is only 1 regardless of the base,
2 on the other hand is also 10 in base 2, denoted as 10_2,
3 is 3 in all bases greater than 3, but is 11_2 and 10_3.

Examples

			52 is in the sequence because 52_10 = 202_5 = 1221_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 5]; If[ palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=5; 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, Jul 15 2015 *)
  • Python
    def nextpal(n,b): # returns the palindromic successor of n in base b
        m, pl = n+1, 0
        while m > 0:
            m, pl = m//b, pl+1
        if n+1 == b**pl:
            pl = pl+1
        n = (n//(b**(pl//2))+1)//(b**(pl%2))
        m = n
        while n > 0:
            m, n = m*b+n%b, n//b
        return m
    n, a3, a5 = 0, 0, 0
    while n <= 20000:
        if a3 < a5:
            a3 = nextpal(a3,3)
        elif a5 < a3:
            a5 = nextpal(a5,5)
        else: # a3 == a5
            print(n,a3)
            a3, a5, n = nextpal(a3,3), nextpal(a5,5), n+1
    # A.H.M. Smeets, Jun 03 2019

Formula

Intersection of A014190 and A029952.

A259375 Palindromic numbers in bases 3 and 6 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 28, 80, 160, 203, 560, 644, 910, 34216, 34972, 74647, 87763, 122420, 221068, 225064, 6731644, 6877120, 6927700, 7723642, 8128762, 8271430, 77894071, 78526951, 539212009, 28476193256, 200267707484, 200316968444, 201509576804, 201669082004, 231852949304, 232018753064, 232039258376, 333349186006, 2947903946317, 5816975658914, 5817003372578, 11610051837124, 27950430282103, 81041908142188
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 14 2015

Keywords

Comments

Agrees with the number of minimal dominating sets of the halved cube graph Q_n/2 for at least n=1 to 5. - Eric W. Weisstein, Sep 06 2021

Examples

			28 is in the sequence because 28_10 = 44_6 = 1001_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 6]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=6; 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, Jul 15 2015 *)

Formula

Intersection of A014190 and A029953.

A259376 Palindromic numbers in bases 4 and 6 written in base 10.

Original entry on oeis.org

0, 1, 2, 3, 5, 21, 55, 215, 819, 1885, 7373, 7517, 12691, 14539, 69313, 196606, 1856845, 3314083, 5494725, 33348861, 223892055, 231755895, 322509617, 3614009815, 4036503055, 4165108015, 9233901154, 9330794722, 12982275395, 107074105033, 186398221946, 270747359295, 401478741365, 1809863435625, 2281658774290, 11931403417210, 12761538567790, 12887266632430, 15822654274715, 30255762326713, 46164680151002, 323292550693473, 329536806222753
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 15 2015

Keywords

Examples

			55 is in the sequence because 55_10 = 131_6 = 313_4.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 6]; If[palQ[pp, 4], AppendTo[lst, pp]; Print[pp]]; k++]; lst

Formula

Intersection of A014190 and A029953.

A259377 Palindromic numbers in bases 3 and 7 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 8, 16, 40, 100, 121, 142, 164, 242, 328, 400, 1312, 8200, 9103, 14762, 54008, 76024, 108016, 112048, 233920, 532900, 639721, 741586, 2585488, 3316520, 11502842, 24919360, 35664908, 87001616, 184827640, 4346524576, 5642510512, 11641189600, 65304259157, 68095147754, 469837033600, 830172165614, 17136683996456, 21772277941544, 22666883572232, 45221839119556
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 16 2015

Keywords

Examples

			142 is in the sequence because 142_10 = 262_7 = 12021_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 7]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=7; 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, Jul 17 2015 *)

Formula

Intersection of A014190 and A029954.

A259386 Palindromic numbers in bases 3 and 9 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 8, 10, 20, 40, 80, 82, 91, 100, 164, 173, 182, 328, 364, 400, 656, 692, 728, 730, 820, 910, 1460, 1550, 1640, 2920, 3280, 3640, 5840, 6200, 6560, 6562, 6643, 6724, 7300, 7381, 7462, 8038, 8119, 8200, 13124, 13205, 13286, 13862, 13943, 14024, 14600, 14681, 14762, 26248, 26572, 26896, 29200, 29524, 29848, 32152, 32476, 32800, 52496, 52820, 53144, 55448, 55772, 56096, 58400, 58724, 59048, 59050, 59860, 60670, 65620, 66430, 67240, 72190, 73000, 73810
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 16 2015

Keywords

Examples

			40 is in the sequence because 40_10 = 44_9 = 1111_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 9]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=9; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 80000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)

Formula

Intersection of A014190 and A029955.

A118594 Palindromes in base 3 (written in base 3).

Original entry on oeis.org

0, 1, 2, 11, 22, 101, 111, 121, 202, 212, 222, 1001, 1111, 1221, 2002, 2112, 2222, 10001, 10101, 10201, 11011, 11111, 11211, 12021, 12121, 12221, 20002, 20102, 20202, 21012, 21112, 21212, 22022, 22122, 22222, 100001, 101101, 102201, 110011, 111111, 112211, 120021
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Comments

The number of n-digit terms is given by A225367. - M. F. Hasler, May 05 2013 [Moved here on May 08 2013]
Digit-wise application of A000578 (and also superposition of a(n) with its horizontal OR vertical reflection) yields A006072. - M. F. Hasler, May 08 2013
Equivalently, palindromes k (written in base 10) such that 4*k is a palindrome. - Bruno Berselli, Sep 12 2018

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 1110], Max@IntegerDigits@# < 3 &] (* Robert G. Wilson v, May 09 2006 *)
    Select[FromDigits/@Tuples[{0,1,2},8],IntegerDigits[#]==Reverse[ IntegerDigits[ #]]&] (* Harvey P. Dale, Apr 20 2015 *)
  • PARI
    {for(l=1,5,u=vector((l+1)\2,i,10^(i-1)+(2*i-11&&i==1,2]), print1(v*u",")))} \\ The n-th term could be produced by using (partial sums of) A225367 to skip all shorter terms, and then skipping the adequate number of vectors v until n is reached.  - M. F. Hasler, May 08 2013
    
  • Python
    from itertools import count, islice, product
    def agen(): # generator of terms
        yield from [0, 1, 2]
        for d in count(2):
            for start in "12":
                for rest in product("012", repeat=d//2-1):
                    left = start + "".join(rest)
                    for mid in [[""], ["0", "1", "2"]][d%2]:
                        yield int(left + mid + left[::-1])
    print(list(islice(agen(), 42))) # Michael S. Branicky, Mar 29 2022
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A118594(n):
        if n == 1: return 0
        y = 3*(x:=3**integer_log(n>>1,3)[0])
        return int((s:=digits(n-x,3))+s[-2::-1] if nChai Wah Wu, Jun 14 2024
  • Sage
    [int(n.str(base=3)) for n in (0..757) if Word(n.digits(3)).is_palindrome()] # Peter Luschny, Sep 13 2018
    

Extensions

More terms from Robert G. Wilson v, May 09 2006
a(40) and beyond from Michael S. Branicky, Mar 29 2022

A259381 Palindromic numbers in bases 3 and 8 written in base 10.

Original entry on oeis.org

0, 1, 2, 4, 121, 130, 203, 316, 8578, 9490, 17492, 944035, 1141652, 1276916, 1554173, 58961443, 67470916, 4099065139, 5691134677, 81452592329, 81473867465, 419572845958, 21056462595764, 363376288168081
Offset: 1

Views

Author

Eric A. Schmidt and Robert G. Wilson v, Jul 16 2015

Keywords

Examples

			121 is in the sequence because 121_10 = 171_8 = 11111_3.
		

Crossrefs

Programs

  • Mathematica
    (* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 8]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
    b1=3; b2=8; 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, Jul 17 2015 *)

Formula

Intersection of A014190 and A029803.

A134027 Nonnegative numbers that are palindromes in balanced ternary representation.

Original entry on oeis.org

0, 1, 4, 7, 10, 13, 16, 28, 40, 43, 52, 61, 73, 82, 91, 103, 112, 121, 124, 160, 196, 208, 244, 280, 292, 328, 364, 367, 394, 421, 457, 484, 511, 547, 574, 601, 613, 640, 667, 703, 730, 757, 793, 820, 847, 859, 886, 913, 949, 976, 1003, 1039, 1066, 1093, 1096
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 19 2007

Keywords

Comments

A134028(a(n)) = a(n).

Examples

			a(10) = 43 = 1*3^4 - 1*3^3 - 1*3^2 - 1*3^1 + 1*3^0 == '+---+';
a(11) = 52 = 1*3^4 - 1*3^3 + 0*3^2 - 1*3^1 + 1*3^0 == '+-0-+';
a(12) = 61 = 1*3^4 - 1*3^3 + 1*3^2 - 1*3^1 + 1*3^0 == '+-+-+';
a(13) = 73 = 1*3^4 + 0*3^3 - 1*3^2 + 0*3^1 + 1*3^0 == '+0-0+'.
		

References

  • D. E. Knuth, The Art of Computer Programming, Addison-Wesley, Reading, MA, Vol 2, pp 173-175.

Crossrefs

Cf. A014190.

Programs

  • Mathematica
    balTernDigits[0] := {0}; balTernDigits[n_ /; n > 0] := Module[{unParsed = n, currRem, currExp = 1, digitList = {}, nextDigit}, While[unParsed > 0, If[unParsed == 3^(currExp - 1), digitList = Append[digitList, 1]; unParsed = 0, currRem = Mod[unParsed, 3^currExp]/3^(currExp - 1); nextDigit = Switch[ currRem, 0, 0, 2, -1, 1, 1]; digitList = Append[ digitList, nextDigit]; unParsed = unParsed - nextDigit*3^(currExp - 1)]; currExp++]; digitList = Reverse[digitList]; Return[ digitList]]; balTernDigits[n_ /; n < 0] := (-1) balTernDigits[ Abs[ n]]; palQ[n_] := n == Reverse@ n; Select[ Range@ 1300, palQ@ balTernDigits@# &] (* Robert G. Wilson v, Jun 17 2014 *)

A351712 Numbers whose minimal (or greedy) Lucas representation (A130310) is palindromic.

Original entry on oeis.org

0, 2, 6, 9, 13, 20, 24, 31, 49, 56, 64, 78, 100, 125, 136, 150, 158, 169, 201, 237, 252, 324, 342, 364, 378, 396, 404, 422, 444, 523, 581, 606, 650, 708, 845, 874, 910, 932, 961, 975, 1004, 1040, 1048, 1077, 1113, 1135, 1164, 1366, 1460, 1500, 1572, 1666, 1692, 1786
Offset: 1

Views

Author

Amiram Eldar, Feb 17 2022

Keywords

Comments

A000211(n) = Lucas(n) + 2 is a term for all n > 2, since the representation of Lucas(n) + 2 is 10...01 with n-1 0's between the two 1's.

Examples

			The first 10 terms are:
   n  a(n) A130310(a(n))
   ---------------------
   1   0               0
   2   2               1
   3   6            1001
   4   9           10001
   5  13          100001
   6  20         1000001
   7  24         1001001
   8  31        10000001
   9  49       100000001
  10  56       100010001
		

Crossrefs

Subsequence of A054770.
Similar sequences: A002113, A006995, A014190, A094202, A331191, A351717.

Programs

  • Mathematica
    lucasPalQ[n_] := Module[{s = {}, m = n, k = 1}, While[m > 0, If[m == 1, k = 1; AppendTo[s, k]; m = 0, If[m == 2, k = 0; AppendTo[s, k]; m = 0, While[LucasL[k] <= m, k++]; k--; AppendTo[s, k]; m -= LucasL[k]; k = 1]]]; PalindromeQ[IntegerDigits[Total[2^s], 2]]]; Select[Range[0, 2000], lucasPalQ]
Previous Showing 11-20 of 55 results. Next