login
A369772
a(1) = 1, a(2) = 2; for n >= 3, a(n) = a(GCD(n - 1, a(n - 1))) + a(n - GCD(n - 1, a(n - 2))).
2
1, 2, 4, 5, 2, 2, 4, 5, 3, 7, 8, 9, 7, 8, 7, 8, 13, 14, 16, 17, 14, 18, 16, 17, 14, 15, 15, 18, 20, 21, 18, 19, 19, 20, 22, 19, 23, 24, 26, 30, 33, 34, 32, 33, 41, 33, 34, 35, 35, 36, 35, 36, 41, 42, 44, 52, 46, 47, 47, 48, 57, 58, 60, 64, 121, 122, 54, 55, 55, 56, 130
OFFSET
1,2
EXAMPLE
a(3) = a(gcd(2, a(2))) + a(3 - gcd(2, a(1))) = a(2) + a(2) = 4.
a(4) = a(gcd(3, a(3))) + a(4 - gcd(3, a(2))) = a(1) + a(3) = 5.
and so on.
MATHEMATICA
a[1] = 1; a[2] = 2; a[n_] := a[n] = a[GCD[n - 1, a[n - 1]]] + a[n - GCD[n - 1, a[n - 2]]]; Array[a, 100] (* Amiram Eldar, Feb 01 2024 *)
PROG
(PARI) { for (n = 1, #a = vector(71), print1 (a[n] = if (n==1, 1, n==2, 2, a[gcd(n-1, a[n-1])] + a[n-gcd(n-1, a[n-2])])", "); ); } \\ Rémy Sigrist, Feb 04 2024
CROSSREFS
Cf. A005185.
Sequence in context: A030750 A286147 A340755 * A059215 A125142 A234350
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Jan 31 2024
STATUS
approved