OFFSET
2,2
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.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 2..10001
Mohammed Bouras, A new sequence of prime numbers, Romanian Math. Mag. (15 August 2022). See Table 2 p. 2.
Mohammed Bouras, The Distribution Of Prime Numbers And Continued Fractions, (ppt) (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).
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,easy,frac
AUTHOR
Mohammed Bouras, Jul 30 2022
STATUS
approved