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.

A269423 a(n) is the sum of all 0 < m < n for which n == a(m) (mod m).

Original entry on oeis.org

1, 1, 3, 1, 7, 4, 8, 8, 10, 16, 3, 9, 7, 12, 13, 25, 12, 4, 12, 14, 22, 58, 3, 12, 34, 48, 11, 31, 31, 4, 79, 14, 35, 82, 36, 113, 21, 28, 6, 47, 59, 9, 46, 1, 105, 131, 59, 103, 30, 27, 48, 12, 7, 38, 60, 19, 50, 110, 157, 210, 7, 6, 23, 134
Offset: 1

Views

Author

Alec Jones, Feb 25 2016

Keywords

Examples

			We define a(1) = 1.
a(2) = 1, because 2 == a(1) (mod 1);
a(3) = 3, because 3 == a(1) (mod 1), and 3 == a(2) (mod 2): 1 + 2 = 3;
a(4) = 1, because 4 == a(1) (mod 1);
a(5) = 7, because 5 == 1 (mod 1), 5 == a(2) (mod 2), and 5 == a(4) (mod 4): 1 + 2 + 4 = 7.
		

Crossrefs

Cf. A269427.

Programs

  • Java
    int[] terms = new int[100];
    terms[0] = 1;
    for (int i = 1; i < 100; i++) {
        int count = 0;
        for (int j = 0; j < i; j++) {
            if (((i+1) - terms[j]) % (j+1) == 0) {
                count = count + j + 1;
            }
        }
        terms[i] = count;
    }
    
  • Mathematica
    a = {1}; Do[AppendTo[a, Total@ Select[Range[n - 1], Mod[n, #] == Mod[a[[#]], #] &]], {n, 2, 64}]; a (* Michael De Vlieger, Mar 24 2016 *)
  • PARI
    lista(nn) = {va = vector(nn); print1(va[1] = 1, ", "); for (n=2, nn, va[n] = sum(m=1, n-1, m*(Mod(va[m], m) == Mod(n, m))); print1(va[n], ", "););} \\ Michel Marcus, Feb 26 2016