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.

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