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.

A328176 a(n) is the maximal value of the expression d AND (n/d) where d runs through the divisors of n and AND denotes the bitwise AND operator.

This page as a plain text file.
%I A328176 #19 Oct 12 2019 08:34:11
%S A328176 1,0,1,2,1,2,1,0,3,0,1,2,1,2,1,4,1,2,1,4,3,2,1,4,5,0,1,4,1,4,1,0,3,0,
%T A328176 5,6,1,2,1,0,1,6,1,2,3,2,1,4,7,0,1,4,1,2,1,4,3,0,1,4,1,2,1,8,5,2,1,2,
%U A328176 3,4,1,8,1,0,5,2,3,4,1,8,9,0,1,6,1,2,1
%N A328176 a(n) is the maximal value of the expression d AND (n/d) where d runs through the divisors of n and AND denotes the bitwise AND operator.
%H A328176 Rémy Sigrist, <a href="/A328176/b328176.txt">Table of n, a(n) for n = 1..16384</a>
%H A328176 Rémy Sigrist, <a href="/A328176/a328176.png">Scatterplot of the first 2^16 terms</a>
%F A328176 a(n)^2 <= n with equality iff n is a square.
%F A328176 a(n) = 1 for any odd prime number p.
%F A328176 a(n) <= A327987(n).
%F A328176 a(n) = 0 iff n belongs to A327988.
%e A328176 For n = 12:
%e A328176 - we have the following values:
%e A328176     d   12/d  d AND (12/d)
%e A328176     --  ----  ------------
%e A328176      1    12             0
%e A328176      2     6             2
%e A328176      3     4             0
%e A328176      4     3             0
%e A328176      6     2             2
%e A328176     12     1             0
%e A328176 - hence a(12) = max({0, 2}) = 2.
%p A328176 a:= n-> max(map(d-> Bits[And](d, n/d), numtheory[divisors](n))):
%p A328176 seq(a(n), n=1..100);  # _Alois P. Heinz_, Oct 09 2019
%o A328176 (PARI) a(n) = vecmax(apply(d -> bitand(d, n/d), divisors(n)))
%Y A328176 See A328177 and A328178 for similar sequences.
%Y A328176 Cf. A327987, A327988.
%K A328176 nonn,base
%O A328176 1,4
%A A328176 _Rémy Sigrist_, Oct 06 2019