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.

A060792 Numbers that are palindromic in bases 2 and 3.

Original entry on oeis.org

0, 1, 6643, 1422773, 5415589, 90396755477, 381920985378904469, 1922624336133018996235, 2004595370006815987563563, 8022581057533823761829436662099, 392629621582222667733213907054116073, 32456836304775204439912231201966254787, 428027336071597254024922793107218595973
Offset: 1

Views

Author

Ulrich Schimke (ulrschimke(AT)aol.com)

Keywords

Comments

a(18) (if it exists) is greater than 3^93. - Ilya Nikulshin, Feb 22 2016

Examples

			6643 is a term: since 6643 = 1100111110011_2 = 100010001_3.
1422773 is a term: 1422773 = 101011011010110110101_2 = 2200021200022_3. - _Vladimir Joseph Stephan Orlovsky_, Sep 19 2009
		

Crossrefs

a(3) = A048268(2) = A056749(3).
Intersection of A006995 and A014190.

Programs

  • Magma
    [n: n in [0..2*10^7] | Intseq(n, 3) eq Reverse(Intseq(n, 3))and Intseq(n, 2) eq Reverse(Intseq(n, 2))]; // Vincenzo Librandi, Feb 24 2016
  • Mathematica
    pal2Q[n_Integer] := IntegerDigits[n, 2] == Reverse[IntegerDigits[n, 2]]; pal3Q[n_Integer] := IntegerDigits[n, 3] == Reverse[IntegerDigits[n, 3]]; A060792 = {}; Do[If[pal2Q[n] && pal3Q[n], AppendTo[A060792, n]], {n, 12!}]; A060792 (* Vladimir Joseph Stephan Orlovsky, Sep 19 2009 *)
    b1=2; b2=3; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 2 10^7}]; lst (* Vincenzo Librandi, Feb 24 2016 *)
  • PARI
    ispal(n,b)=my(d=digits(n,b)); d==Vecrev(d)
    is(n)=ispal(n,2)&&ispal(n,3) \\ Charles R Greathouse IV, Jun 17 2014
    
  • Python
    from itertools import chain
    from gmpy2 import digits, mpz
    A060792 = [int(n,2) for n in chain(map(lambda x:bin(x)[2:]+bin(x)[2:][::-1],range(1,2**16)),map(lambda x:bin(x)[2:]+bin(x)[2:][-2::-1], range(1,2**16))) if mpz(int(n,2)).digits(3) == mpz(int(n,2)).digits(3)[::-1]] # Chai Wah Wu, Aug 12 2014
    

Extensions

a(7) found by François Boisson, using a Caml program running on an AMD-64 machine. - Bruno Petazzoni, program co-author, Jan 31 2006
a(8) from the same source, May 26 2006
a(9) from Alan Grimes, Dec 16 2013
a(10) from Keith F. Lynch, Jan 07 2014
Term 0 prepended by Robert G. Wilson v, Oct 08 2014
a(11)-a(15) (from Alan Grimes and Keith F. Lynch) added by Japheth Lim, Jan 30 2014

A196510 Smallest number greater than n that is palindromic in base 3 and base n.

Original entry on oeis.org

6643, 4, 10, 26, 28, 8, 121, 10, 121, 244, 13, 28, 1210, 16, 68, 784, 1733, 20, 1604, 242, 23, 2096, 100, 26, 937, 28, 203, 3280, 1952, 160, 1249, 68, 280, 1366, 14483, 608, 11293, 40, 82, 5948, 7102, 484, 2069, 644, 1222, 4372, 784, 100, 6452, 52
Offset: 2

Views

Author

Kausthub Gudipati, Oct 03 2011

Keywords

Crossrefs

Cf. A056749.

Programs

  • Maple
    ispal := proc(n,b)
            dgs := convert(n,base,b) ;
            for i from 1 to nops(dgs)/2 do
                    if op(i,dgs) <> op(-i,dgs) then
                            return false;
                    end if;
            end do;
            return true;
    end proc:
    A196510 := proc(n)
            for k from n+1 do
                    if ispal(k,n) and ispal(k,3) then
                            return k;
                    end if;
            end do:
    end proc:
    seq(A196510(n),n=2..30) ; # R. J. Mathar, Oct 13 2011
  • Mathematica
    pal3n[n_]:=Module[{k=n+1},While[IntegerDigits[k,3]!=Reverse[ IntegerDigits[ k,3]] || IntegerDigits[ k,n]!= Reverse[ IntegerDigits[k,n]],k++];k]; Array[ pal3n,60,2] (* Harvey P. Dale, Jan 16 2022 *)
  • Sage
    def A196510(n):
        is_palindrome = lambda x,b=10: x.digits(b) == (x.digits(b))[::-1]
        return next(k for k in IntegerRange(n+1, infinity) if is_palindrome(k,n) and is_palindrome(k,3))
    # D. S. McNeil, Oct 03 2011

A293925 Triangle read by rows T(n, k) is the least integer that is a palindrome in base n and k, with more than 1 digit in both bases, n >= 3 and 2 <= k < n.

Original entry on oeis.org

6643, 5, 10, 31, 26, 46, 7, 28, 21, 67, 85, 8, 85, 24, 92, 9, 121, 63, 18, 154, 121, 127, 10, 10, 109, 80, 40, 154, 33, 121, 55, 88, 55, 121, 121, 191, 255, 244, 255, 12, 166, 24, 36, 60, 232, 65, 13, 65, 26, 104, 78, 65, 91, 181, 277, 313, 28, 42, 98, 14, 235, 154, 70, 222, 84, 326
Offset: 3

Views

Author

Michel Marcus, Nov 16 2017

Keywords

Examples

			Triangle begins:
  6643,
     5,  10,
    31,  26, 46,
     7,  28, 21, 67,
    85,   8, 85, 24,  92,
     9, 121, 63, 18, 154, 121,
  ...
		

Crossrefs

Cf. A048268 (right diagonal), A056749 (1st column).

Programs

  • Mathematica
    palQ[n_Integer, base_Integer] := Block[{}, Reverse[idn = IntegerDigits[n, base]] == idn]; Table[ t[n, k], {n, 3, 13}, {k, 2, n - 1}] // Flatten (* Robert G. Wilson v, Nov 17 2017 *)
  • PARI
    isok(j, n, k) = my(dn=digits(j,n), dk=digits(j,k)); (Vecrev(dn)==dn) && (Vecrev(dk)==dk);
    T(n,k) = {j = max(n,k); while(! isok(j, n, k), j++); j;}
    tabl(nn) = for (n=3, nn, for (k=2, n-1, print1(T(n,k), ", ")); print);
Showing 1-3 of 3 results.