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-10 of 18 results. Next

A050810 From sequence A050782, the n's corresponding to the first occurrence of m (or 0 if not defined).

Original entry on oeis.org

0, 1, 106, 37, 53, 103, 42, 23, 29, 19, 0, 56, 21, 38, 18, 35, 17, 16, 14, 26, 0, 12, 96, 43, 913, 2081, 812, 703, 754, 24, 0, 165, 726, 64, 603, 15, 592, 27, 13, 479, 0, 261, 541, 277, 48, 1129, 437, 649, 524, 538, 0, 291, 406, 1359, 533, 93, 377, 466, 1052, 279, 0
Offset: 0

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 60; Clear[f]; f[max_] := f[max] = (r = Reap[For[n = 1, n <= max, n++, k = 1; If[IntegerQ[n/10], m = 0, While[k <= max && Reverse[id = IntegerDigits[k*n]] != id, k++]; m = k]; Sow[{n, m}]]][[2, 1]]; a[0] = 0; a[n_] := (s = Select[r, #[[2]] == n &, 1]; If[s == {}, 0, s[[1, 1]]]); Table[a[n], {n, 0, nmax}]); f[nmax]; f[max = 2 nmax]; While[Print["max = ", max]; f[max] != f[max/2], max = 2 max]; A050810 = f[max] (* Jean-François Alcover, Dec 31 2015 *)

A307278 Record values in A050782.

Original entry on oeis.org

0, 1, 21, 38, 66, 518, 845, 12345679, 172839506, 445372913, 1173450678278939, 111222333444555666777889
Offset: 1

Views

Author

N. J. A. Sloane, Apr 05 2019

Keywords

Crossrefs

Extensions

a(11)-a(12) from Giovanni Resta, Oct 15 2022

A307279 Indices of record values in A050782.

Original entry on oeis.org

0, 1, 12, 13, 32, 54, 71, 81, 162, 8081, 8181, 8991
Offset: 1

Views

Author

N. J. A. Sloane, Apr 05 2019

Keywords

Crossrefs

Extensions

a(11)-a(12) from Giovanni Resta, Oct 15 2022

A020485 Least positive palindromic multiple of n, or 0 if none exists.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 252, 494, 252, 525, 272, 272, 252, 171, 0, 252, 22, 161, 696, 525, 494, 999, 252, 232, 0, 434, 2112, 33, 272, 525, 252, 111, 494, 585, 0, 656, 252, 989, 44, 585, 414, 141, 2112, 343, 0, 969, 676, 212, 27972, 55, 616, 171, 232, 767, 0, 26962
Offset: 0

Views

Author

Keywords

Comments

Smallest positive palindrome divisible by n, or 0 if no such palindrome exists (which happens iff n is a multiple of 10). - N. J. A. Sloane, Apr 04 2019
The existence of palindromic multiples is a corollary of the theorem that an arithmetic progression with initial term c and a positive common difference d contains infinitely many palindromic numbers unless both of these numbers are multiples of 10. - M. Harminc (harminc(AT)duro.science.upjs.sk), Jul 14 2000

Crossrefs

Formula

a(n) = n*A050782(n). - Michel Marcus, Jan 22 2019

Extensions

a(0)=0 added by N. J. A. Sloane, Apr 04 2019

A061816 Obtain m by omitting trailing zeros from n (cf. A004151); a(n) = smallest multiple k*m which is a palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 252, 494, 252, 525, 272, 272, 252, 171, 2, 252, 22, 161, 696, 525, 494, 999, 252, 232, 3, 434, 2112, 33, 272, 525, 252, 111, 494, 585, 4, 656, 252, 989, 44, 585, 414, 141, 2112, 343, 5, 969, 676, 212, 27972, 55, 616, 171, 232
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) = 3. For n = m = 12 the smallest palindromic multiple is 21*m = 252, so a(12) = 252.
		

Crossrefs

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

Programs

  • ARIBAS
    stop := 200000; 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(mp," "); else write(-1," "); end; end;

A062279 Smallest multiple k*n of n which 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, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 60, 494, 70, 30, 80, 272, 90, 171, 20, 252, 22, 161, 600, 50, 494, 999, 252, 232, 30, 434, 800, 33, 272, 70, 252, 111, 494, 585, 40, 656, 252, 989, 44, 90, 414, 141, 2112, 343, 50, 969, 676, 212, 9990, 55, 616, 171, 232, 767
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(13) = 494 is the smallest multiple of 13 which is a palindrome.
		

Crossrefs

Cf. A050782, A062293. Values of k are given in A061674.
Cf. A141709.

Programs

  • ARIBAS
    : maxarg := 60; stop := 200000; for n := 0 to maxarg 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(n*k," "); else write(-1," "); end; end;
    
  • Haskell
    a062279 0 = 0
    a062279 n = until ((== 1) . a136522 . a004151) (+ n) n
    -- Reinhard Zumkeller, May 06 2013

Formula

A136522(A004151(a(n))) = 1. - Reinhard Zumkeller, May 06 2013

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org) and Klaus Brockhaus, Jun 18 2001

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

A141707 Least k>0 such that (2n-1)k is palindromic in base 2.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 5, 1, 1, 27, 1, 89, 13, 1, 49, 1, 1, 13, 69, 5, 25, 3, 1, 103, 29, 1, 63, 3, 9, 103, 7, 1, 1, 19, 37, 147, 1, 13, 3, 19, 11, 45, 1, 37, 23, 3, 1, 27, 61, 1, 233, 47, 13, 1, 21, 23, 59, 525, 5, 1, 93, 23, 41, 1, 1, 49, 27, 13, 187, 87, 269, 15, 111, 13, 29, 7, 1, 13, 3
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 only for odd numbers 2n-1 the k-values such that k(2n-1) is palindromic in base 2. Obviously they are necessarily also odd.
a(A044051(n)) = 1. - Reinhard Zumkeller, Apr 20 2015

Examples

			a(1..5)=1 since 1,3,5,7,9 are already palindromic in base 2.
a(6)=3 since 2*6-1=11 and 2*11=22 are not palindromic in base 2, but 3*11=33 is.
		

Crossrefs

Programs

  • Haskell
    a141707 n = head [k | k <- [1, 3 ..], a178225 (k * (2 * n - 1)) == 1]
    -- Reinhard Zumkeller, Apr 20 2015
    
  • Mathematica
    lkp[n_]:=Module[{k=1,n2=2n-1},While[IntegerDigits[k*n2,2]!= Reverse[ IntegerDigits[ k*n2,2]],k++];k]; Array[lkp,80] (* Harvey P. Dale, Mar 19 2016 *)
  • PARI
    A141707(n,L=10^9)={ n=2*n-1; forstep(k=1,L,2, binary(k*n)-vecextract(binary(k*n),"-1..1") || return(k))}
    
  • 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//m
    print([a(n) for n in range(1, 80)]) # Michael S. Branicky, Mar 20 2022

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

A190301 Smallest number h such that n*h is a repunit (A002275), or 0 if no such h exists.

Original entry on oeis.org

1, 0, 37, 0, 0, 0, 15873, 0, 12345679, 0, 1, 0, 8547, 0, 0, 0, 65359477124183, 0, 5847953216374269, 0, 5291, 0, 48309178743961352657, 0, 0, 0, 4115226337448559670781893, 0, 38314176245210727969348659, 0, 3584229390681, 0, 3367, 0, 0, 0, 3, 0, 2849, 0, 271, 0
Offset: 1

Views

Author

Jaroslav Krizek, May 07 2011

Keywords

Examples

			For n = 7: a(7) = 15873 because 7 * 15873 = 111111. Repunit 111111 is the smallest repunit with prime factor 7.
		

Crossrefs

Cf. A084681 (repunit length), A216479 (the repunit).
Cf. A050782 = the smallest number h such that n*h is palindromic number, A083117 = the smallest number h such that n*h is repdigit number.

Programs

  • Mathematica
    Table[If[GCD[n, 10] > 1, 0, k = MultiplicativeOrder[10, 9*n]; (10^k - 1)/(9*n)], {n, 100}] (* T. D. Noe, May 08 2011 *)
  • PARI
    a(n)=if(gcd(n,10)>1, 0, (10^znorder(Mod(10,9*n))-1)/9/n) \\ Charles R Greathouse IV, Aug 28 2016
Showing 1-10 of 18 results. Next