|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
FORMULA
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|