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.

A256080 Non-palindromic balanced numbers in base 16.

Original entry on oeis.org

4144, 4416, 4688, 4866, 4960, 5138, 5232, 5410, 5504, 5635, 5682, 5776, 5907, 5954, 6048, 6179, 6226, 6320, 6404, 6451, 6498, 6592, 6676, 6723, 6770, 6864, 6948, 6995, 7042, 7136, 7173, 7220, 7267, 7314, 7408, 7445, 7492, 7539, 7586, 7717, 7764, 7811, 7858, 7942, 7989
Offset: 1

Views

Author

M. F. Hasler, Mar 14 2015

Keywords

Comments

Here a number is called balanced if the sum of digits weighted by their arithmetic distance from the "center" is zero. Palindromes (A029730) are trivially balanced, therefore they are excluded here.
This is the hexadecimal variant of the decimal version A256075 invented by Eric Angelini. See there, and the base-2 version A256082, for further information and examples.See A256090 for the primes in this sequence.

Crossrefs

Programs

  • PARI
    is(n,b=16,d=digits(n,b),o=(#d+1)/2)=!(vector(#d,i,i-o)*d~)&&d!=Vecrev(d)

A056962 Base 16 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 17, 33, 49, 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, 2, 18, 34, 50, 66, 82, 98, 114, 130, 146, 162, 178, 194, 210, 226, 242, 3, 19, 35, 51, 67, 83, 99, 115, 131, 147, 163, 179, 195, 211, 227, 243, 4
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Examples

			a(17) = 17 because 17 in hexadecimal is 11, the same as its reverse.
a(18) = 33 because 18 in hexadecimal is 12, and hexadecimal 21 is 2 * 16 + 1 = 33.
a(19) = 49 because 19 in hexadecimal is 13, and hexadecimal 31 is 3 * 16 + 1 = 49.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n, 16]], 16], {n, 0, 127}] (* Alonso del Arte, Sep 30 2018 *)
  • PARI
    a(n) = fromdigits(Vecrev(digits(n, 16)), 16); \\ Michel Marcus, Sep 30 2018

A297289 Numbers whose base-16 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, 11, 12, 13, 14, 15, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 257, 273, 289, 305, 321, 337, 353, 369, 385, 401, 417, 433, 449, 465, 481, 497, 514, 530, 546, 562, 578, 594, 610, 626, 642, 658, 674
Offset: 1

Views

Author

Clark Kimberling, Jan 17 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 from A029730 after the zero first at 4113 = 1011_16 (not a base-16 palindrome), where DV=UV=1. - R. J. Mathar, Jan 23 2018

Examples

			674 in base-16:  2,10,2 having DV = 8, UV = 8, so that 674 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 = 16; 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]   (* A297288 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297289 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297290 *)

A319598 Numbers in base 10 that are palindromic in bases 2, 4, 8, and 16.

Original entry on oeis.org

0, 1, 3, 5, 4095, 4097, 12291, 20485, 21845, 16777215, 16777217, 16781313, 50331651, 50343939, 83886085, 83906565, 89458005, 89478485, 68702703615, 68719476735, 68719476737, 68736258049, 206158430211, 206208774147, 343597383685, 343602954245, 343681290245
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 24 2018

Keywords

Comments

Intersection of A006995, A014192, A029803, and A029730.
This sequence is infinite because it contains terms of the forms 4096^k-1 (k>=0) and 4096^k+1 (k>0). - Bruno Berselli, Sep 24 2018

Examples

			4095 = 111111111111_2 = 333333_4 = 7777_8 = FFF_16. Hence 4095 is in the sequence.
		

Crossrefs

Cf. A006995 (base 2), A014192 (base 4), A029803 (base 8), and A029730 (base 16).

Programs

  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..100000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]

Extensions

a(19)-a(27) from Rémy Sigrist, Nov 15 2018

A319583 Numbers in base 10 that are palindromic in bases 2, 4, and 16.

Original entry on oeis.org

0, 1, 3, 5, 15, 17, 51, 85, 255, 257, 273, 771, 819, 1285, 1365, 3855, 4095, 4097, 4369, 12291, 13107, 20485, 21845, 61455, 65535, 65537, 65793, 69649, 69905, 196611, 197379, 208947, 209715, 327685, 328965, 348245, 349525, 983055, 986895, 1044735, 1048575
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 23 2018

Keywords

Comments

Intersection of A006995, A014192, and A029730.
This sequence is infinite as it contains 15*(1 + 16^k) for any k > 0. - Rémy Sigrist, Sep 23 2018
Palindromes in base 16 whose nonzero base-16 digits are either all 1, all 3, all 5 or all F (15). - Robert Israel, Nov 12 2023

Examples

			255 is 11111111 in binary, 3333 in quaternary and FF in hexadecimal. Hence 255 is in the sequence.
Although 21 is 10101 in binary and 111 in quaternary, it is 15 in hexadecimal and therefore not in the sequence.
		

Crossrefs

Cf. A006995 (base 2), A014192 (base 4), and A029730 (base 16).

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
  • Maple
    extend:= proc(x, d)
      local a,b,m;
      if d::odd then
        m:= (d-1)/2;
        a:= x mod 16^(m+1);
        b:= floor(x/16^m);
        a + 16^(m+1)*b
      else
        m:= d/2;
        a:= x mod 16^m;
        b:= floor(x/16^m);
        (a + 16^(m+1)*b, a + 16^m * (a mod 16) + 16^(m+1)*b)
      fi
    end proc:
    V:= [1,3,5,15]: R:= 0, op(V):
    for d from 1 to 6 do
      V:= map(extend,V,d);
      R:= R, op(V);
    od:
    R; # Robert Israel, Nov 12 2023
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..1000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(16)).is_palindrome()]
    

A340559 Numbers that are palindromic in base 2 and base 16.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 15, 17, 51, 85, 119, 153, 255, 257, 273, 771, 819, 1285, 1317, 1365, 1397, 1799, 1831, 1879, 1911, 2313, 2409, 2457, 2553, 3855, 3951, 3999, 4095, 4097, 4369, 12291, 13107, 20485, 21029, 21845, 22389, 28679, 29223, 30039, 30583, 36873, 38505
Offset: 1

Views

Author

Glen Gilchrist, Jan 11 2021

Keywords

Crossrefs

Intersection of A006995 and A029730.

Programs

  • Mathematica
    Select[Range[0, 10^5], PalindromeQ @ IntegerDigits[#, 2] && PalindromeQ @ IntegerDigits[#, 16]  &] (* Amiram Eldar, Jan 11 2021 *)
  • PARI
    ispal(m, b) = my(d=digits(m, b)); d == Vecrev(d);
    isok(m) = ispal(m, 2) && ispal(m, 16); \\ Michel Marcus, Jan 20 2021
  • Python
    def palindrome(x):
        res = str(x) == str(x)[::-1]
        return res
    def dec_to_bin(x):
        return int(bin(x)[2:])
    def dec_to_hex(x):
        return (hex(x)[2:])
    for x in range (1,10000):
        if palindrome(dec_to_hex(x)) & palindrome(dec_to_bin(x)) == True:
              print(x)
    (BASIC:- MM Basic, a modern QBASIC variant, https://www.mmbasic.com/)
    Function reverse(in_string$) As string
      Local r$
      Local i
      For i = Len(in_string$) To 1 Step -1
          b$=Mid$(in_string$,i,1)
          r$=r$+b$
      Next i
      reverse=r$
    End Function
    For i = 1 To 10000
      If Bin$(i) = reverse(Bin$(i)) Then
          If Hex$(i) = reverse(Hex$(i)) Then
              Print i,Bin$(i), Hex$(i)
          EndIf
      EndIf
    Next i
    

A043275 Sum of the digits of the n-th base 16 palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 6, 7, 8, 9, 10, 11, 12, 13
Offset: 1

Views

Author

Keywords

Crossrefs

A029730 (base 16 palindromes)

A319585 Numbers in base 10 that are palindromic in bases 2, 8, and 16.

Original entry on oeis.org

0, 1, 3, 5, 7, 9, 3951, 4095, 4097, 12291, 20485, 21845, 28679, 30039, 36873, 16187247, 16777215, 16777217, 16781313, 50331651, 50343939, 83886085, 83894277, 83906565, 83914757, 89458005, 89466197, 89478485, 89486677, 117440519, 117448711, 117460999
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 23 2018

Keywords

Comments

Intersection of A006995, A029803, and A029730.

Examples

			16187247 = 111101101111111101101111_2 = 75577557_8 = F6FF6F_16.
		

Crossrefs

Cf. A006995 (base 2), A029803 (base 8), and A029730 (base 16).

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 8) eq Reverse(Intseq(n, 8)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 2] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..10000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]
    

A319609 Numbers in base 10 that are palindromic in bases 4, 8 and 16.

Original entry on oeis.org

0, 1, 2, 3, 5, 170, 4095, 4097, 8194, 12291, 20485, 21845, 696490, 699050, 16777215, 16777217, 16781313, 16785409, 16789505, 33554434, 33558530, 33562626, 33566722, 50331651, 50335747, 50339843, 50343939, 83886085, 83906565, 89458005, 89478485
Offset: 1

Views

Author

Jeremias M. Gomes, Sep 24 2018

Keywords

Examples

			170 = 2222_4 = 252_8 = AA_16. Hence 170 is in the sequence.
		

Crossrefs

Intersection of A014192, A029803 and A029730.

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 8) eq Reverse(Intseq(n, 8)) and Intseq(n, 16) eq Reverse(Intseq(n, 16))]; // Vincenzo Librandi, Sep 24 2018
  • Mathematica
    palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
    Reap[Do[If[palQ[n, 4] && palQ[n, 8] && palQ[n, 16], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
  • Sage
    [n for n in (0..100000) if Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome() and Word(n.digits(16)).is_palindrome()]
    
Showing 1-9 of 9 results.