cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Stuart Coe, Nov 29 2024

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A052423 (gcd of digits).

Programs

  • 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 *)
  • 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