OFFSET
1,1
COMMENTS
The iterated function can also be defined as x -> c(x)*(10^L(x-c(x))-1) + x, where c(x) = A048762(x) = floor(x^(1/3))^3 is the largest perfect cube <= x; A055400(x) = x-c(x) is the "cube excess" of x, and L(x) = A055642(x) = floor(log_10(max(x,1))+1) is the number of decimal digits of x.
Often a(n+1) = a(n) + 1, especially when c(n+1) = c(n), in which case it is probable that all elements of the orbit of n+1 are just one larger than the elements of the orbit of n.
LINKS
Eric Angelini, Pseudo-loops with cubes, and post to math-fun discussion list; April 1, 2024.
EXAMPLE
Starting with 1, we get 1 -> 10 -> 82 (since 8 is the largest cube <= 10, at distance 2) -> 6418 (since the cube 64 is at distance 18) -> 5832586 (since 5832 = 18^3 is at distance 586) -> 5832000586 (since 180^3 is again at distance 586) -> ...: Each time 3 '0's will be inserted in front of the remainder which remains always the same, a(1) = 586, as does the cube root up to an additional factor of 10.
Starting with 2, we get 2 -> 11 (since the largest cube <= 2 is 1, at distance 1) -> 83 (since largest cube <= 11 is 8, at distance 2) -> 6419(since the cube 64 is at distance 19) -> 5832587 (since 5832 = 18^3 is at distance 587) -> 5832000587 (since 180^3 is again at distance 587) -> ... We see that in this sequence each term is one more than that of the preceding sequence, whence also a(2) = 587 = a(1)+1.
Starting with 8, we get 8 -> 80 (since the largest cube <= 8 is 8, at distance 0) -> 6416 (since the cube 64 is at distance 16, two less than in 1's orbit) -> 5832584 (since 5832 = 18^3 is at distance 584, again 2 less than in 1's orbit) -> 5832000584 (since 180^3 is again at distance 584) -> ... We see that in this sequence each term is 2 (resp. 8) less than the corresponding term of 1's (resp. 7's) orbit (with the initial term deleted). Hence also a(8) = 584 = a(7)-8 = a(1)-2. From here on subsequent terms will again increase by 1 up to n = 17.
Starting with 18, we get 18 -> 810 (since the largest cube <= 18 is 8, at distance 10) -> 72981 (since the cube 729 is at distance 81) -> 689214060 (since 68921 = 41^3 is at distance 4060) -> 688465387748673 (since 688465387 = 883^3 is at distance 748673), from where on the cube roots get multiplied by 10 and the distance from the cubes remains the same, a(18) = 748673.
For n = 64 -> 640 (= 8^3 + 128) -> 512128 = 80^3 + 128, we have a(n) = 128.
PROG
(PARI) A369861(n)={until(, my(c=sqrtnint(n, 3), v=valuation(c, 10), L=logint(max(n-c^3, 1), 10)+1); L==v*3 && return(n-c^3); n += c^3*(10^L-1))}
(Python)
import sympy
def A369861(n: int):
while True:
C = sympy.integer_nthroot(n, 3)[0]**3; L = A055642(n-C)
if sympy.multiplicity(10, C) == L: return n-C
n += C * (10**L - 1)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Apr 03 2024
STATUS
approved