login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A317636 Minimum number of consecutive positive integers starting with 1 that must be concatenated in descending order so that n divides the concatenation, or zero if n divides no such concatenation. 0

%I

%S 1,0,2,0,0,0,2,0,8,0,14,0,15,0,0,0,9,0,5,0,2,0,16,0,0,0,26,0,4,0,25,0,

%T 14,0,0,0,21,0,15,0,40,0,67,0,0,0,78,0,54,0,9,0,66,0,0,0,5,0,25,0,111,

%U 0,44,0,0,0,161,0,18,0,49,0,30,0,0,0,73,0,15,0,27,0,27,0,0,0,41,0,20,0,54,0,47,0,0,0,63,0,18,0,98,0,102,0,0,0,3,0,99,0,21

%N Minimum number of consecutive positive integers starting with 1 that must be concatenated in descending order so that n divides the concatenation, or zero if n divides no such concatenation.

%C a(n) = 0 if n is even or a multiple of 5. Empirical observation: a(n) > 0 for all other n values.

%e For n=19 the a(19)=5 since 54321 = 19*2859, while 4321, 321, 21 and 1 are not multiples of 19.

%t Table[If[GCD[n, 10] == 1, Block[{k = 1}, While[Mod[FromDigits@ Flatten@ Map[IntegerDigits, Range[k, 1, -1]], n] != 0, k++]; k],0], {n, 111}] (* _Michael De Vlieger_, Aug 02 2018 *)

%o (Pascal)

%o program skaitlirinda2;

%o var i : longint;

%o function Atrodi(n : longint) : int64;

%o var sk, koefa, naksk, rez : int64;

%o begin

%o sk := 1;

%o naksk := 10;

%o koefa := naksk mod n;

%o rez := sk mod n;

%o while rez>0 do

%o begin

%o Inc(sk);

%o rez := (sk * koefa + rez) mod n;

%o if sk=naksk then naksk := naksk * 10;

%o koefa := (koefa*naksk) mod n;

%o end;

%o Atrodi := sk;

%o end;

%o begin

%o for i:=1 to 10000 do

%o begin

%o if (i mod 2)*(i mod 5) > 0 then writeln(i,' ',Atrodi(i)) else writeln(i,' 0');

%o end;

%o end.

%o (PARI) a(n) = {if ((n%2) && (n%5), my(s = ""); for (k=1, oo, s = concat(Str(k), s); if (!(eval(s) % n), return (k)););); return (0);} \\ _Michel Marcus_, Aug 02 2018

%Y Cf. A088886, A075002.

%K nonn,base

%O 1,3

%A _Martins Opmanis_, Aug 02 2018

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 September 19 15:43 EDT 2020. Contains 337178 sequences. (Running on oeis4.)