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!)
A362531 The smallest integer m such that m mod 2k >= k for k = 1, 2, 3, ..., n. 1
1, 3, 3, 15, 15, 47, 95, 95, 287, 335, 1199, 1199, 1295, 2015, 2879, 2879, 2879, 2879, 2879, 2879, 2879, 43199, 211679, 211679, 211679, 211679, 211679, 211679, 211679, 211679, 3084479, 3084479, 3084479, 3084479, 3084479, 3084479, 302702399, 469909439 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Take the square array A(k, l) with k= 1, 2, ... and l = 0, 1, ... such that for each k, A(k, l) takes k zeros and then k ones alternately:
0, 1, 0, 1, 0, 1, 0, 1, ...
0, 0, 1, 1, 0, 0, 1, 1, ...
0, 0, 0, 1, 1, 1, 0, 0, ...
...
Then the a(n)-th column is the first column which begins with n ones.
LINKS
Tomohiro Yamada, Fast Python program, the original program written by nazratt2.
EXAMPLE
a(3) = 3 since 3 mod 2 = 1, 3 mod 4 = 3 >= 2, 3 mod 6 = 3 (but 3 mod 8 = 3 < 4) while 1 mod 4 = 1 < 2, 2 mod 2 = 0 < 1.
PROG
(PARI) a(n)={my(m); m=1; while(vecmin(vector(n, j, (m%(2*j))/j))<1, m=m+1); m}
(PARI) n=1; for(m=1, 10^9, while(vecmin(vector(n, j, (m%(2*j))/j))>=1, print(n, " ", m); n=n+1))
(Python)
def A362531(n):
m = 1
while True:
for k in range(n, 0, -1):
if (l:=k-m%(k<<1))>0:
break
else:
return m
m += l # Chai Wah Wu, Jun 21 2023
CROSSREFS
Cf. A053664.
Sequence in context: A172087 A086116 A100735 * A129356 A290344 A217858
KEYWORD
nonn
AUTHOR
Tomohiro Yamada, Apr 24 2023
EXTENSIONS
a(37)-a(38) from Yifan Xie, Apr 24 2023
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 July 27 16:15 EDT 2024. Contains 374650 sequences. (Running on oeis4.)