OFFSET
1,2
COMMENTS
The majority of terms are concentrated along or just above the line a(n) = n, resulting in 51 fixed points in the first 5000 terms. However, some terms are much larger because the sum of the squares of the previous two terms is a prime number.
Conjecture: the sequence is a permutation of the positive integers.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Scott R. Shannon, Image of the first 10000 terms where a(n) is within 10% of n. The green line is a(n) = n.
Michael De Vlieger, Log-log scatterplot of a(n), n = 1..24857. a(24858) is a multiple of a prime factor of 2345424289569907866042152579118178340801^2 + 24922^2.
Michael De Vlieger, Table of n, a(n) for n = 1..65536.
EXAMPLE
a(5) = 4 as a(3)^2 + a(4)^2 = 25 + 841 = 866, and 4 is the smallest unused number that shares a factor with 866.
a(9) = 539562233501 as a(7)^2 + a(8)^2 = 100 + 539562233401 = 539562233501, which is a prime number.
MATHEMATICA
nn = 120; c[_] = False; q[_] = 1; Do[Set[{a[i], c[i], q[i]}, {i, True, 2}], {i, 2}]; i = a[1]^2; j = a[2]^2; Do[k = i + j; s = FactorInteger[k][[All, 1]]; Do[(m = q[#]; While[c[# m], m++]; q[#] = m; If[# m < k, k = # m]) &[s[[n]]], {n, Length[s]}]; Set[{a[n], c[k], i, j}, {k, True, j, k^2}], {n, 3, nn}]; Array[a, nn] (* Michael De Vlieger, Nov 17 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Scott R. Shannon, Nov 16 2022
STATUS
approved