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.

This page as a plain text file.
%I A082894 #23 Apr 23 2025 11:49:28
%S A082894 2,4,9,16,30,66,126,256,513,1020,2046,4092,8190,16380,32775,65536,
%T A082894 131070,262152,524286,1048580,2097144,4194300,8388606,16777224,
%U A082894 33554425,67108860,134217729,268435468,536870910,1073741820,2147483646
%N A082894 a(n) is the closest number to 2^n which is divisible by n.
%H A082894 G. C. Greubel, <a href="/A082894/b082894.txt">Table of n, a(n) for n = 1..1000</a>
%F A082894 a(n) = n*floor( (floor(n/2)+2^n) / n ).
%e A082894 n=11: 2^11=2048 is between 2046=11.186 and 2035=11.185, closer to a(11)=2046;
%e A082894 Powers of two are fixed points of this map.
%p A082894 A082894:=n->n*floor((floor(n/2)+2^n)/n); seq(A082894(k), k=1..100); # _Wesley Ivan Hurt_, Oct 29 2013
%t A082894 Table[n*Floor[(Floor[n/2]+2^n)/n], {n, 100}]
%o A082894 (PARI) for(n=1,50, print1(n*floor( (floor(n/2)+2^n) / n ), ", ")) \\ _G. C. Greubel_, Aug 08 2017
%o A082894 (Python)
%o A082894 def A082894(n): return (m:=(1<<n)|(n>>1))-m%n # _Chai Wah Wu_, Apr 23 2025
%Y A082894 Cf. A082893, A082895, A082896, A082897, A082898, A082899, A082900.
%K A082894 nonn
%O A082894 1,1
%A A082894 _Labos Elemer_, Apr 22 2003