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.

A356247 Denominator of the continued fraction 1/(2 - 3/(3 - 4/(4 - 5/(...(n-1) - n/(-1))))).

Original entry on oeis.org

1, 5, 11, 19, 29, 41, 11, 71, 89, 109, 131, 31, 181, 19, 239, 271, 61, 31, 379, 419, 461, 101, 29, 599, 59, 701, 151, 811, 79, 929, 991, 211, 59, 41, 1259, 1, 281, 1481, 1559, 149, 1721, 1, 61, 1979, 2069, 2161, 1, 2351, 79, 2549, 241, 1, 2861, 2969, 3079, 3191
Offset: 2

Views

Author

Mohammed Bouras, Jul 30 2022

Keywords

Comments

Conjecture 1: Every term of this sequence is either a prime number or 1.
Conjecture 2: The sequence contains all prime numbers which ends with a 1 or 9.
Conjecture 3: Except for 5, the primes all appear exactly twice.
a(n) divides n^2 - n - 1, which is the unreduced denominator.
Conjecture: The ordered sequence of prime values is A038872. - Bill McEachen, Jul 28 2025
For a proof of Conjectures 1-3, see Cloitre (2025). - Sean A. Irvine, Aug 25 2025

Examples

			For n=2, 1/(2 - 3) = -1, so a(2)=1.
For n=3, 1/(2 - 3/(3 - 4)) = 1/5, so a(3)=5.
For n=4, 1/(2 - 3/(3 - 4/(4 - 5))) = 7/11, so a(4)=11.
For n=5, 1/(2 - 3/(3 - 4/(4 - 5/(5 - 6)))) = 23/19, so a(5)=19.
For n=6, 1/(2 - 3/(3 - 4/(4 - 5/(5 - 6/(6 - 7))))) = 73/29, so a(6)=29.
a(23) = a(79) = 23 + 79 - 1 = 101.
a(26) = a(34) = gcd(26^2 - 26 -1, 34^2 - 34 - 1) = gcd(649, 1121) = 59.
		

Crossrefs

Cf. A002327 (primes of the form k^2-k-1), A028387, A051403, A165900, A356684.

Programs

  • Mathematica
    a[n_] := ContinuedFractionK[-i-1, If[i == n, 1, i+1], {i, 1, n}] //
       Denominator;
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Aug 11 2022 *)
  • PARI
    a(n) = if (n==1, 1, n--; my(v = vector(2*n, k, (k+4)\2)); my(q = 1/(v[2*n-1] - v[2*n])); forstep(k=2*n-3, 1, -2, q = v[k] - v[k+1]/q; ); denominator(1/q)); \\ Michel Marcus, Aug 07 2022
    
  • Python
    from fractions import Fraction
    def A356247(n):
        k = -1
        for i in range(n-1,1,-1):
            k = i-Fraction(i+1,k)
        return abs(k.numerator) # Chai Wah Wu, Aug 23 2022

Formula

a(n) = (n^2 - n - 1)/gcd(n^2 - n - 1, A356684(n)).
If conjecture 3 is true, then we have:
a(n) = a(m) = n + m - 1.
a(n) = a(m) = gcd(n^2 - n - 1, m^2 - m - 1).
a(n) = a(a(n) - n + 1).