%I #34 Dec 12 2023 07:46:56
%S 1,10,1,2,5,2,5,2,1,10,1,10,1,2,5,2,5,2,1,10,1,10,1,2,5,2,5,2,1,10,1,
%T 10,1,2,5,2,5,2,1,10,1,10,1,2,5,2,5,2,1,10,1,10,1,2,5,2,5,2,1,10,1,10,
%U 1,2,5,2,5,2,1,10,1,10,1,2,5,2,5,2,1,10,1,10,1,2,5,2,5,2,1,10
%N a(n) = gcd(n^2-1, n^2+9).
%C Periodic with period 10.
%C Similar sequences with formula gcd(n^2-1, n^2+k):
%C k= 1: 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ... (A000034)
%C k= 3: 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, ... (A010685)
%C k= 5: 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, ... (A129203, start 6)
%C k= 7: 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, ... (A010689)
%C k= 9: 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, ... (this sequence)
%C k=11: 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, ... (A129197, start 12)
%C Connection between the values of a(n) and the last digit of n:
%C . if n ends with 0, 2 or 8, then a(n) = 1;
%C . if n ends with 1 or 9, then a(n) = 10;
%C . if n ends with 3, 5 or 7, then a(n) = 2;
%C . if n ends with 4 or 6, then a(n) = 5.
%C Also, continued fraction expansion of (57 + sqrt(4579))/114.
%H <a href="/index/Rec#order_10">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,0,0,1).
%F G.f.: (1 + 10*x + x^2 + 2*x^3 + 5*x^4 + 2*x^5 + 5*x^6 + 2*x^7 + x^8 + 10*x^9)/(1 - x^10).
%t Table[PolynomialGCD[n^2 - 1, n^2 + 9], {n, 0, 100}]
%t LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 10, 1, 2, 5, 2, 5, 2, 1, 10}, 100]
%o (Python) [1, 10, 1, 2, 5, 2, 5, 2, 1, 10]*10
%o (Sage) [gcd(n^2-1, n^2+9) for n in range(100)]
%o (Magma) &cat [[1, 10, 1, 2, 5, 2, 5, 2, 1, 10]^^10];
%o (Maxima) makelist(gcd(n^2-1, n^2+9), n, 0, 100);
%o (PARI) Vec((1 + 10*x + x^2 + 2*x^3 + 5*x^4 + 2*x^5 + 5*x^6 + 2*x^7 + x^8 + 10*x^9)/(1 - x^10) + O(x^100)) \\ _Colin Barker_, Mar 08 2017
%Y Cf. A000034, A010685, A010689, A129197, A129203.
%K nonn,easy
%O 0,2
%A _Bruno Berselli_, Mar 07 2017