A048823 a(n) = value of n defined as follows: start with n and reach 2 by repeatedly either dividing by d where d <= the square root or by subtracting 1. The division steps are free, but subtracting 1 costs 1 point. The "value" of n is the smallest cost to reach 2.
0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 0, 1, 2, 1, 0, 1, 1, 2, 1, 2, 2, 3, 0, 1, 1, 1, 2, 3, 1, 2, 0, 1, 1, 2, 0, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 0, 1, 1, 1, 1, 2, 1, 2, 0, 1, 2, 3, 0, 1, 2, 1, 0, 1, 1, 2, 1, 2, 1, 2, 0, 1, 1, 1, 2, 2, 1, 2, 0, 1, 1, 2, 0, 1, 2, 3, 2, 3, 1, 1, 2, 2, 3, 2, 0, 1, 1, 1, 1, 2, 1, 2, 1
Offset: 2
Keywords
Links
- Sean A. Irvine, Java program (github)
Crossrefs
Cf. A047988. Same formula except you cannot add 1 (only subtract).
Extensions
Missing a(2)=0 inserted by Sean A. Irvine, Jul 09 2021