cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A362532 The smallest positive integer m such that m mod 2k < k for k = 1, 2, 3, ..., n.

Original entry on oeis.org

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

Views

Author

Tomohiro Yamada, Apr 24 2023

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A053664.

Programs

  • 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)<=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

Formula

Trivial bounds: a(n-1) <= a(n) <= 2*A003418(n). - Charles R Greathouse IV, May 08 2023