[go: up one dir, main page]

login
A362532
The smallest positive integer m such that m mod 2k < k for k = 1, 2, 3, ..., n.
1
2, 4, 8, 8, 24, 24, 72, 144, 144, 144, 384, 384, 2160, 2160, 2160, 6720, 54240, 57600, 131040, 131040, 131040, 131040, 612000, 612000, 612000, 612000, 612000, 776160, 776160, 776160, 6219360, 23184000, 28627200, 28627200, 28627200, 28627200, 28627200
OFFSET
1,1
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 zeros except the 0th column.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..136
Tomohiro Yamada, Fast python program, the original program written by nazratt2.
FORMULA
Trivial bounds: a(n-1) <= a(n) <= 2*A003418(n). - Charles R Greathouse IV, May 08 2023
EXAMPLE
a(2) = 4 since 4 mod 2 = 0, 4 mod 4 = 0 (but 4 mod 6 = 4 >= 3) while 1 mod 2 = 1, 2 mod 4 = 2, 3 mod 2 = 1.
PROG
(PARI) a(n)=my(m); m=1; while(vecmax(vector(n, j, (m%(2*j))/j))>=1, m=m+1); m
(PARI) n=1; for(m=1, 10^9, while(vecmax(vector(n, j, (m%(2*j))/j))<1, print(n, " ", m); n=n+1))
(PARI) a(n, startAt=1)=if(n<5, return(2^min(n, 3))); my(s=if(n>146, 70274254050, n>108, 10039179150, n>94, 436486050, n>65, 22972950, n>50, 417690, n>46, 8190, n>27, 630, n>17, 90, n>12, 30, 6)<<logint(n, 2)); forstep(m=ceil(startAt/s)*s, oo, s, for(k=5, n, if(m%(2*k)>=k, next(2))); return(m)) \\ Charles R Greathouse IV, Apr 28 2023
(Python)
from itertools import count, islice
def agen(): # generator of terms
m = 1
for n in count(1):
while not all(m%(2*k) < k for k in range(1, n+1)): m += 1
yield m
print(list(islice(agen(), 37))) # Michael S. Branicky, Apr 24 2023
CROSSREFS
Cf. A053664.
Sequence in context: A193850 A140119 A273068 * A193846 A255908 A341107
KEYWORD
nonn
AUTHOR
Tomohiro Yamada, Apr 24 2023
STATUS
approved