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

A029730 Numbers that are palindromic in base 16.

Original entry on oeis.org

0, 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
Offset: 1

Views

Author

Keywords

Examples

			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 11, 22, 33, 44, 55, 66, 77, 88, 99, AA, BB, CC, DD, EE, FF, 101, 111, 121, 131, 141, 151, 161, 171, 181, 191,1A1, 1B1, 1C1, 1D1, 1E1, 1F1, 202, 212, 222, 232, 242, 252, 262, 272, 282, 292, 2A2, 2B2, 2C2, 2D2, 2E2, 2F2, 303, 313, 323, 333, 343, 353, 363, 373, 383, 393, 3A3, 3B3, 3C3, 3D3, 3E3, 3F3, 404, ... - _Reinhard Zumkeller_, Sep 23 2015
		

Crossrefs

Cf. A029731 (also palindromic in decimal), A056962, A262437.

Programs

  • Haskell
    a029730 n = a029730_list !! (n-1)
    a029730_list = map (foldr (\h v -> 16 * v + h) 0) $
                       filter (\xs -> xs == reverse xs) a262437_tabf
    -- Reinhard Zumkeller, Sep 23 2015
    
  • Mathematica
    palindromicQ[n_, b_] := Module[{i = IntegerDigits[n, b]}, i == Reverse[i]]; Select[Range[1000], palindromicQ[#, 16] &] (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
  • PARI
    isok(n) = my(v=digits(n,16)); v == Vecrev(v); \\ Michel Marcus, Sep 30 2018
    
  • Python
    def A029730(n):
        if n == 1: return 0
        y = (x:=1<<(n.bit_length()-2&-4))<<4
        return (c:=n-x)*x+int(hex(c)[-2:1:-1]or'0',16) if nChai Wah Wu, Jun 13 2024

Formula

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

A262460 Lexicographically earliest sequence of distinct terms such that the hexadecimal representations of two consecutive terms overlap.

Original entry on oeis.org

1, 16, 17, 18, 2, 32, 34, 33, 19, 3, 35, 48, 51, 49, 20, 4, 36, 50, 37, 5, 21, 65, 22, 6, 38, 66, 39, 7, 23, 81, 24, 8, 40, 82, 41, 9, 25, 97, 26, 10, 42, 98, 43, 11, 27, 113, 28, 12, 44, 114, 45, 13, 29, 129, 30, 14, 46, 130, 47, 15, 31, 145, 57, 67, 52, 64
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 23 2015

Keywords

Comments

Suggested by Paul Tek's A262323;
two numbers are overlapping if a nonempty prefix of one equals a suffix of the other;
permutation of the natural numbers with inverse A262461.

Examples

			Table of initial terms: the HEX column gives the hexadecimal representation with aligned overlapping digits.
.   n | a(n) | HEX          n | a(n) | HEX          n | a(n) | HEX
. ----+------+-------     ----+------+-------     ----+------+-------
.   1 |    1 |  1          25 |   38 |   26        49 |   44 |    2C
.   2 |   16 |  10         26 |   66 |  42         50 |  114 |   72
.   3 |   17 | 11          27 |   39 |   27        51 |   45 |    2D
.   4 |   18 |  12         28 |    7 |    7        52 |   13 |     D
.   5 |    2 |   2         29 |   23 |   17        53 |   29 |    1D
.   6 |   32 |   20        30 |   81 |  51         54 |  129 |   81
.   7 |   34 |  22         31 |   24 |   18        55 |   30 |    1E
.   8 |   33 |   21        32 |    8 |    8        56 |   14 |     E
.   9 |   19 |    13       33 |   40 |   28        57 |   46 |    2E
.  10 |    3 |     3       34 |   82 |  52         58 |  130 |   82
.  11 |   35 |    23       35 |   41 |   29        59 |   47 |    2F
.  12 |   48 |     30      36 |    9 |    9        60 |   15 |     F
.  13 |   51 |    33       37 |   25 |   19        61 |   31 |    1F
.  14 |   49 |     31      38 |   97 |  61         62 |  145 |   91
.  15 |   20 |      14     39 |   26 |   1A        63 |   57 |  39
.  16 |    4 |       4     40 |   10 |    A        64 |   67 | 43
.  17 |   36 |      24     41 |   42 |   2A        65 |   52 |  34
.  18 |   50 |     32      42 |   98 |  62         66 |   64 |   40
.  19 |   37 |      25     43 |   43 |   2B        67 |   68 |  44
.  20 |    5 |       5     44 |   11 |    B        68 |   69 |   45
.  21 |   21 |      15     45 |   27 |   1B        69 |   80 |    50
.  22 |   65 |     41      46 |  113 |  71         70 |   53 |   35
.  23 |   22 |      16     47 |   28 |   1C        71 |   83 |    53
.  24 |    6 |       6     48 |   12 |    C        72 |   54 |     36
		

Crossrefs

Cf. A262323, A262411, A262437, A262461 (inverse).

Programs

  • Haskell
    import Data.List (inits, tails, intersect, delete, genericIndex)
    a262460 n = genericIndex a262460_list (n - 1)
    a262460_list = 1 : f [1] (drop 2 a262437_tabf) where
       f xs tss = g tss where
         g (ys:yss) | null (intersect its $ tail $ inits ys) &&
                      null (intersect tis $ init $ tails ys) = g yss
                    | otherwise = (foldr (\t v -> 16 * v + t) 0 ys) :
                                  f ys (delete ys tss)
         its = init $ tails xs; tis = tail $ inits xs

A262438 Number of digits of hexadecimal representation of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 22 2015

Keywords

Comments

Length of n-th row in A262437.

Crossrefs

Programs

  • Haskell
    a262438 = length . a262437_row
    
  • Maple
    A262438 := proc(n)
        if n =0 then
            1;
        else
            1+floor(log[16](n)) ;
        end if;
    end proc: # R. J. Mathar, Dec 14 2015
  • PARI
    a(n) = if (n, #digits(n, 16), 1); \\ Michel Marcus, Dec 14 2015
Showing 1-3 of 3 results.