The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A344006 a(n) = m*(m+1)/n, where A344005(n) is the smallest number m such that n divides m*(m+1). 2

%I #15 Jun 04 2021 22:23:24

%S 2,1,2,3,4,1,6,7,8,2,10,1,12,3,2,15,16,4,18,1,2,5,22,3,24,6,26,2,28,1,

%T 30,31,4,8,6,2,36,9,4,6,40,1,42,3,2,11,46,5,48,12,6,3,52,13,2,1,6,14,

%U 58,4,60,15,12,63,10,2,66,4,8,3,70,1,72,18,8,5,6,2,78,3,80,20,82,5

%N a(n) = m*(m+1)/n, where A344005(n) is the smallest number m such that n divides m*(m+1).

%C a(n) = n-1 if n is a prime power. - _Chai Wah Wu_, Jun 04 2021

%H Jon E. Schoenfield, <a href="/A344006/b344006.txt">Table of n, a(n) for n = 1..10000</a>

%o (PARI) a(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m*(m+1)/n))) \\ _Felix Fröhlich_, Jun 04 2021

%o (Python 3.8+)

%o from itertools import combinations

%o from math import prod

%o from sympy import factorint

%o from sympy.ntheory.modular import crt

%o def A344006(n):

%o if n == 1:

%o return 2

%o plist = [p**q for p, q in factorint(n).items()]

%o if len(plist) == 1:

%o return n-1

%o else:

%o m = int(min(min(crt([m,n//m],[0,-1])[0],crt([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))))

%o return m*(m+1)//n # _Chai Wah Wu_, Jun 04 2021

%Y Cf. A011772, A061782, A344005.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Jun 04 2021

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 June 4 22:04 EDT 2024. Contains 373102 sequences. (Running on oeis4.)