|
|
A011772
|
|
Smallest number m such that m(m+1)/2 is divisible by n.
|
|
82
|
|
|
1, 3, 2, 7, 4, 3, 6, 15, 8, 4, 10, 8, 12, 7, 5, 31, 16, 8, 18, 15, 6, 11, 22, 15, 24, 12, 26, 7, 28, 15, 30, 63, 11, 16, 14, 8, 36, 19, 12, 15, 40, 20, 42, 32, 9, 23, 46, 32, 48, 24, 17, 39, 52, 27, 10, 48, 18, 28, 58, 15, 60, 31, 27, 127, 25, 11, 66, 16, 23, 20, 70, 63, 72, 36, 24
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The graph of the function is split into rays of which the densest ones are y(n) = n-1 = a(n) iff n is an odd prime power, and y(n) = n/2 = a(n) or a(n)+1 if n = 8k-2 (except for k = 9, 10, 14, 16, 19, 24, ...) or 8k+2 (except for k = 8, 11, 16, 17, 19, 26, 33, ...). The next most-frequent rays are similar: y(n) = n/r for r = 3, 4, 5, ... and r = 4/3, etc. - M. F. Hasler, May 30 2021
|
|
LINKS
|
|
|
FORMULA
|
a(n) < n-1 for all n except the prime powers where a(n) = n-1 (n odd) or 2n-1 (n = 2^k). - M. F. Hasler, May 30 2021
a(n) = 2*n-1 iff n is a power of 2. - Shu Shang, Aug 01 2022
|
|
MATHEMATICA
|
Table[m := 1; While[Not[IntegerQ[(m*(m + 1))/(2n)]], m++ ]; m, {n, 1, 90}] (* Stefan Steinerberger, Apr 03 2006 *)
(Sqrt[1+8#]-1)/2&/@Flatten[With[{r=Accumulate[Range[300]]}, Table[ Select[r, Divisible[#, n]&, 1], {n, 80}]]] (* Harvey P. Dale, Feb 05 2012 *)
|
|
PROG
|
(Haskell)
import Data.List (findIndex)
import Data.Maybe (fromJust)
a011772 n = (+ 1) $ fromJust $
findIndex ((== 0) . (`mod` n)) $ tail a000217_list
(PARI) a(n)=if(n==1, return(1)); my(f=factor(if(n%2, n, 2*n)), step=vecmax(vector(#f~, i, f[i, 1]^f[i, 2]))); forstep(m=step, 2*n, step, if(m*(m-1)/2%n==0, return(m-1)); if(m*(m+1)/2%n==0, return(m))) \\ Charles R Greathouse IV, Jun 25 2017
(Python 3.8+)
from math import isqrt
m = (isqrt(8*n+1)-1)//2
while (m*(m+1)) % (2*n):
m += 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
Kenichiro Kashihara (Univxiq(AT)aol.com)
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|