login
A356427
a(0) = 0, a(1) = 1; for n > 1, a(n) is the last step before reaching 0 of the iterations x -> x - gpf(x) starting at n, where gpf = A006530.
1
0, 1, 2, 3, 2, 5, 3, 7, 3, 3, 5, 11, 3, 13, 7, 5, 7, 17, 5, 19, 5, 7, 11, 23, 7, 5, 13, 7, 7, 29, 5, 31, 5, 11, 17, 7, 11, 37, 19, 13, 7, 41, 7, 43, 11, 7, 23, 47, 7, 7, 7, 17, 13, 53, 17, 11, 7, 19, 29, 59, 11, 61, 31, 7, 31, 13, 11, 67, 17, 23, 7, 71, 23, 73, 37, 7, 19, 11
OFFSET
0,3
COMMENTS
For n > 1, a(n) is the unique prime in the iterations x -> x - gpf(x) starting at n and ending at 0.
LINKS
FORMULA
For n > 0, a(n) = gpf(n) if n is in A356438; otherwise a(n) > gpf(n).
EXAMPLE
In the following examples the numbers produced by the iterations are listed together with their GPFs.
48 (3) -> 45 (5) -> 40 (5) -> 35 (7) -> ... -> 7 (7) -> 0, so a(48) = 7.
96 (3) -> 93 (31) -> 62 (31) -> 31 (31) -> 0, so a(96) = 31.
PROG
(PARI) a(n) = if(n>1, my(s=n); while(!isprime(s), s=s-vecmax(factor(s)[, 1])); s, n)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Aug 07 2022
STATUS
approved