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.

A096157 Numbers whose numbers of odd and even proper divisors differ at most by 1.

This page as a plain text file.
%I A096157 #18 Dec 16 2021 07:30:51
%S A096157 1,2,3,4,5,6,7,8,10,11,12,13,14,17,18,19,20,22,23,26,28,29,30,31,34,
%T A096157 37,38,41,42,43,44,46,47,50,52,53,54,58,59,61,62,66,67,68,70,71,73,74,
%U A096157 76,78,79,82,83,86,89,90,92,94,97,98,101,102,103,106,107,109,110,113
%N A096157 Numbers whose numbers of odd and even proper divisors differ at most by 1.
%C A096157 A union of 1, 4, primes, quadrupled primes, and all numbers of the form 4k+2. - _Ivan Neretin_, Aug 12 2015
%H A096157 Robert Israel, <a href="/A096157/b096157.txt">Table of n, a(n) for n = 1..10000</a>
%F A096157 Abs(A032741(a(n)) - 2*A091954(a(n))) <= 1.
%e A096157 Proper divisors of 42 are {1,2,3,6,7,14,21}: 4=#{1,3,7,21} are odd and 3=#{2,6,14} are even, as abs(4-3)=1, 42 is a term.
%p A096157 filter:= n -> if n::odd then isprime(n) elif n mod 4 = 0 then isprime(n/4) else true fi:
%p A096157 filter(1):= true: filter(4):= true:
%p A096157 select(filter, [$1..1000]); # _Robert Israel_, Aug 12 2015
%t A096157 okQ[n_] := With[{dd = Most[Divisors[n]]},
%t A096157      Abs[2 Count[dd, _?OddQ] - Length[dd]] <= 1];
%t A096157 Select[Range[1000], okQ] (* _Jean-François Alcover_, Dec 16 2021 *)
%o A096157 (PARI) is(n)=if(bittest(n,0),isprime(n),bittest(n,1)||isprime(n>>2))||n<9 \\ _M. F. Hasler_, Aug 13 2015
%Y A096157 Cf. A032741, A091954.
%K A096157 nonn
%O A096157 1,2
%A A096157 _Reinhard Zumkeller_, Jun 18 2004