OFFSET
1,2
COMMENTS
It can be shown that this sequence will grow indefinitely: Once it has reached a given number of digits in length, it cannot drop below that number of digits. Regardless of the number of times the number is reduced by dividing by GCDs, n will inevitably be great enough to increase a(n) to a larger and larger number of digits in length.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10000
EXAMPLE
a(37) = 47 + 37, because the digits of 47 do not share a factor greater than 1.
a(38) = 84 / 4 = 21, because the gcd of 8 and 4 is 4.
MAPLE
a:= proc(n) option remember; `if`(n=1, 1, (t-> (g->
`if`(g=1, t+n, t/g))(igcd(convert(t, base, 10)[])))(a(n-1)))
end:
seq(a(n), n=1..62); # Alois P. Heinz, Nov 29 2024
MATHEMATICA
Module[{n = 1, g}, NestList[If[n++; (g = GCD @@ IntegerDigits[#]) == 1, # + n, #/g] &, 1, 100]] (* Paolo Xausa, Dec 16 2024 *)
PROG
(PARI) lista(nn) = my(v=vector(nn)); v[1] = 1; for (n=2, nn, my(g=gcd(digits(v[n-1]))); if (g == 1, v[n] = v[n-1]+n, v[n] = v[n-1]/g); ); v; \\ Michel Marcus, Dec 09 2024
CROSSREFS
KEYWORD
AUTHOR
Stuart Coe, Nov 29 2024
STATUS
approved
