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-3 of 3 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

A281066 Concatenation R(n)R(n-1)R(n-2)...R(2)R(1) read mod n, where R(x) is the digit-reversal of x (with leading zeros not omitted).

Original entry on oeis.org

0, 1, 0, 1, 1, 3, 3, 1, 0, 1, 4, 9, 5, 7, 6, 1, 6, 9, 17, 1, 15, 15, 19, 9, 21, 1, 18, 13, 28, 21, 26, 17, 15, 3, 16, 9, 30, 3, 15, 1, 1, 33, 10, 37, 36, 43, 22, 33, 19, 21, 48, 45, 2, 45, 26, 49, 27, 33, 33, 21, 48, 25, 36, 49, 36, 15, 22, 5, 27, 11, 42, 9, 2, 73, 21, 17, 59, 57, 5, 1
Offset: 1

Views

Author

Robert G. Wilson v, Jan 14 2017

Keywords

Examples

			a(13) = 31211101987654321 (mod 13) = 5.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[ FromDigits@ Fold[ Join[ Reverse@ IntegerDigits@#2, #1] &, {}, Range@ n], n]; Array[f, 80]
  • PARI
    a(n) = my(s = ""); forstep (k=n,1,-1, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); eval(s) % n; \\ Michel Marcus, Jan 28 2017
  • Python
    def A281066(n):
        s=""
        for i in range(n, 0, -1):
            s+=str(i)[::-1]
        return int(s)%n # Indranil Ghosh, Jan 28 2017
    

Formula

a(n) = A138793(n) (mod n).

A281190 Concatenation of the reversed digits of numbers from 1 to n, mod n.

Original entry on oeis.org

0, 0, 0, 2, 0, 0, 5, 6, 0, 1, 6, 9, 3, 1, 6, 9, 5, 9, 1, 2, 18, 6, 12, 18, 2, 6, 18, 26, 7, 3, 20, 27, 6, 3, 28, 27, 7, 19, 12, 24, 4, 24, 12, 28, 9, 8, 42, 12, 22, 5, 3, 45, 41, 45, 50, 45, 45, 23, 16, 6, 6, 54, 27, 30, 61, 6, 37, 30, 21, 67, 47, 63, 52, 67, 57, 19, 28, 15, 58, 28, 72, 22, 56, 24, 83, 34, 3, 72, 72, 9, 85, 69, 57
Offset: 1

Views

Author

Robert G. Wilson v, Jan 16 2017

Keywords

Comments

Note that leading zeros are not omitted when numbers are reversed. - N. J. A. Sloane, Jan 23 2017

Examples

			a(13) = A138957(13) mod 13 == 12345678901112131 mod 13 == 3.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[ Fold[#1*10^IntegerLength@#2 + FromDigits@ Reverse@ IntegerDigits@#2 &, 0, Range@ n], n]; Array[f, 105]
  • PARI
    a(n) = my(s = ""); for (k=1, n, sk = digits(k); forstep (j=#sk, 1, -1, s = concat(s, sk[j]))); eval(s) % n; \\ Michel Marcus, Jan 28 2017
  • Python
    def A281190(n):
        s=""
        for i in range(1,n+1):
            s+=str(i)[::-1]
        return int(s)%n # Indranil Ghosh, Jan 28 2017
    

Formula

a(n) = A138957(n) mod n.
Showing 1-3 of 3 results.