login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A077528 a(n) = smallest nontrivial (>1) palindrome == 1 (mod n). 2
3, 4, 5, 6, 7, 8, 9, 55, 11, 111, 121, 66, 99, 121, 33, 171, 55, 77, 101, 22, 111, 323, 121, 101, 131, 55, 141, 88, 121, 373, 33, 232, 171, 141, 181, 1111, 77, 313, 121, 575, 505, 44, 353, 181, 323, 424, 1441, 99, 101, 868, 313, 10601, 55, 111, 393, 343, 929, 414 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

LINKS

Robert Israel, Table of n, a(n) for n = 2..10000

MAPLE

f:= proc(n) local d, S, j, q, x0, t, r, x;

    for d from 2 do

      S[ceil(d/2)+1]:= {0}:

      for j from ceil(d/2) to 1 by -1 do

        if j = (d+1)/2 then q:= 10^(j-1)

        else q:= 10^(j-1)+10^(d-j)

        fi;

        if j = 1 then x0:= 1 else x0:= 0 fi;

        S[j]:= {seq(seq(x*q+s mod n, x=x0..9), s=S[j+1])};

      od;

      if member(1, S[1]) then

         t:= 1; r:= 0;

         for j from 1 to ceil(d/2) do

           if j = (d+1)/2 then q:= 10^(j-1) else q:= 10^(j-1)+10^(d-j) fi;

           if j = 1 then x0:= 1 else x0:= 0 fi;

           for x from x0 to 9 do

             if member(t - x*q mod n, S[j+1]) then

                r:= r + x*q;

                t:= t - x*q mod n;

                break

             fi

           od;

        od;

        return r

      fi

   od

end proc:

$3..9, seq(f(n), n=9..100); # Robert Israel, Dec 17 2019

CROSSREFS

Cf. A002113.

Sequence in context: A051415 A037351 A293727 * A329254 A183296 A138928

Adjacent sequences:  A077525 A077526 A077527 * A077529 A077530 A077531

KEYWORD

base,nonn,look

AUTHOR

Amarnath Murthy, Nov 08 2002

EXTENSIONS

Corrected and extended by Ray Chandler, Aug 20 2003

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 17 22:33 EST 2022. Contains 350410 sequences. (Running on oeis4.)