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
Jianing Song, Table of n, a(n) for n = 0..10000
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