OFFSET
1,2
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, Scatterplot of the first 25000000 terms
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
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Jan 31 2024
STATUS
approved