login
A378513
a(1) = 1, a(n) = a(n-1) + n if all the digits of a(n-1) do not share a divisor greater than 1. Otherwise, a(n) = a(n-1) divided by the gcd of all its individual digits.
1
1, 3, 1, 5, 1, 7, 1, 9, 1, 11, 22, 11, 24, 12, 27, 43, 60, 10, 29, 49, 70, 10, 33, 11, 36, 12, 39, 13, 42, 21, 52, 84, 21, 55, 11, 47, 84, 21, 60, 10, 51, 93, 31, 75, 120, 166, 213, 261, 310, 360, 120, 172, 225, 279, 334, 390, 130, 188, 247, 307, 368, 430
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.
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
Cf. A052423 (gcd of digits).
Sequence in context: A093178 A340086 A307153 * A339421 A336898 A300330
KEYWORD
nonn,base,look
AUTHOR
Stuart Coe, Nov 29 2024
STATUS
approved