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.

A050782 Smallest positive multiplier m such that m*n is palindromic (or zero if no such m exists).

Original entry on oeis.org

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

Views

Author

Patrick De Geest, Oct 15 1999

Keywords

Comments

Multiples of 81 require the largest multipliers.
From Jon E. Schoenfield, Jan 15 2015: (Start)
In general, a(n) is large when n is a multiple of 81. E.g., for n in [1..10000], of the 9000 terms where a(n)>0, 111 are at indices n that are multiples of 81; of the remaining 8889 terms,
755 are in [1..9],
1760 are in [10..99],
3439 are in [100..999],
2180 are in [1000..9999],
708 are in [10000..99999],
36 are in [100000..999999],
6 are in [1000000..9999999],
2 are in [10000000..99999999],
2 are in [100000000..999999999],
and 1 (the largest) is a(8891) = 8546948927,
but the smallest of the 111 terms whose indices are multiples of 81 is a(2997)=333667. (End)
a(n) = 0 iff 10 | n. a(n) = 1 iff n is a palindrome. If k | a(n) then a(k*n) = a(n)/k. - Robert Israel, Jan 15 2015

Examples

			E.g., a(81) -> 81 * 12345679 = 999999999 and a palindrome.
		

Crossrefs

Programs

  • Maple
    digrev:= proc(n) local L,d,i;
      L:= convert(n,base,10);
      d:= nops(L);
      add(L[i]*10^(d-i),i=1..d);
    end proc:
    f:= proc(n)
    local d,d2,x,t,y;
    if n mod 10 = 0 then return 0 fi;
    if n < 10 then return 1 fi;
    for d from 2 do
      if d::even then
        d2:= d/2;
        for x from 10^(d2-1) to 10^d2-1 do
           t:= x*10^d2 + digrev(x);
           if t mod n = 0 then return(t/n) fi;
        od
      else
        d2:= (d-1)/2;
        for x from 10^(d2-1) to 10^d2-1 do
          for y from 0 to 9 do
            t:= x*10^(d2+1)+y*10^d2+digrev(x);
            if t mod n = 0 then return(t/n) fi;
          od
        od
      fi
    od;
    end proc:
    seq(f(n),n=0 .. 100); # Robert Israel, Jan 15 2015
  • Mathematica
    t={0}; Do[i=1; If[IntegerQ[n/10],y=0,While[Reverse[x=IntegerDigits[i*n]]!=x,i++]; y=i]; AppendTo[t,y],{n,80}]; t (* Jayanta Basu, Jun 01 2013 *)
  • 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 # Chai Wah Wu, Dec 30 2014

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

A112725 Smallest positive palindromic multiple of 3^n.

Original entry on oeis.org

1, 3, 9, 999, 999999999, 29799999792, 39789998793, 39989598993, 68899199886, 68899199886, 68899199886, 68899199886, 68899199886, 2699657569962, 146189959981641, 191388777883191, 191388777883191, 18641845754814681
Offset: 0

Views

Author

Farideh Firoozbakht, Nov 12 2005

Keywords

Comments

a(0)=1; a(1)=3 and it is easily shown that for n>1, 10^3^(n-2)-1 is a palindromic multiple of 3^n(see comments line of A062567). So for each n, a(n) exists and for n>1, a(n)<=10^3^(n-2)-1. This sequence is a subsequence of A020485(a(n)=A020485(3^n)) and for all n, A062567(3^n)<=a(n) because for all n, A062567(n)<= A020485(n). Jud McCranie conjectures that for n>1 A062567(3^n) =10^3^(n-2)-1, if his conjecture were true then from the above facts we conclude that for n>1 a(n)=10^3^(n-2)-1, but we see that for 4

Examples

			a(18)=18771463736417781 because 18771463736417781=3^18*48452429 is the smallest positive palindromic multiple of 3^18.
		

Crossrefs

Programs

  • Mathematica
    b[n_]:=(For[m=1, !FromDigits[Reverse[IntegerDigits[m*n]]]==m*n, m++ ]; m*n);Do[Print[b[3^n]], {n, 0, 18}]

A307278 Record values in A050782.

Original entry on oeis.org

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

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

Author

N. J. A. Sloane, Apr 05 2019

Keywords

Crossrefs

Extensions

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

A357195 a(n) is the smallest palindrome of the form k*(2*n+k-1)/2 where k is a positive integer.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 33, 11, 969, 222, 99, 66, 33, 242, 282, 424, 161, 66, 22, 212, 252, 646, 171, 55, 252, 414, 555, 525, 99, 33, 474, 1001, 111, 5005, 77, 484, 1111, 1881, 414, 808, 44, 606, 141, 404, 303, 99, 101, 555, 444, 333, 222, 55, 171, 484
Offset: 1

Author

Gleb Ivanov, Sep 17 2022

Keywords

Crossrefs

Programs

  • PARI
    ispal(p) = my(d=digits(p)); d==Vecrev(d);
    a(n) = my(k=1); while(!ispal(x=k*(2*n+k-1)/2), k++); x; \\ Michel Marcus, Sep 17 2022
  • Python
    pal10 = lambda n: str(n) == str(n)[::-1]
    def seq(n):
        k = 1
        while not pal10(k*(2*n+k-1)//2):k+=1
        return k*(2*n+k-1)//2
    print([seq(n) for n in range(1, 100)])
    
  • Python
    from itertools import count
    def A357195(n): return next(filter(lambda n:(s := str(n))[:(t:=len(s)+1>>1)]==s[:-t-1:-1],(k*((n<<1)+k-1)>>1 for k in count(1)))) # Chai Wah Wu, Oct 29 2022
    
Showing 1-6 of 6 results.