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.

A283393 a(n) = gcd(n^2-1, n^2+9).

Original entry on oeis.org

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, 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, 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
Offset: 0

Views

Author

Bruno Berselli, Mar 07 2017

Keywords

Comments

Periodic with period 10.
Similar sequences with formula gcd(n^2-1, n^2+k):
k= 1: 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, ... (A000034)
k= 3: 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, ... (A010685)
k= 5: 1, 6, 3, 2, 3, 6, 1, 6, 3, 2, 3, 6, 1, ... (A129203, start 6)
k= 7: 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, ... (A010689)
k= 9: 1, 10, 1, 2, 5, 2, 5, 2, 1, 10, 1, 10, 1, ... (this sequence)
k=11: 1, 12, 3, 4, 3, 12, 1, 12, 3, 4, 3, 12, 1, ... (A129197, start 12)
Connection between the values of a(n) and the last digit of n:
. if n ends with 0, 2 or 8, then a(n) = 1;
. if n ends with 1 or 9, then a(n) = 10;
. if n ends with 3, 5 or 7, then a(n) = 2;
. if n ends with 4 or 6, then a(n) = 5.
Also, continued fraction expansion of (57 + sqrt(4579))/114.

Crossrefs

Programs

  • Magma
    &cat [[1, 10, 1, 2, 5, 2, 5, 2, 1, 10]^^10];
    
  • Mathematica
    Table[PolynomialGCD[n^2 - 1, n^2 + 9], {n, 0, 100}]
    LinearRecurrence[{0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 10, 1, 2, 5, 2, 5, 2, 1, 10}, 100]
  • Maxima
    makelist(gcd(n^2-1, n^2+9), n, 0, 100);
    
  • 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
  • Python
    [1, 10, 1, 2, 5, 2, 5, 2, 1, 10]*10
    
  • Sage
    [gcd(n^2-1, n^2+9) for n in range(100)]
    

Formula

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).