OFFSET
1,2
COMMENTS
We can always find a value for a(n). It is an elementary consequence of Fermat's little theorem, Hensel's lemma, and the Chinese remainder theorem, that more generally for every pair of positive integers u,v there exist x,y such that x*u = (2^y - 1)*2^v. - Fred Lunnon, Dec 26 2021 in SeqFan
EXAMPLE
2^5 + 16*30 = 512, so a(5) = 16.
MATHEMATICA
a[n_] := Module[{ob = n*(n + 1), pow = 2^n, k = n + 1}, While[! Divisible[2^k - pow, ob], k++]; (2^k - pow)/ob]; Array[a, 25] (* Amiram Eldar, Dec 26 2021 *)
PROG
(Python)
def A350329(n):
a, b, c = 2**n, n*(n+1), 2**(n+1)
while (x := divmod(c-a, b))[1] != 0:
c *= 2
return x[0] # Chai Wah Wu, Jan 07 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ali Sada, Dec 26 2021
EXTENSIONS
More terms from Amiram Eldar, Dec 26 2021
STATUS
approved