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

A062293 Smallest multiple k*n of n which has even digits and is a palindrome or becomes a palindrome when 0's are added on the left (e.g., 10 becomes 010, which is a palindrome).

Original entry on oeis.org

0, 2, 2, 6, 4, 20, 6, 686, 8, 666, 20, 22, 60, 2002, 686, 60, 80, 646, 666, 646, 20, 6006, 22, 828, 600, 200, 2002, 8886888, 868, 464, 60, 868, 800, 66, 646, 6860, 828, 222, 646, 6006, 40, 22222, 6006, 68886, 44, 6660, 828, 282, 4224, 686, 200, 42024, 4004, 424, 8886888, 220, 8008, 68286, 464, 68086, 60
Offset: 0

Views

Author

Amarnath Murthy, Jun 18 2001

Keywords

Comments

Every integer n has a multiple of the form 99...9900...00. To see that n has a multiple that's a palindrome (allowing 0's on the left) with even digits, let 9n divide 99...9900...00; then n divides 22...2200...00. - Dean Hickerson, Jun 29 2001

Examples

			a(7) = 686 as 686 = 98*7 is the smallest palindrome multiple of 7 with even digits.
		

Crossrefs

Cf. A062279. Values of k are given in A061797.

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 60 do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := not all_even(m) or m <> int_reverse(m) then inc(k); end; end; if k < stop then write(n*k," "); else write(-1," "); end; end;
    
  • Haskell
    a062293 0 = 0
    a062293 n = head [x | x <- map (* n) [1..],
                     all (`elem` "02468") $ show x, a136522 (a004151 x) == 1]
    -- Reinhard Zumkeller, Feb 01 2012

Extensions

Corrected and extended by Klaus Brockhaus, Jun 21 2001

A141709 Least positive multiple of n which is palindromic in base 2, allowing for leading zeros (or: ignoring trailing zeros).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 33, 12, 65, 14, 15, 16, 17, 18, 513, 20, 21, 66, 2047, 24, 325, 130, 27, 28, 1421, 30, 31, 32, 33, 34, 455, 36, 2553, 1026, 195, 40, 1025, 42, 129, 132, 45, 4094, 4841, 48, 1421, 650, 51, 260, 3339, 54, 165, 56, 513, 2842, 6077, 60, 427, 62
Offset: 1

Views

Author

M. F. Hasler, Jul 17 2008

Keywords

Comments

Even numbers cannot be palindromic in base 2, unless leading zeros are considered (or, equivalently, resp. more precisely, trailing zeros are discarded). This is done in this version of A141708, which therefore does not need to be restricted to odd n as it has been done for A141707 and A141708.

Crossrefs

Programs

  • Haskell
    a141709 n = until ((== 1) . a178225 . a000265) (+ n) n
    -- Reinhard Zumkeller, Nov 06 2012
  • Mathematica
    notpalbinQ[i_]:=Module[{id=IntegerDigits[i,2]},While[Last[id]==0,id=Most[id]];id!= Reverse[id]]; lm[n_]:=Module[{k=1},While[notpalbinQ[k n],k++];k n]; Array[lm,70] (* Harvey P. Dale, Dec 28 2011 *)
  • PARI
    A141709(n)=forstep(k=n,10^9,n,vecextract(t=binary(k>>valuation(k,2)),"-1..1")-t || return(k))
    

Formula

A178225(A000265(a(n))) = 1. - Reinhard Zumkeller, Nov 06 2012

A061674 Smallest k such that k*n is a palindrome or becomes a palindrome when 0's are added on the left.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 38, 5, 2, 5, 16, 5, 9, 1, 12, 1, 7, 25, 2, 19, 37, 9, 8, 1, 14, 25, 1, 8, 2, 7, 3, 13, 15, 1, 16, 6, 23, 1, 2, 9, 3, 44, 7, 1, 19, 13, 4, 185, 1, 11, 3, 4, 13, 1, 442, 7, 4, 33, 9, 1, 11, 4, 6, 1, 845, 35, 4, 3, 4, 65, 1, 11, 6, 1, 12345679, 8, 9, 3
Offset: 0

Views

Author

Amarnath Murthy, Jun 17 2001

Keywords

Comments

Every positive integer is a factor of a palindrome, unless it is a multiple of 10 (D. G. Radcliffe, see Links).

Examples

			a(12) = 5 since 5*12 = 60 (i.e. 060) is a palindrome.
		

Crossrefs

Cf. A050782, A062293. Values of k*n are given in A062279.

Programs

  • ARIBAS
    stop := 50000000; for n := 0 to 100 do k := 1; test := true; while test and k < stop do m := omit_trailzeros(n*k); if test := m <> int_reverse(m) then inc(k); end; end; if k < stop then write(k," "); else write(-1," "); end; end;
    
  • Haskell
    a061674 n = until ((== 1) . a136522 . a004151 . (* n)) (+ 1) 1
    -- Reinhard Zumkeller, Jul 20 2012
  • Mathematica
    rz[n_]:=Module[{idn=IntegerDigits[n]},While[Last[idn]==0,idn=Most[idn]];idn]; k[n_]:=Module[{k=1,p},p=k*n;While[rz[p]!=Reverse[rz[p]],k++;p=k*n];k]; Join[ {1},Array[k,90]] (* Harvey P. Dale, Mar 06 2013 *)

A141708 Least positive multiple of 2n-1 which is palindromic in base 2.

Original entry on oeis.org

1, 3, 5, 7, 9, 33, 65, 15, 17, 513, 21, 2047, 325, 27, 1421, 31, 33, 455, 2553, 195, 1025, 129, 45, 4841, 1421, 51, 3339, 165, 513, 6077, 427, 63, 65, 1273, 2553, 10437, 73, 975, 231, 1501, 891, 3735, 85, 3219, 2047, 273, 93, 2565, 5917, 99, 23533, 4841, 1365, 107
Offset: 1

Views

Author

M. F. Hasler, Jul 17 2008

Keywords

Comments

Even numbers cannot be palindromic in base 2 (unless leading zeros are considered), that's why we search for odd numbers 2n-1 their smallest multiple k(2n-1) which is palindromic in base 2. Obviously this must always be odd.

Crossrefs

Programs

  • Haskell
    a141708 n = a141707 n * (2 * n - 1) -- Reinhard Zumkeller, Apr 20 2015
    
  • Mathematica
    pal2[n_]:=Module[{k=1},While[IntegerDigits[k n,2] != Reverse[ IntegerDigits[ k n,2]],k++];k n]; pal2/@Range[1,121,2] (* Harvey P. Dale, Feb 29 2012 *)
  • PARI
    A141708(n,L=10^9)={ n=2*n-1; forstep(k=1,L,2, binary(k*n)-vecextract(binary(k*n),"-1..1") || return(k*n))}
    
  • Python
    def binpal(n): b = bin(n)[2:]; return b == b[::-1]
    def a(n):
        m = 2*n - 1
        km = m
        while not binpal(km): km += m
        return km
    print([a(n) for n in range(1, 55)]) # Michael S. Branicky, Mar 20 2022

Formula

a(n) = (2n-1)*A141707(n).
Showing 1-4 of 4 results.