%I #34 May 04 2023 02:24:22
%S 0,2,5,6,3,5,4,14,14,8,6,6,7,4,14,30,9,14,10,13,5,6,12,14,13,8,41,12,
%T 15,14,16,62,6,9,18,14,19,10,7,14,21,5,22,6,14,12,24,46,25,13,14,10,
%U 27,41,8,26,14,16,30,14,31,16,25,126,8,6,34,10,14,18,36
%N a(n) is the least k >= 0 such that n divides C(k) (where C(k) are the Catalan numbers A000108).
%C The sequence is well defined:
%C - if k has t+1 ones in binary representation, 2^t divides C(k),
%C - for any odd prime number p: if k has e digits (p+1)/2 in base p, p^e divides C(k),
%C - for any n with prime factorization 2^t * Product_{i=1..o} p_i ^ e_i (where p_i are distinct odd prime numbers),
%C - by the Chinese remainder theorem, there is a number N ending with t+1 ones in base 2 and ending with e_i digits (p_i+1)/2 in base p_i for i = 1..o,
%C - C(N) is a multiple of n, and
%C - a(n) <= N.
%C As a consequence, A309200 is a permutation of the positive integers (since for any n > 0, we have infinitely many multiples of n among the Catalan number, and then the argument used to prove that A111273 is a permutation completes the proof).
%H Rémy Sigrist, <a href="/A309364/b309364.txt">Table of n, a(n) for n = 1..10000</a>
%F a(p) = (p+1)/2 for any prime number p > 3.
%F a(C(k)) = k for k <> 1.
%o (PARI) a(n) = for (k=0, oo, my (c=binomial(2*k, k)/(k+1)); if (c%n==0, return (k)))
%o (Python)
%o from itertools import count
%o def A309364(n):
%o if n == 1: return 0
%o c = 1
%o for k in count(1):
%o if not c%n: return k
%o c = c*((k<<1)+1<<1)//(k+2) # _Chai Wah Wu_, May 04 2023
%Y Cf. A000108, A309200.
%K nonn
%O 1,2
%A _Rémy Sigrist_, Jul 25 2019
|