(MAGMAMagma) 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);
Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
(MAGMAMagma) 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);
proposed
approved
editing
proposed
editing
proposed
nonn,changed,look
Nest[Append[#1, #1[[-1]] + GCD[#2, #1[[-1]]]^2] & @@ {#, Length[#] + 2} &, {3}, 50] (* Michael De Vlieger, Apr 13 2021 *)
proposed
editing
editing
proposed
Robert Israel, <a href="/A260815/b260815.txt">Table of n, a(n) for n = 2..10000</a>
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
approved
editing
editing
approved