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

A094151 Remainder when concatenation 1,2,3,...up to (n-1) is divided by n.

Original entry on oeis.org

0, 1, 0, 3, 4, 3, 4, 7, 0, 9, 4, 3, 12, 9, 9, 7, 1, 9, 7, 19, 12, 15, 18, 15, 24, 9, 0, 11, 27, 9, 7, 7, 15, 9, 9, 27, 29, 21, 21, 39, 22, 33, 5, 15, 9, 39, 45, 39, 39, 49, 27, 51, 33, 27, 4, 23, 15, 49, 49, 39, 32, 13, 54, 7, 9, 15, 41, 59, 0, 39, 47, 63, 41, 17, 24, 23, 37, 21, 75, 39
Offset: 1

Views

Author

Amarnath Murthy, Apr 29 2004

Keywords

Examples

			a(5) = 15 hence a(6) = least integer multiple of 15/6 = 5.
		

Crossrefs

Cf. A007908, A110740 (indices of 0's).
Cf. A095221.

Programs

  • Mathematica
    Table[st = ""; For[i = 0, i <= n - 1, i++, st = st <> ToString[i]]; Mod[ ToExpression[st], n], {n, 1, 100}] (* Sam Handler (sam_5_5_5_0(AT)yahoo.com), Nov 12 2004 *)
    Table[Mod[FromDigits[Flatten[IntegerDigits/@Range[n-1]]],n],{n,100}] (* Harvey P. Dale, May 21 2024 *)
  • PARI
    a(n)=if(n<=9, return(1719%n)); my(m=Mod(123456789,n)); for(d=2,#Str(n-1), my(D=10^d); for(k=D/10,min(D,n)-1, m=D*m+k)); lift(m) \\ Charles R Greathouse IV, Nov 21 2022
  • Python
    from itertools import count, islice
    def agen():
        s = "0"
        for n in count(1): yield int(s)%n; s += str(n)
    print(list(islice(agen(), 80))) # Michael S. Branicky, Nov 21 2022
    

Formula

a(n) = A007908(n-1) mod n for n>1. - Michel Marcus, Nov 21 2022

Extensions

More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Nov 12 2004

A316312 Numbers k such that the sum of the digits of the numbers 1, 2, 3, ... up to (k - 1) is divisible by k.

Original entry on oeis.org

1, 3, 5, 7, 9, 12, 15, 20, 27, 40, 45, 60, 63, 80, 81, 100, 180, 181, 300, 360, 363, 500, 540, 545, 700, 720, 727, 900, 909, 912, 915, 1137, 1140, 1200, 1500, 1560, 1563, 2000, 2700, 2720, 2727, 4000, 4500, 4540, 4545, 6000, 6300, 6360, 6363, 8000, 8100, 8180
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that A007953(A007908(k - 1)) is divisible by k. - Felix Fröhlich, Jun 29 2018
From Robert Israel, Jun 29 2018: (Start)
Numbers k such that A037123(k - 1) is divisible by k.
If m is even, then 10^m, 3 * 10^m, 5 * 10^m, 7 * 10^m and 9 * 10^m are included.
If m is odd, then 2 * 10^m, 4 * 10^m, 6 * 10^m, and 8 * 10^m are included. (End)
Is it true that if k is a term then 100 * k is a term?

Examples

			For n = 7, sum of the digits of the numbers 1 to 6 is 21, which is divisible by 7.
For n = 12, sum of the digits of the numbers 1 to 11 is 48, which is divisible by 12.
For n = 15, sum of the digits of the numbers 1 to 14 is 60, which is divisible by 15.
16 is not in the sequence because the sum of the digits of the numbers 1 to 15 is 66, which is not divisible by 16.
		

Crossrefs

Programs

  • Maple
    t:= 0: Res:= NULL:
    for n from 1 to 10000 do
      t:= t + convert(convert(n-1,base,10),`+`);
      if (t/n)::integer then Res:= Res, n fi
    od:
    Res; # Robert Israel, Jun 29 2018
  • Mathematica
    s = 0; Reap[Do[If[Mod[s, n] == 0, Sow[n]]; s += Plus @@ IntegerDigits@n, {n, 10000}]][[2, 1]] (* Giovanni Resta, Jun 29 2018 *)
  • PARI
    sumsod(n) = sum(i=1, n, sumdigits(i))
    is(n) = sumsod(n-1)%n==0 \\ Felix Fröhlich, Jun 29 2018
    
  • PARI
    upto(n) = my(s=0,res=List()); for(i=0, n, s += vecsum(digits(i)); if(s%(i+1)==0, listput(res, i+1))); res \\ David A. Corneth, Jun 29 2018

Extensions

More terms from Felix Fröhlich, Jun 29 2018

A358610 Numbers k such that the concatenation 1,2,3,... up to (k-1) is one less than a multiple of k.

Original entry on oeis.org

1, 2, 4, 5, 8, 10, 13, 20, 25, 40, 50, 52, 100, 125, 200, 250, 400, 475, 500, 601, 848, 908, 1000, 1120, 1250, 1750, 2000, 2500, 2800, 2900, 3670, 4000, 4375, 4685, 5000, 6085, 7000, 7640, 7924, 8375, 10000, 10900, 12500, 13346, 14000, 17800, 20000, 21568, 25000
Offset: 1

Views

Author

Martin Renner, Nov 23 2022

Keywords

Comments

For a >= 0, the infinite subsequence of numbers 10^a, 2^b*10^a (for 1 <= b <= 2) and 5^c*10^a (for 1 <= c <= 3), i.e., 1, 2, 4, 5, 10, 20, 25, 40, 50, 100, 125, 200, 250, 400, 500, 1000, 1250, 2000, 2500, 4000, 5000, ... are terms in the sequence because first, the concatenation 1, 2, 3, ... up to (10^a - 1) mod 10^a is equal to 10^a times the concatenation 1, 2, 3, ... up to (10^a - 2) + (10^a - 1) mod 10^a, which results in 10^a - 1 and second, the concatenation 1, 2, 3, ... up to (2^b*10^a - 1) mod 2^b*10^a is equal to 10^(a+1) times the concatenation 1, 2, 3, ... up to (2^b*10^a - 2) + (2^b*10^a - 1) mod 2^b*10^a, which results in 2^b*10^a - 1 and third, the concatenation 1, 2, 3, ... up to (5^c*10^a - 1) mod 5^c*10^a is equal to 10^(a+c) times the concatenation 1, 2, 3, ... up to (5^c*10^a - 2) + (5^c*10^a - 1) mod 5^c*10^a, which results in 5^c*10^a - 1.

Examples

			13 is a term because 123456789101112 mod 13 = 12.
20 is a term because 12345678910111213141516171819 mod 20 = 19.
		

Crossrefs

Programs

  • Maple
    a:=proc(m)
      local A, str, i;
      if m = 1 then return([1]);
      else
        if m = 2 then return([1, 2]);
        else
          A := [1, 2];
          str := 1;
          for i from 2 to m do
            str := str*10^length(i) + i;
            if str mod (i+1) = i then A := [op(A), i+1]; fi;
          od;
        fi;
      fi;
      return(A);
    end:
  • Python
    from itertools import count, islice
    def agen():
        s = "0"
        for n in count(1):
            if int(s)%n == n - 1: yield n
            s += str(n)
    print(list(islice(agen(), 30))) # Michael S. Branicky, Nov 23 2022

A362966 Numbers k such that A007908(k) == 1 (mod k).

Original entry on oeis.org

1, 121487, 293957, 13449179, 549999887
Offset: 1

Views

Author

Max Alekseyev, Jun 06 2023

Keywords

Comments

a(6) > 10^11. - Jason Yuen, Oct 12 2024

Crossrefs

Programs

  • Python
    # See A029455 for concat_mod
    def isok(k): return concat_mod(10, k, k)==1%k # Jason Yuen, Oct 12 2024

A302687 a(1) = 1; a(2) = 2; then a(n) is the smallest number > a(n-1) such that a(n) divides concat(a(1), a(2), ..., a(n-1)).

Original entry on oeis.org

1, 2, 3, 41, 43, 129, 9567001, 21147541, 22662659, 23817877, 24837187, 28850377, 28872229, 37916473, 48749751, 70416307, 439229167, 834385607, 2270365163, 2278377431, 3751789547, 4433933101, 4810754611, 14432263833, 15632412757, 30530543651, 42441819717, 65591903199, 65857498407
Offset: 1

Views

Author

Daniel Sterman, Apr 11 2018

Keywords

Examples

			a(3) = 3, which makes the concatenation of the first three terms: 123. After 3, the next-highest factor of 123 is 41, so a(4) = 41. The concatenation of the first four terms is then 12341. After 41, the next-highest factor of 12341 is 43, so a(5) = 43.
		

Crossrefs

Compare A240588, in which each term does not need to strictly increase as long as it has not yet appeared in the sequence.
Compare also A171785, in which each term must divide the concatenation of all terms in the sequence including itself.
In A029455, each term divides the concatenation of all smaller positive integers.
In A110740, each term divides the concatenation of all strictly smaller positive integers.

Programs

  • Maple
    A[1]:= 1: A[2]:= 2: C:= 1:
    for n from 3 to 20 do
      C:= A[n-1]+C*10^(ilog10(A[n-1])+1);
      A[n]:= min(select(`>`,numtheory:-divisors(C),A[n-1]))
    od:
    seq(A[i],i=1..20); # Robert Israel, Apr 12 2018

Extensions

a(16)-a(20) from Robert Israel, Apr 12 2018
a(21)-a(29) from Daniel Suteu, Apr 12 2018
Showing 1-5 of 5 results.