login
A287415
a(0) = 0; a(1) = 1; a(n) = n - a(phi(a(n-1))), where phi() is the Euler totient function (A000010).
1
0, 1, 1, 2, 3, 4, 5, 4, 7, 4, 9, 6, 11, 4, 13, 4, 15, 10, 15, 12, 17, 6, 21, 12, 21, 14, 21, 16, 21, 18, 25, 14, 27, 18, 29, 14, 31, 12, 35, 18, 35, 20, 35, 22, 35, 24, 39, 26, 37, 18, 45, 30, 45, 32, 39, 34, 41, 22, 49, 24, 53, 16, 55, 28, 53, 20, 59, 18, 63, 38, 55, 36, 61, 20, 67, 16, 69, 42, 67, 20
OFFSET
0,4
COMMENTS
A variation on Hofstadter's G-sequence.
FORMULA
a(n) = n - a(a(n-1)*Product_{p|a(n-1), p prime} (1 - 1/p)) for n > 3.
a(n) = n - a(a(n-1)-1) for a(n-1) is a prime.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = n - a[EulerPhi[a[n - 1]]]; Array[a, 80, 0]
CROSSREFS
Cf. A000010, A005206, A005374, A135528 (parity of a(n)).
Sequence in context: A135681 A135680 A135682 * A352612 A083245 A111610
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 24 2017
STATUS
approved