OFFSET
2,1
COMMENTS
The first differences of a(n) are all squares.
LINKS
Robert Israel, Table of n, a(n) for n = 2..10000
EXAMPLE
a(3) = 3 + gcd(3, 3)^2 = 3 + 9 = 12.
a(4) = 12 + gcd(4, 12)^2 = 12 + 16 = 28.
a(5) = 28 + gcd(5, 28)^2 = 28 + 1 = 29.
MAPLE
N:= 100: # for a(2)..a(N)
A:= Array(2..N):
A[2]:= 3:
for n from 3 to N do
A[n]:= A[n-1]+igcd(n, A[n-1])^2
od:
seq(A[i], i=2..N); # Robert Israel, Apr 13 2021
MATHEMATICA
Nest[Append[#1, #1[[-1]] + GCD[#2, #1[[-1]]]^2] & @@ {#, Length[#] + 2} &, {3}, 50] (* Michael De Vlieger, Apr 13 2021 *)
PROG
(MAGMA) I:=[0, 3]; Remove([n le 2 select I[n] else Self(n-1)+Gcd(n, Self(n-1))^2: n in [1..52]], 1);
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Arkadiusz Wesolowski, Jul 31 2015
STATUS
approved