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

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