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.

Showing 1-5 of 5 results.

A093688 Numbers m such that all divisors of m, excluding the divisor 1, have an even number of 1's in their binary expansions.

Original entry on oeis.org

1, 3, 5, 9, 15, 17, 23, 27, 29, 43, 45, 51, 53, 71, 83, 85, 89, 101, 113, 129, 135, 139, 149, 153, 159, 163, 197, 215, 249, 255, 257, 263, 267, 269, 277, 281, 293, 303, 311, 317, 337, 347, 349, 353, 359, 373, 383, 387, 389, 401, 417, 447, 449, 459, 461, 467, 479
Offset: 1

Views

Author

Jason Earls, May 16 2004

Keywords

Comments

Putting the 1 aside, these could be called odiousfree numbers, and are a subsequence of A001969. A093696 would be the evilfree numbers then. - Irina Gerasimova, Feb 08 2014.
Equivalently, numbers all of whose divisors > 1 are evil (A001969). - Bernard Schott, Jul 24 2022

Examples

			51 is in the sequence because, excluding 1, its divisors are 3, 17 and 51.
In binary: 11, 10001, 110011 all have an even number of 1's.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_] := AllTrue[Rest[Divisors[n]], EvenQ[Total[IntegerDigits[#, 2]]]&]; Select[Range[500], okQ] (* Jean-François Alcover, Dec 06 2015 *)
  • PARI
    is(n)=sumdiv(n,d,hammingweight(d)%2)==1 \\ Charles R Greathouse IV, Mar 28 2013
    
  • Python
    from sympy import divisors
    def c(n): return n == 1 or bin(n).count("1")&1 == 0
    def ok(n): return n > 0 and all(c(d) for d in divisors(n, generator=True))
    print([k for k in range(480) if ok(k)]) # Michael S. Branicky, Jul 24 2022

Extensions

a(1) added by Charles R Greathouse IV, Mar 28 2013

A356018 a(n) is the number of evil divisors (A001969) of n.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 0, 2, 2, 0, 3, 0, 0, 3, 0, 1, 4, 0, 3, 1, 0, 1, 4, 1, 0, 3, 0, 1, 6, 0, 0, 2, 2, 1, 6, 0, 0, 2, 4, 0, 2, 1, 0, 5, 2, 0, 5, 0, 2, 3, 0, 1, 6, 1, 0, 2, 2, 0, 9, 0, 0, 3, 0, 2, 4, 0, 3, 2, 2, 1, 8, 0, 0, 4, 0, 1, 4, 0, 5, 3, 0, 1, 3, 3, 2
Offset: 1

Views

Author

Bernard Schott, Jul 23 2022

Keywords

Comments

a(n) = 0 iff n is in A093696.

Examples

			12 has 6 divisors: {1, 2, 3, 4, 6, 12} of which three {3, 6, 12} have an even number of 1's in their binary expansion with 11, 110 and 11100 respectively; hence a(12) = 3.
		

Crossrefs

Cf. A000005, A001969, A093688, A093696 (location of 0s), A227872, A356019, A356020.
Similar sequences: A083230, A087990, A087991, A332268, A355302.

Programs

  • Maple
    A356018 := proc(n)
        local a,d ;
        a := 0 ;
        for d in numtheory[divisors](n) do
            if isA001969(d) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A356018(n),n=1..200) ;  # R. J. Mathar, Aug 07 2022
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, EvenQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
  • PARI
    a(n) = my(v = valuation(n, 2)); n>>=v; d=divisors(n); sum(i=1, #d, bitand(hammingweight(d[i]), 1) == 0) * (v+1) \\ David A. Corneth, Jul 23 2022
  • Python
    from sympy import divisors
    def c(n): return bin(n).count("1")&1 == 0
    def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 23 2022
    

Formula

a(n) = A000005(n) - A227872(n).

Extensions

More terms from David A. Corneth, Jul 23 2022

A356019 a(n) is the smallest number that has exactly n evil divisors (A001969).

Original entry on oeis.org

1, 3, 6, 12, 18, 45, 30, 135, 72, 60, 90, 765, 120, 1575, 270, 180, 600, 3465, 480, 13545, 360, 540, 1530, 10395, 1260, 720, 3150, 1980, 1080, 49725, 1440, 45045, 2520, 3060, 6930, 2160, 3780, 58905, 27090, 6300, 5040, 184275, 4320, 135135, 6120, 7920, 20790, 329175, 7560, 8640
Offset: 0

Views

Author

Bernard Schott, Jul 23 2022

Keywords

Comments

Differs from A327328 since a(7) = 135 while A327328(7) = 105.

Examples

			a(4) = 18 since 18 has six divisors: {1, 2, 3, 6, 9, 18} of which four {3, 6, 9, 18} have an even number of 1's in their binary expansion: 11, 110, 1001 and 10010 respectively; also, no positive integer smaller than 18 has exactly four divisors that are evil.
		

Crossrefs

Programs

  • Maple
    # output in unsorted b-file style
    A356019_list := [seq(0,i=1..1000)] ;
    for n from 1 do
        evd := A356018(n) ;
        if evd < nops(A356019_list) then
            if op(evd+1,A356019_list) <= 0 then
                printf("%d %d\n",evd,n) ;
                A356019_list := subsop(evd+1=n,A356019_list) ;
            end if;
        end if;
    end do:  # R. J. Mathar, Aug 07 2022
  • Mathematica
    f[n_] := DivisorSum[n, 1 &, EvenQ[DigitCount[#, 2, 1]] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] + 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[50, 10^6] (* Amiram Eldar, Jul 23 2022 *)
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): return bin(n).count("1")&1 == 0
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen():
        n, adict = 0, dict()
        for k in count(1):
            fk = f(k)
            if fk not in adict: adict[fk] = k
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 50))) # Michael S. Branicky, Jul 23 2022

Formula

a(n) <= A356040(n). - David A. Corneth, Jul 26 2022

Extensions

More terms from Amiram Eldar, Jul 23 2022

A357763 Numbers m such that A357761(m) > A357761(k) for all k < m.

Original entry on oeis.org

1, 2, 4, 8, 16, 28, 56, 112, 224, 448, 728, 1456, 2912, 5824, 10192, 11648, 20384, 27664, 40768, 55328, 110656, 221312, 442624, 885248, 1263808, 1770496, 2527616, 3430336, 5055232, 6860672, 10110464, 13721344, 16155776, 20220928, 24012352, 32311552, 48024704
Offset: 1

Views

Author

Amiram Eldar, Oct 12 2022

Keywords

Comments

First differs from A330289 at n = 28.
Since A357761(2^n) = n + 1, A357761 is unbounded and this sequence is infinite.
The corresponding record values are 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 20, 24, 28, 30, 32, ... .

Crossrefs

Programs

  • Mathematica
    f[n_] := -DivisorSum[n, (-1)^DigitCount[#, 2, 1] &]; fm = 0; s = {}; Do[f1 = f[n]; If[f1 > fm, fm = f1; AppendTo[s, n]], {n, 1, 10^5}]; s
  • PARI
    f(n) = -sumdiv(n, d, (-1)^hammingweight(d));
    lista(nmax) = {my(fm = 0); for(n = 1, nmax, f1 = f(n); if(f1 > fm, fm = f1; print1(n, ", ")))};

A357764 Numbers m such that A357761(m) < A357761(k) for all k < m.

Original entry on oeis.org

1, 3, 9, 15, 30, 60, 90, 180, 360, 540, 720, 1080, 2160, 4320, 6120, 8640, 12240, 18360, 24480, 36720, 73440, 146880, 257040, 293760, 514080, 587520, 807840, 1028160, 1615680, 1884960, 2056320, 2827440, 3231360, 3769920, 5654880, 7539840, 9424800, 11309760, 18849600
Offset: 1

Views

Author

Amiram Eldar, Oct 12 2022

Keywords

Comments

Since A357761(15*2^n) = -2*(n+1), A357761 is unbounded from below and this sequence is infinite.
The corresponding records of low value are 1, 0, -1, -2, -4, -6, -8, -12, -16, -18, -20, -24, -30, -36, ... .

Crossrefs

Programs

  • Mathematica
    f[n_] := -DivisorSum[n, (-1)^DigitCount[#, 2, 1] &]; fm = 2; s = {}; Do[f1 = f[n]; If[f1 < fm, fm = f1; AppendTo[s, n]], {n, 1, 10^5}]; s
  • PARI
    f(n) = -sumdiv(n, d, (-1)^hammingweight(d));
    lista(nmax) = {my(fm = 2); for(n = 1, nmax, f1 = f(n); if(f1 < fm, fm = f1; print1(n, ", ")))};
Showing 1-5 of 5 results.