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.

A082894 a(n) is the closest number to 2^n which is divisible by n.

Original entry on oeis.org

2, 4, 9, 16, 30, 66, 126, 256, 513, 1020, 2046, 4092, 8190, 16380, 32775, 65536, 131070, 262152, 524286, 1048580, 2097144, 4194300, 8388606, 16777224, 33554425, 67108860, 134217729, 268435468, 536870910, 1073741820, 2147483646
Offset: 1

Views

Author

Labos Elemer, Apr 22 2003

Keywords

Examples

			n=11: 2^11=2048 is between 2046=11.186 and 2035=11.185, closer to a(11)=2046;
Powers of two are fixed points of this map.
		

Crossrefs

Programs

  • Maple
    A082894:=n->n*floor((floor(n/2)+2^n)/n); seq(A082894(k), k=1..100); # Wesley Ivan Hurt, Oct 29 2013
  • Mathematica
    Table[n*Floor[(Floor[n/2]+2^n)/n], {n, 100}]
  • PARI
    for(n=1,50, print1(n*floor( (floor(n/2)+2^n) / n ), ", ")) \\ G. C. Greubel, Aug 08 2017
    
  • Python
    def A082894(n): return (m:=(1<>1))-m%n # Chai Wah Wu, Apr 23 2025

Formula

a(n) = n*floor( (floor(n/2)+2^n) / n ).