OFFSET
1,5
COMMENTS
If a(m) = a(p^k-1) for some m < p^k-1, take the largest such m and set a(p^k) = p^k-1-m; otherwise a(p^k) = 0.
EXAMPLE
a(1) = 1 (as this sequence is multiplicative).
a(2) = 0 as there is no m < 1 such that a(m) = a(1) (by Van Eck's rule).
a(3) = 0 as there is no m < 2 such that a(m) = a(2) (by Van Eck's rule).
a(4) = 3-2 = 1 as a(2) = a(3) (by Van Eck's rule).
a(5) = 4-1 = 3 as a(1) = a(4) (by Van Eck's rule).
a(6) = a(2)*a(3) = 0 (as this sequence is multiplicative).
PROG
(PARI) { for (n=1, #a=vector(87), f=factor(n); if (#f~==1, forstep (m=n-2, 1, -1, if (a[n-1]==a[m], a[n]=n-1-m; break)), a[n]=prod (k=1, #f~, a[f[k, 1]^f[k, 2]])); print1 (a[n]", ")) }
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Rémy Sigrist, Mar 23 2022
STATUS
approved