Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #114 May 31 2024 14:05:42
%S 1,5,11,19,29,41,11,71,89,109,131,31,181,19,239,271,61,31,379,419,461,
%T 101,29,599,59,701,151,811,79,929,991,211,59,41,1259,1,281,1481,1559,
%U 149,1721,1,61,1979,2069,2161,1,2351,79,2549,241,1,2861,2969,3079,3191
%N Denominator of the continued fraction 1/(2 - 3/(3 - 4/(4 - 5/(...(n-1) - n/(-1))))).
%C Conjecture 1: Every term of this sequence is either a prime number or 1.
%C Conjecture 2: The sequence contains all prime numbers which ends with a 1 or 9.
%C Conjecture 3: Except for 5, the primes all appear exactly twice.
%C a(n) divides n^2 - n - 1, which is the unreduced denominator.
%H Michael De Vlieger, <a href="/A356247/b356247.txt">Table of n, a(n) for n = 2..10001</a>
%H Mohammed Bouras, <a href="http://www.ssmrmh.ro/2022/08/15/a-new-sequence-of-prime-numbers/">A new sequence of prime numbers</a>, Romanian Math. Mag. (15 August 2022). See Table 2 p. 2.
%H Mohammed Bouras, <a href="https://doi.org/10.5281/zenodo.10992128">The Distribution Of Prime Numbers And Continued Fractions</a>, (ppt) (2022).
%F a(n) = (n^2 - n - 1)/gcd(n^2 - n - 1, A356684(n)).
%F If conjecture 3 is true, then we have:
%F a(n) = a(m) = n + m - 1.
%F a(n) = a(m) = gcd(n^2 - n - 1, m^2 - m - 1).
%F a(n) = a(a(n) - n + 1).
%e For n=2, 1/(2 - 3) = -1, so a(2)=1.
%e For n=3, 1/(2 - 3/(3 - 4)) = 1/5, so a(3)=5.
%e For n=4, 1/(2 - 3/(3 - 4/(4 - 5))) = 7/11, so a(4)=11.
%e For n=5, 1/(2 - 3/(3 - 4/(4 - 5/(5 - 6)))) = 23/19, so a(5)=19.
%e For n=6, 1/(2 - 3/(3 - 4/(4 - 5/(5 - 6/(6 - 7))))) = 73/29, so a(6)=29.
%e a(23) = a(79) = 23 + 79 - 1 = 101.
%e a(26) = a(34) = gcd(26^2 - 26 -1, 34^2 - 34 - 1) = gcd(649, 1121) = 59.
%t a[n_] := ContinuedFractionK[-i-1, If[i == n, 1, i+1], {i, 1, n}] //
%t Denominator;
%t Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Aug 11 2022 *)
%o (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
%o (Python)
%o from fractions import Fraction
%o def A356247(n):
%o k = -1
%o for i in range(n-1,1,-1):
%o k = i-Fraction(i+1,k)
%o return abs(k.numerator) # _Chai Wah Wu_, Aug 23 2022
%Y Cf. A002327 (primes of the form k^2-k-1), A028387, A051403, A165900, A356684.
%K nonn,easy,frac
%O 2,2
%A _Mohammed Bouras_, Jul 30 2022