login
A269423
a(n) is the sum of all 0 < m < n for which n == a(m) (mod m).
4
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,3
EXAMPLE
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.
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 *)
PROG
(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;
}
(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
CROSSREFS
Cf. A269427.
Sequence in context: A190177 A283764 A010603 * A328461 A341494 A210198
KEYWORD
easy,nonn
AUTHOR
Alec Jones, Feb 25 2016
STATUS
approved