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-2 of 2 results.

A088885 Minimum number of consecutive previous nonnegative integers to n that must be concatenated together in descending order such that n divides the concatenated term, or zero if n divides no such concatenation.

Original entry on oeis.org

1, 2, 2, 2, 5, 2, 0, 6, 8, 10, 0, 6, 0, 8, 5, 4, 2, 8, 3, 0, 0, 10, 0, 12, 0, 0, 26, 16, 0, 20, 0, 20, 11, 2, 20, 8, 0, 0, 0, 20, 40, 20, 4, 32, 35, 46, 38, 20, 40, 0, 2, 0, 0, 26, 10, 20, 3, 0, 0, 20, 55, 0, 0, 52, 0, 32, 0, 44, 17, 20, 0, 36, 26, 0, 50, 52, 21, 38, 67, 20, 0, 0, 9, 20, 0, 4, 59
Offset: 1

Views

Author

Chuck Seggelin, Oct 29 2003

Keywords

Comments

Concatenation always begins at n-1 and cannot go further than n-n (zero). Hence the maximum value of a(n) is n.

Examples

			a(8) = 6 because will divide the number formed by concatenating the 6 integers prior to 8 in descending order (i.e. 765432). 8 will not divide any lesser number of previous terms concatenated together beginning with 7 (i.e. 8 will not divide 7, 76, 765, 7654, or 76543). a(7) = 0 because 7 will not divide 6, 65, 654, 6543, 65432, 654321, or 6543210.
		

Crossrefs

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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Martins Opmanis, Aug 02 2018

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Mathematica
    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 *)
  • 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
  • Pascal
    program skaitlirinda2;
    var i : longint;
    function Atrodi(n : longint) : int64;
    var sk, koefa, naksk, rez : int64;
    begin
       sk := 1;
       naksk := 10;
       koefa := naksk mod n;
       rez := sk mod n;
       while rez>0 do
        begin
         Inc(sk);
         rez := (sk * koefa + rez) mod n;
         if sk=naksk then naksk := naksk * 10;
         koefa := (koefa*naksk) mod n;
        end;
       Atrodi := sk;
    end;
    begin
      for i:=1 to 10000 do
       begin
        if (i mod 2)*(i mod 5) > 0 then writeln(i,' ',Atrodi(i)) else writeln(i,' 0');
       end;
    end.
    
Showing 1-2 of 2 results.