login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A321366 a(n) is the least integer k greater than 1 such that n divides binomial(k, 2) = A000217(k-1). 1
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, 29, 16, 31, 64, 12, 17, 15, 9, 37, 20, 13, 16, 41, 21, 43, 33, 10, 24, 47, 33, 49, 25, 18, 40, 53, 28, 11, 49, 19, 29, 59, 16, 61, 32, 28, 128, 26 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = A011772(n) + 1.
a(2^n) = 2^(n+1).
a(p^n) = p^n for odd primes p.
PROG
(PARI) a(n) = {my(s=1, k=2); while(s%n, s+=k; k++); k} \\ Andrew Howroyd, Aug 27 2019
(Python 3.8+)
from itertools import combinations
from math import prod
from sympy import factorint, divisors
from sympy.ntheory.modular import crt
def A321366(n):
plist = [p**q for p, q in factorint(2*n).items()]
if len(plist) == 1:
return int((2 - plist[0] % 2)*n)
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
CROSSREFS
Sequence in context: A051145 A288966 A057495 * A180246 A329146 A246367
KEYWORD
nonn,easy
AUTHOR
Kevin Long, Aug 27 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 04:14 EDT 2024. Contains 371918 sequences. (Running on oeis4.)