OFFSET
0,3
COMMENTS
This sequences uses the same rules as Recamán's sequence A005132 except that, instead of adding or subtracting n each term, the least prime dividing n is used. See A020639.
For the first 100 million terms the smallest value not appearing is 5. As any term for prime n can be the previous term minus n there is no apparent lower bound for the terms as n increases. For example a(16367081) = 601, the previous term being a(16367080) = 16367682. Thus it is possible 5, and eventually all values, are visited, although this is unknown.
In the same range the maximum value is a(98782561) = 602622357, and 7627043 terms repeat a previously visited value, the first time this occurs is a(12) = a(4) = 4. The longest run of consecutive increasing terms is 47, starting at a(96135288) = 26062, while the longest run of consecutive decreasing terms is 238, starting at a(32357989) = 160443385.
EXAMPLE
a(2) = 3. As 2 is prime lpf(2) = 2 thus a(2) = a(1) + 2 = 1 + 2 = 3.
a(6) = 7. As lpf(6) = 2 and as 7 has not been previously visited and is nonnegative, a(6) = a(5) - 2 = 9 - 2 = 7.
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Aug 03 2020
STATUS
approved