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 31 results. Next

A118596 Palindromes in base 5 (written in base 5).

Original entry on oeis.org

0, 1, 2, 3, 4, 11, 22, 33, 44, 101, 111, 121, 131, 141, 202, 212, 222, 232, 242, 303, 313, 323, 333, 343, 404, 414, 424, 434, 444, 1001, 1111, 1221, 1331, 1441, 2002, 2112, 2222, 2332, 2442, 3003, 3113, 3223, 3333, 3443, 4004, 4114, 4224, 4334, 4444, 10001
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Comments

Equivalently, palindromes k (written in base 10) such that 2*k is a palindrome. - Bruno Berselli, Sep 12 2018

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 198], Max@IntegerDigits@# < 5 &] (* Robert G. Wilson v, May 09 2006 *)
    Select[FromDigits/@IntegerDigits[Range[1000],5],PalindromeQ] (* Fred Patrick Doty, Aug 12 2017 *)
  • PARI
    is(n)=if(n<5, return(n>=0)); my(d=digits(n)); vecmax(d)<5 && Vecrev(d)==d \\ Charles R Greathouse IV, Aug 22 2017
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A118596(n):
        if n == 1: return 0
        y = 5*(x:=5**integer_log(n>>1,5)[0])
        return int((s:=digits(n-x,5))+s[-2::-1] if nChai Wah Wu, Jun 14 2024

Extensions

More terms from Robert G. Wilson v, May 09 2006

A118599 Palindromes in base 8 (written in base 8).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 11, 22, 33, 44, 55, 66, 77, 101, 111, 121, 131, 141, 151, 161, 171, 202, 212, 222, 232, 242, 252, 262, 272, 303, 313, 323, 333, 343, 353, 363, 373, 404, 414, 424, 434, 444, 454, 464, 474, 505, 515, 525, 535, 545, 555, 565, 575, 606, 616
Offset: 1

Views

Author

Martin Renner, May 08 2006

Keywords

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 70], Max@IntegerDigits@# < 8 &] (* Robert G. Wilson v, May 09 2006 *)
  • Python
    def A118599(n):
        if n == 1: return 0
        y = (x:=1<<(m:=n.bit_length()-2)-m%3)<<3
        return int((s:=oct(n-x)[2:])+s[-2::-1] if nChai Wah Wu, Jun 14 2024

Extensions

More terms from Robert G. Wilson v, May 09 2006

A118600 Palindromes in base 9 (written in base 9).

Original entry on oeis.org

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

Views

Author

Martin Renner, May 08 2006

Keywords

Crossrefs

Programs

  • Mathematica
    (* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 62], Max@IntegerDigits@# < 9 &] (* Robert G. Wilson v, May 09 2006 *)
  • Python
    from gmpy2 import digits
    def palgenbase(l,b): # generator of palindromes in base b <=10 of length <= 2*l, written in base b
        if l > 0:
            yield 0
            for x in range(1,l+1):
                for y in range(b**(x-1),b**x):
                    s = digits(y,b)
                    yield int(s+s[-2::-1])
                for y in range(b**(x-1),b**x):
                    s = digits(y,b)
                    yield int(s+s[::-1])
    A118600_list = list(palgenbase(3,9)) # Chai Wah Wu, Dec 01 2014
    
  • Python
    from sympy import integer_log
    from gmpy2 import digits
    def A118600(n):
        if n == 1: return 0
        y = 9*(x:=9**integer_log(n>>1,9)[0])
        return int((s:=digits(n-x,9))+s[-2::-1] if nChai Wah Wu, Jun 14 2024

Extensions

More terms from Robert G. Wilson v, May 09 2006

A006943 Rows of Sierpiński's triangle (Pascal's triangle mod 2).

Original entry on oeis.org

1, 11, 101, 1111, 10001, 110011, 1010101, 11111111, 100000001, 1100000011, 10100000101, 111100001111, 1000100010001, 11001100110011, 101010101010101, 1111111111111111, 10000000000000001, 110000000000000011
Offset: 0

Views

Author

Keywords

Comments

The rows of Sierpiński's triangle, read as numbers in binary representation, are products of distinct Fermat numbers, row 0 being the empty product. (See also the comment in A080176.)
Rows 1 to 31 are the binary representation of the 31 (2^5-1) nonempty products of distinct Fermat primes, giving the number of sides of constructible (with straightedge and compass) odd-sided polygons. - Daniel Forgues, Jun 21 2011
Sierpiński's triangles typically refer to any finite triangle with rows 0 to 2^n-1 so as to get complete triangles, with n at least 4 so as to show the fractal-like pattern of nested triangles. We may consider these finite Sierpiński's triangles as finite parts of "the" infinite Sierpiński's triangle, so to speak. - Daniel Forgues, Jun 22 2011
Also, binary representation of the n-th iteration of the "Rule 60" elementary cellular automaton starting with a single ON (black) cell. - Robert Price, Feb 21 2016
a(n) is the concatenation of the coefficients of (x+1)^n in GF(2)[x]. - Thomas Anton, Oct 04 2022
Subsequence of A057148. - Chai Wah Wu, Jul 30 2025

Examples

			From _Daniel Forgues_, Jun 20 2011: (Start)
Terms as products of distinct Fermat numbers in binary representation (Cf. A080176 comment) (Cf. Sierpiński's triangle on OEIS Wiki):
a(0) = 1 = (empty product);
a(1) = 11 = F_0;
a(2) = 101 = F_1;
a(3) = 1111 = 11*101 = F_0*F_1;
a(4) = 10001 = F_2;
a(5) = 110011 = 11*10001 = F_0*F_2;
a(6) = 1010101 = 101*10001 = F_1*F_2;
a(7) = 11111111 = 11*101*10001 = F_0*F_1*F_2. (End)
		

References

  • C. Pickover, Mazes for the Mind, St. Martin's Press, NY, 1992, p. 353.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Cf. A001317 (decimal representation).
Cf. A080176 (Fermat numbers in binary).

Programs

  • Maple
    A006943 := proc(n) local k; add((binomial(n,k) mod 2)*10^k, k=0..n); end;
  • Mathematica
    f[n_] := FromDigits@ Mod[Binomial[n, Range[0, n]], 2]; Array[f, 17, 0] (* Robert G. Wilson v, Jun 26 2011 *)
  • Python
    def A006943(n): return sum((bool(~n&n-k)^1)*10**k for k in range(n+1)) # Chai Wah Wu, May 03 2023

Formula

From Daniel Forgues, Jun 20-21 2011: (Start)
In the following formulas, [...]_2 means converted to base 2.
a(n) = [Sum_{i=0..n} (binomial(n,i) mod 2) 2^i]_2, n >= 0.
From row n, 0 <= n <= 2^k - 1, k >= 0, being
a(n) = [Product_{i=0..k-1} (F_i)^(alpha_i)]_2, alpha_i in {0, 1},
where for k = 0, we get the empty product, i.e., 1, giving a(0) = 1,
we induce from the triangle that row 2^k + n, 0 <= n <= 2^k - 1, is
a(2^k + n) = a(n)*[F_k]_2, k >= 0.
Denton Hewgill's identity (cf. links):
a(n) = [Product_{i>=0} (F_i)^(floor(n/2^i) mod 2)]_2, F_i = 2^(2^i)+1.
a(0) = 1; a(n) = [Product_{i=0..floor(log_2(n))} (F_i)^(floor(n/2^i) mod 2)]_2, F_i = 2^(2^i)+1, n >= 1. (End)
From Vladimir Shevelev, Dec 26-27 2013: (Start)
Sum_{n>=0} 1/a(n)^r = Product_{k>=0} (1 + 1/(10^(2^k)+1)^r),
Sum_{n>=0} (-1)^A000120(n)/a(n)^r = Product_{k>=0} (1 - 1/(10^(2^k)+1)^r), where r > 0 is a real number.
In particular,
Sum_{n>=0} 1/a(n) = Product_{k>=0} (1 + 1/(10^(2^k)+1)) = 1.10182034...;
Sum_{n>=0} (-1)^A000120(n)/a(n) = 0.9;
a(2^n) = 10^(2^n) + 1, n >= 0.
Note that analogs of Stephan's limit formulas (see Shevelev link) reduce to the relations a(2^t*n+2^(t-1)) = 99*(10^(2^(t-1)+1))/(10^(2^(t-1))-1) * a(2^t*n+2^(t-1)-2), t >= 2. In particular, for t=2,3,4, we have the following formulas:
a(4*n+2) = 101*a(4*n);
a(8*n+4) = (10001/101)*a(8*n+2);
a(16*n+8) = (100000001/1010101)*(16*n+6), etc. (End)
From Tom Edgar, Oct 11 2015: (Start)
a(2*n+1) = 11*a(2*n).
a(n) = Product_{b_j != 0} a(2^j) where n = Sum_{j>=0} b_j*2^j is the binary representation of n.
(End)

Extensions

More terms from James Sellers, Aug 21 2000
Edited by Daniel Forgues, Jun 20 2011

A066058 In base 2: smallest integer which requires n 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

0, 2, 11, 44, 19, 20, 275, 326, 259, 202, 103, 74, 1027, 1070, 1049, 1072, 1547, 1310, 1117, 794, 569, 398, 3083, 2154, 1177, 1064, 4697, 4264, 4443, 2678, 2169, 1422, 779, 3226, 1551, 1114, 1815, 1062, 4197, 3106, 8697, 7238, 16633, 12302, 6683
Offset: 0

Views

Author

Klaus Brockhaus, Dec 04 2001

Keywords

Comments

The analog of A023109 in base 2.

Examples

			11 is the smallest integer which requires two steps to reach a base 2 palindrome (cf. A066057), so a(2) = 11; written in base 10: 11 -> 11 + 13 = 24 -> 24 + 3 = 27; written in base 2: 1011 -> 1011 + 1101 = 11000 -> 11000 + 11 = 11011.
		

Crossrefs

Programs

  • ARIBAS
    (* For function b2reverse see A066057. *) function a066058(mx: integer); var k,m,n,rev,steps: integer; begin for k := 0 to mx do n := 0; steps := 0; m := n; rev := b2reverse(m); while not(steps = k and m = rev) do inc(n); m := n; rev := b2reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := b2reverse(m); inc(steps); end; end; write(n,","); end; end; a066058(45);
    
  • Mathematica
    Table[ SelectFirst[Range[0, 20000], (np = #; i = 0;
        While[ np != IntegerReverse[np, 2] && i <= n,
         np = np + IntegerReverse[np, 2]; i++];
    i == n ) &] , {n, 0, 44}] (* Robert Price, Oct 16 2019 *)
  • Python
    def A066058(n):
        if n > 0:
            k = 0
            while True:
                m = k
                for i in range(n):
                    s1 = format(m,'b')
                    s2 = s1[::-1]
                    if s1 == s2:
                        break
                    m += int(s2,2)
                else:
                    s1 = format(m,'b')
                    if s1 == s1[::-1]:
                        return k
                k += 1
        else:
            return 0 # Chai Wah Wu, Jan 06 2015

A101705 Numbers n such that n = 12*reversal(n).

Original entry on oeis.org

0, 540, 5940, 54540, 59940, 540540, 599940, 5400540, 5454540, 5945940, 5999940, 54000540, 54594540, 59405940, 59999940, 540000540, 540540540, 545454540, 545994540, 594005940, 594545940, 599459940, 599999940, 5400000540, 5405940540, 5454054540, 5459994540, 5940005940, 5945945940, 5994059940, 5999999940
Offset: 1

Views

Author

Farideh Firoozbakht, Jan 02 2005

Keywords

Comments

60 divides all terms of the sequence. For all nonnegative integers m and n all numbers of the form f(m,n) = (100*(6*10^m - 1)+ 40)*(10^((m + 2)*n) - 1)/(10^(m + 2) - 1) are in the sequence, in fact f(m,n) = (5.(9)(m))(n).0 where dot between numbers means concatenation and "(r)(t)" means number of r's is t. f(m,1) = 100*(6*10^m - 1)+ 40 = 5.(9)(m).40; f(0,1) = 540, f(1,1) = 5940, f(2,1)=59940, etc. f(m,2) = 5.(9)(m).50(9)(m).40; f(0,2) = 54540, f(1,2) = 5945940, etc. Let g(s,t,r) = s*(10^((L+t)(1+r))-1)/(10^(L+t)-1) where L = number of digits of s. If s is in the sequence then all numbers of the form g(s,t,r) for nonnegative integers t and r are in the sequence (the function g is the same function that has been defined in the sequence A101704). If n and m are nonnegative integers then g(n,0,m) = (n)(m+1) for example g(13,0,3) = (13)(4) = 13131313.

Examples

			g(540,0,5)= (540)(6) = 540540540540540540 is in the sequence because reversal(540540540540540540) = 45045045045045045 and 12*45045045045045045 = 540540540540540540.
		

Crossrefs

Programs

  • Mathematica
    Do[If[n == 12*FromDigits[Reverse[IntegerDigits[n]]], Print[n]], {n, 0, 6000000000, 60}]
    Select[Range[0,6*10^9,60],#==12IntegerReverse[#]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 12 2017 *)
  • Python
    def A101705(n):
        if n == 1: return 0
        a = 1<Chai Wah Wu, Jul 23 2024

Formula

a(n) = 540*A057148. - Ray Chandler, Oct 09 2017

Extensions

a(25)-a(31) from Max Alekseyev, Aug 18 2013

A192775 The numbers n^2 as n runs through the numbers which are palindromes in base 2.

Original entry on oeis.org

0, 1, 9, 25, 49, 81, 225, 289, 441, 729, 961, 1089, 2025, 2601, 3969, 4225, 5329, 7225, 8649, 9801, 11449, 14161, 16129, 16641, 23409, 27225, 35721, 38025, 47961, 53361, 65025, 66049, 74529, 88209, 97969, 105625, 116281, 133225, 145161, 149769, 162409, 182329, 196249, 207025, 221841, 245025, 261121, 263169, 314721, 342225, 400689, 416025, 480249, 514089, 585225
Offset: 1

Views

Author

N. J. A. Sloane, Jul 09 2011

Keywords

Crossrefs

Cf. A006995, A057148. See A192776 for these numbers written in base 2.

Programs

  • Python
    def A192775(n):
        if n == 1: return 0
        a = 1<<(l:=n.bit_length()-2)
        m = a|(n&a-1)
        return ((m<Chai Wah Wu, Jul 23 2024

A240602 Recursive palindromes in base 2: palindromes n where each half of the digits of n is also a recursive palindrome.

Original entry on oeis.org

0, 1, 11, 101, 111, 1111, 11011, 11111, 101101, 111111, 1010101, 1011101, 1110111, 1111111, 11111111, 111101111, 111111111, 1101111011, 1111111111, 11011011011, 11011111011, 11111011111, 11111111111, 101101101101, 111111111111, 1011010101101, 1011011101101, 1111110111111, 1111111111111
Offset: 1

Views

Author

Lior Manor, Apr 13 2014

Keywords

Comments

A number n with m digits in base 2 is a member of a(n) if n is a palindrome, and the first floor(m/2) digits of n is already a previous term of a(n). Fast generation of new terms with 2m digits can be done by concatenating the previous terms with m digits twice. Fast generation of new terms with 2m+1 digits can be done by concatenating the previous terms with m digits twice with any single digit in the middle. The smallest palindrome which is not a member of a(n) is 1001.

Examples

			11011 is in the sequence since it is a palindrome of 5 digits, and the first floor(5/2) digits of it, 11, is also a term. 1001 and 10001 are not in a(n) since 10 is not in a(n).
		

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Select[IntegerDigits[Range[2^12], 2], And[PalindromeQ@ Take[#, Floor[Length[#]/2]], PalindromeQ[#]] &] (* Michael De Vlieger, Nov 08 2017 *)

A193434 6*n/5 = (n written backwards), n > 0.

Original entry on oeis.org

45, 495, 4545, 4995, 45045, 49995, 450045, 454545, 495495, 499995, 4500045, 4549545, 4950495, 4999995, 45000045, 45045045, 45454545, 45499545, 49500495, 49545495, 49954995, 49999995, 450000045, 450495045, 454504545, 454999545, 495000495, 495495495, 499504995
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 01 2011

Keywords

Examples

			495 belongs to this sequence because 6*495/5 = 594.
		

Crossrefs

Programs

  • Mathematica
    Rest@Select[FromDigits /@ Tuples[{0, 45}, 8], IntegerDigits[6*#/5] == Reverse@IntegerDigits[#] &] (* Arkadiusz Wesolowski, Aug 14 2012 *)
  • Python
    def A193434(n):
        a = 1<<(m:=n+1).bit_length()-2
        s = bin(a|(m&a-1))[2:]
        return 45*int(s+(s[::-1] if a&m else s[-2::-1])) # Chai Wah Wu, Jul 23 2024

Formula

a(n) = 45*A057148(n+1). - Ray Chandler, Oct 09 2017

A330672 Numbers whose base phi representation is symmetrical with respect to the radix point.

Original entry on oeis.org

0, 2, 14, 36, 38, 94, 96, 246, 248, 260, 644, 646, 658, 680, 682, 1686, 1688, 1700, 1722, 1724, 1780, 1782, 4414, 4416, 4428, 4450, 4452, 4508, 4510, 4660, 4662, 4674, 11556, 11558, 11570, 11592, 11594, 11650, 11652, 11802, 11804, 11816, 12200, 12202, 12214
Offset: 1

Views

Author

Rémy Sigrist, Apr 23 2020

Keywords

Comments

There is a 13-state finite automaton that accepts the Zeckendorf expansions of the members of this sequence. - Jeffrey Shallit, May 03 2023

Examples

			The first terms, alongside their base phi representation, are:
  n   a(n)  phi(a(n))
  --  ----  -------------------------
   1     0             0.0
   2     2            10.01
   3    14        100100.001001
   4    36      10010000.00001001
   5    38      10010010.01001001
   6    94    1001000000.0000001001
   7    96    1001000010.0100001001
   8   246  100100000000.000000001001
   9   248  100100000010.010000001001
  10   260  100100100100.001001001001
		

Crossrefs

See A330722 for a weaker variant.

Programs

  • PARI
    See Links section.

Formula

A130600(a(n)) belongs to A057148 for any n >= 0.
Previous Showing 11-20 of 31 results. Next