cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A260815 a(2) = 3; for n >= 3, a(n) = a(n-1) + gcd(n, a(n-1))^2.

Original entry on oeis.org

3, 12, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 575, 576, 577, 578, 579, 580, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610, 1611, 1612
Offset: 2

Views

Author

Arkadiusz Wesolowski, Jul 31 2015

Keywords

Comments

The first differences of a(n) are all squares.

Examples

			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.
		

Crossrefs

Programs

  • 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);
  • 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 *)