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(1) = 1.
a(2) = a(2 - gcd(1, a(1))) + gcd(2, a(1)) = a(1) + 1 = 2.
a(3) = a(3 - gcd(2, a(2))) + gcd(3, a(2)) = a(1) + 1 = 2.
a(4) = a(4 - gcd(3, a(3))) + gcd(4, a(3)) = a(3) + 2 = 4.
and so on.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = a[n - GCD[n - 1, a[n - 1]]] + GCD[n, a[n - 1]]; Array[a, 100]
PROG
(PARI) { for (n = 1, #a = vectorsmall(77), print1 (a[n] = if (n==1, 1, a[n - gcd(n - 1, a[n - 1])] + gcd(n, a[n - 1]))", "); ); } \\ Rémy Sigrist, Feb 06 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Feb 06 2024
STATUS
approved