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.

Previous Showing 11-18 of 18 results.

A347402 Lexicographically earliest sequence of distinct terms > 0 such that the product n * a(n) forms a palindrome in base 10.

Original entry on oeis.org

1, 2, 3, 11, 101, 37, 23, 29, 19, 0, 4, 21, 38, 18, 35, 17, 16, 14, 9, 0, 12, 22, 7, 88, 209, 26, 703, 31, 8, 0, 28, 66, 47, 121, 15, 77, 6, 13, 154, 0, 187, 143, 277, 48, 1129, 99, 33, 44, 239, 0, 291, 406, 132, 518, 91, 377, 303, 364, 219, 0, 442, 386, 287, 333, 777
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Aug 30 2021

Keywords

Comments

When n ends with a zero, we have a(n) = 0 in the sequence.

Examples

			For n = 7 we have a(7) = 23 and 7 * 23 = 161 is a palindrome in base 10; indeed, at n=7, multiples 7 * 1 = 7 and 7 * 11 = 77 are palindromes but 1 and 11 have already appeared in the sequence. The next palindrome multiple is 7 * 23 = 161 and 23 has not yet appeared so a(7) = 23;
for n = 8 we have a(8) = 29 and 8 * 29 = 232 is a palindrome in base 10;
for n = 9 we have a(9) = 19 and 9 * 19 = 171 is a palindrome in base 10;
for n = 10 we have a(10) = 0 and 10 * 0 = 0 is a palindrome in base 10;
for n = 11 we have a(11) = 4 and 11 * 4 = 44 is a palindrome in base 10; etc.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=If[Mod[n,10]==0,0,(k=1;While[!PalindromeQ[n*k]||MemberQ[Array[a,n-1],k],k++];k)];Array[a,65] (* Giorgos Kalogeropoulos, May 05 2022 *)
  • Python
    def ispal(n): s = str(n); return s == s[::-1]
    def aupton(terms):
        alst, seen = [1], {1}
        for n in range(2, terms+1):
            if n%10 == 0: alst.append(0); continue
            an = 1
            while an in seen or not ispal(n * an): an += 1
            alst.append(an); seen.add(an)
        return alst
    print(aupton(100)) # Michael S. Branicky, Aug 30 2021

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 *)

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;

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).

A061797 Smallest k such that k*n has even digits and is a palindrome or becomes a palindrome when 0's are added on the left.

Original entry on oeis.org

1, 2, 1, 2, 1, 4, 1, 98, 1, 74, 2, 2, 5, 154, 49, 4, 5, 38, 37, 34, 1, 286, 1, 36, 25, 8, 77, 329144, 31, 16, 2, 28, 25, 2, 19, 196, 23, 6, 17, 154, 1, 542, 143, 1602, 1, 148, 18, 6, 88, 14, 4, 824, 77, 8, 164572, 4, 143, 1198, 8, 1154, 1, 1126, 14, 962, 66, 308, 1, 998
Offset: 0

Views

Author

Amarnath Murthy, Jun 17 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
a(81), if it exists, is greater than 5 million. - Harvey P. Dale, Dec 19 2021
A palindrome is divisible by 81 iff its sum of digits is divisible by 81. Thus a(81) = 688888888628888888886 / 81 = 8504801097146776406, as 688888888868888888886 is the least palindrome with even digits and sum of digits 162. - Robert Israel, Apr 17 2025

Examples

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

Crossrefs

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

Programs

  • ARIBAS
    stop := 500000; for n := 0 to 75 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(k," "); else write(-1," "); end; end;
    
  • Haskell
    a061797 0 = 1
    a061797 n = head [k | k <- [1..], let x = k * n,
                     all (`elem` "02468") $ show x, a136522 (a004151 x) == 1]
    -- Reinhard Zumkeller, Feb 01 2012
  • Maple
    epali:= proc(x,d) local L,i;
      L:= convert(x,base,5);
      if d::even then 2*add(L[-i]*(10^(i-1)+10^(d-i)),i=1..d/2)
      else 2*(L[-(d+1)/2]*10^((d-1)/2) + add(L[-i]*(10^(i-1)+10^(d-i)),i=1..(d-1)/2))
      fi
    end proc;
    Agenda:= {$0..80}:
    count:= 0:
    for d from 1 while count < 81 do
      E[d]:= [seq(epali(i,d),i=5^(ceil(d/2)-1) .. 5^ceil(d/2)-1)];
      P:= sort([op(E[d]),seq(op(E[k] *~ 10^(d-k)), k=1..d-1)]);
      for x in P do
        Q:= select(t -> x mod t = 0, Agenda);
        if Q <> {} then
          count:= count + nops(Q);
          for q in Q do R[q]:= x/q od;
          Agenda:= Agenda minus Q;
        fi;
      od;
    od:
    seq(R[i],i=0..80); # Robert Israel, Apr 18 2025
  • Mathematica
    a[n_] := For[k = 1, True, k++, id = IntegerDigits[k*n]; If[AllTrue[id, EvenQ], rid = Reverse[id]; If[id == rid || (id //. {d__, 0} :> {d}) == (rid //. {0, d__} :> {d}), Return[k]]]]; a[0] = 1; Table[a[n], {n, 0, 70}] (* Jean-François Alcover, Apr 01 2016 *)
    skpal[n_]:=Module[{k=1},While[Count[IntegerDigits[k n],?OddQ]>0 || (!PalindromeQ[(k n)/10^IntegerExponent[n k]]),k++];k]; Array[skpal,70,0] (* _Harvey P. Dale, Dec 19 2021 *)

Extensions

More terms from Klaus Brockhaus, Jun 27 2001

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

A110796 A110795(n)/n!: least k such that n!*k divided by the largest power of 10 (that divides it) is a palindrome.

Original entry on oeis.org

1, 1, 1, 25, 5, 35, 5, 12, 1925892, 1925892, 7355294, 1022374, 7739948, 46933342, 64577311, 110312964, 11444462365, 7289765663, 383671877, 1918359385, 1624255452287, 41341811169355, 32828553689432, 10206197436475026, 17430202994739058
Offset: 1

Views

Author

Amarnath Murthy, Aug 13 2005

Keywords

Crossrefs

Extensions

Corrected and extended by R. J. Mathar, Aug 17 2007
a(11)-a(13) from Donovan Johnson, Mar 26 2010
a(14)-a(16) from Donovan Johnson, Feb 01 2011
a(17)-a(25) from Max Alekseyev, Feb 10 2024
Previous Showing 11-18 of 18 results.