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

A061906 Obtain m by omitting trailing zeros from n; a(n) = smallest k such that k*m is a palindrome.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21, 38, 18, 35, 17, 16, 14, 9, 1, 12, 1, 7, 29, 21, 19, 37, 9, 8, 1, 14, 66, 1, 8, 15, 7, 3, 13, 15, 1, 16, 6, 23, 1, 13, 9, 3, 44, 7, 1, 19, 13, 4, 518, 1, 11, 3, 4, 13, 1, 442, 7, 4, 33, 9, 1, 11, 4, 6, 1, 845, 88, 4, 3, 7, 287, 1, 11, 6, 1, 12345679, 8
Offset: 0

Views

Author

Klaus Brockhaus, Jun 25 2001

Keywords

Comments

Every positive integer is a factor of a palindrome, unless it is a multiple of 10 (D. G. Radcliffe, see Links).
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

			For n = 30 we have m = 3, 1*m = 3 is a palindrome, so a(30) = 1. For n = m = 12 the smallest palindromic multiple is 21*m = 252, so a(12) = 21.
		

Crossrefs

Cf. A050782, A062293, A061915, A061916, A061816. Values of k*m are given in A061906.

Programs

  • ARIBAS
    stop := 20000000; for n := 0 to maxarg do k := 1; test := true; while test and k < stop do mp := omit_trailzeros(n)*k; if test := mp <> int_reverse(mp) then inc(k); end; end; if k < stop then write(k," "); else write(-1," "); end; end;
    
  • Mathematica
    skp[n_]:=Module[{m=n/10^IntegerExponent[n,10],k=1},While[!PalindromeQ[k*m],k++];k]; Array[ skp,90,0] (* Harvey P. Dale, Jul 04 2024 *)
  • Python
    from _future_ import division
    def palgen(l, b=10): # generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1, l+1):
                n = b**(x-1)
                n2 = n*b
                for y in range(n, n2):
                    k, m = y//b, 0
                    while k >= b:
                        k, r = divmod(k, b)
                        m = b*m + r
                    yield y*n + b*m + k
                for y in range(n, n2):
                    k, m = y, 0
                    while k >= b:
                        k, r = divmod(k, b)
                        m = b*m + r
                    yield y*n2 + b*m + k
    def A050782(n, l=10):
        if n % 10:
            x = palgen(l)
            next(x)  # replace with x.next() in Python 2.x
            for i in x:
                q, r = divmod(i, n)
                if not r:
                    return q
            else:
                return 'search limit reached.'
        else:
            return 0
    def A061906(n, l=10):
        return A050782(int(str(n).rstrip('0')),l) if n > 0 else 1
    # Chai Wah Wu, Dec 30 2014

A061915 Obtain m by omitting trailing zeros from n; a(n) = smallest multiple k*m which is a palindrome with even digits, or -1 if no such multiple exists.

Original entry on oeis.org

0, 2, 2, 6, 4, -1, 6, 686, 8, 666, 2, 22, 444, 2002, 686, -1, 464, 646, 666, 646, 2, 6006, 22, 828, 888, -1, 2002, 8886888, 868, 464, 6, 868, 4224, 66, 646, -1, 828, 222, 646, 6006, 4, 22222, 6006, 68886, 44, -1, 828, 282, 4224, 686, -1, 42024, 4004, 424, 8886888, -1, 8008, 68286, 464, 68086, 6
Offset: 0

Views

Author

Klaus Brockhaus, Jun 25 2001

Keywords

Comments

a(n) = -1 if and only if m ends with the digit 5.

Examples

			For n = 30 we have m = 3; 3*2 = 6 is a palindrome with even digits, so a(30) = 6.
		

Crossrefs

Cf. A050782, A062293, A061816, A061906. Values of k are given in A061916.

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 60 do k := 1; test := true; while test and k < stop do mp := omit_trailzeros(n)*k; if test := not all_even(mp) or mp <> int_reverse(mp) then inc(k); end; end; if k < stop then write(mp," "); else write(-1," "); end; end;

A061916 Obtain m by omitting trailing zeros from n; a(n) = smallest k such that k*m is a palindrome with even digits, or -1 if no such multiple exists.

Original entry on oeis.org

1, 2, 1, 2, 1, -1, 1, 98, 1, 74, 2, 2, 37, 154, 49, -1, 29, 38, 37, 34, 1, 286, 1, 36, 37, -1, 77, 329144, 31, 16, 2, 28, 132, 2, 19, -1, 23, 6, 17, 154, 1, 542, 143, 1602, 1, -1, 18, 6, 88, 14, -1, 824, 77, 8, 164572, -1, 143, 1198, 8, 1154, 1, 1126, 14, 962, 66, -1, 1, 998, 121, 12, 98, 65984, 592, 274, 3, -1, 529, 26, 77, 358
Offset: 0

Views

Author

Klaus Brockhaus, Jun 25 2001

Keywords

Comments

a(n) = -1 if and only if m ends with the digit 5.

Examples

			For n = 30 we have m = 3; 3*2 = 6 is a palindrome with even digits, so a(30) = 2.
		

Crossrefs

Cf. A050782, A062293, A061816, A061906. Values of k*m are given in A061915.

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 80 do k := 1; test := true; while test and k < stop do mp := omit_trailzeros(n)*k; if test := not all_even(mp) or mp <> int_reverse(mp) then inc(k); end; end; if k < stop then write(k," "); else write(-1," "); end; end;

A109924 Least palindromic multiple of concatenation 123...n.

Original entry on oeis.org

1, 252, 8118, 28382, 536797635, 6180330816, 85770307758, 2889123219882, 535841353148535, 135444949494445310, 1522312136776312132251, 2111913320628668260233191112, 6690072525779588859775252700966, 202511080654222947749222456080115202, 538412926804799527505725997408629214835
Offset: 1

Views

Author

Amarnath Murthy, Jul 16 2005

Keywords

Comments

When n is a multiple of 10, any multiple of 123...n has trailing zeros, therefore it cannot be palindromic. The terms listed as a(10k) are therefore the least palindromic multiples with "invisible leading zeros allowed", or equivalently, trailing zeros ignored.
Subsequence of A020485.

Examples

			123*j is not palindromic for j < 66 and 123*66 = 8118, hence a(3) = 8118.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, p = FromDigits[ Flatten[ IntegerDigits /@ Range[n]]]}, While[ If[ Mod[p, 10] == 0, p/=10]; While[k*p != FromDigits[ Reverse[ IntegerDigits[k*p]]], k++ ]]; k*p]; Table[ f[n], {n, 11}] (* Robert G. Wilson v, Jul 19 2005 *)
  • PARI
    intreverse(n) = local(d, rev); rev=0; while(n>0, d=divrem(n, 10); n=d[1]; rev=10*rev+d[2]);
    {s="";for(n=1,10,s=concat(s,n);k=eval(s);if(n%10==0,m=0, j=1;while((m=k*j)!=intreverse(m),j++));print1(m,","))}
    
  • PARI
    A109924(n)={ n=eval(concat(vector(n,i,Str(i))));forstep(i=n/10^valuation(n,10),9e99,n/10^valuation(n,10), (m=Vec(Str(i)))==vecextract(m,"-1..1")&return(i*10^valuation(n,10)))} \\ M. F. Hasler, Jun 19 2011

Extensions

Edited and extended (a(5) to a(10)) by Klaus Brockhaus, Jul 19 2005
a(10)-a(11) from Robert G. Wilson v, Jul 19 2005
Definition of a(10k) clarified by M. F. Hasler, Jun 19 2011.
a(12)-a(14) from Giovanni Resta, Sep 22 2019
a(15) from Giovanni Resta, Sep 24 2019

A083960 Smallest palindromic multiple of (n with trailing 0's omitted, A004151) using only nonzero digits of n; all digits must appear; or 0 if no such number exists.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 2112, 131131, 414414, 5115, 61616, 7111117, 8118, 99199, 2, 1121211, 22, 32223, 4224, 525, 262262, 22222722222, 828828, 922229, 3, 133331, 23232, 33, 4333334, 535535, 6336, 333777333, 88388, 393393, 4
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 20 2003

Keywords

Comments

If one generates all palindromes using all the digits of n with k digits where k starts with the number of digits of n and increases k until one finds a multiple of n, one finds such palindromic multiples much faster than looking for palindromes among the multiples of n. - W. Edwin Clark

Crossrefs

Extensions

More terms from W. Edwin Clark, May 24 2003
Corrected by David Wasserman, Dec 06 2004

A061817 Multiples of 9 containing only odd digits.

Original entry on oeis.org

9, 99, 117, 135, 153, 171, 315, 333, 351, 513, 531, 711, 999, 1179, 1197, 1359, 1377, 1395, 1539, 1557, 1575, 1593, 1719, 1737, 1755, 1773, 1791, 1917, 1935, 1953, 1971, 3159, 3177, 3195, 3339, 3357, 3375, 3393, 3519, 3537, 3555, 3573, 3591, 3717, 3735
Offset: 1

Views

Author

Amarnath Murthy, May 28 2001

Keywords

Examples

			117 = 9*13 is a term.
		

Crossrefs

Subsequence of A014261.

Programs

  • Mathematica
    Select[9Range[500],And@@OddQ[IntegerDigits[#]]&] (* Harvey P. Dale, May 30 2013 *)
  • PARI
    is(n)=n%9==0 && #setintersect(Set(digits(n)), [0,2,4,6,8])==0 \\ Charles R Greathouse IV, Feb 15 2017

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), May 30 2001
Showing 1-6 of 6 results.