OFFSET
0,4
COMMENTS
A variation on Hofstadter's G-sequence.
LINKS
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
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 24 2017
STATUS
approved