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.

A321366 a(n) is the least integer k greater than 1 such that n divides binomial(k, 2) = A000217(k-1).

This page as a plain text file.
%I A321366 #33 Jun 04 2021 02:34:40
%S A321366 2,4,3,8,5,4,7,16,9,5,11,9,13,8,6,32,17,9,19,16,7,12,23,16,25,13,27,8,
%T A321366 29,16,31,64,12,17,15,9,37,20,13,16,41,21,43,33,10,24,47,33,49,25,18,
%U A321366 40,53,28,11,49,19,29,59,16,61,32,28,128,26
%N A321366 a(n) is the least integer k greater than 1 such that n divides binomial(k, 2) = A000217(k-1).
%H A321366 Kevin Long, <a href="/A321366/b321366.txt">Table of n, a(n) for n = 1..10000</a>
%H A321366 Kevin Long, <a href="https://repl.it/@Toncas/Triangular-Numbers-Divisibility-OEIS">Python code for sequence</a>
%F A321366 a(n) = A011772(n) + 1.
%F A321366 a(2^n) = 2^(n+1).
%F A321366 a(p^n) = p^n for odd primes p.
%o A321366 (PARI) a(n) = {my(s=1, k=2); while(s%n, s+=k; k++); k} \\ _Andrew Howroyd_, Aug 27 2019
%o A321366 (Python 3.8+)
%o A321366 from itertools import combinations
%o A321366 from math import prod
%o A321366 from sympy import factorint, divisors
%o A321366 from sympy.ntheory.modular import crt
%o A321366 def A321366(n):
%o A321366     plist = [p**q for p, q in factorint(2*n).items()]
%o A321366     if len(plist) == 1:
%o A321366         return int((2 - plist[0] % 2)*n)
%o A321366     return 1+int(min(min(crt([m,2*n//m],[0,-1])[0],crt([2*n//m,m],[0,-1])[0]) for m in (prod(d) for l in range(1,len(plist)//2+1) for d in combinations(plist,l)))) # _Chai Wah Wu_, Jun 03 2021
%Y A321366 Cf. A000217, A011772, A292787.
%K A321366 nonn,easy
%O A321366 1,1
%A A321366 _Kevin Long_, Aug 27 2019