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-10 of 10 results.

A227872 Number of odious divisors (A000069) of n.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Oct 25 2013

Keywords

Crossrefs

Programs

  • Maple
    A227872 := proc(n)
        option remember ;
        local a,d ;
        a := 0 ;
        for d in numtheory[divisors](n) do
            if not isA001969(d) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A227872(n),n=1..200) ; # R. J. Mathar, Aug 07 2022
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
  • PARI
    a(n) = sumdiv(n, d, hammingweight(d) % 2); \\ Michel Marcus, Feb 06 2016
    
  • PARI
    isod(n) = hammingweight(n) % 2; \\ A000069
    a(n) = my(v=valuation(n, 2)); n >>= v; sumdiv(n,d,isod(d)) * (v+1) \\ David A. Corneth, Jul 23 2022
    
  • Python
    from sympy import divisors
    def c(n): return bin(n).count("1")&1
    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) + A356018(n) = A000005(n).
a(2^n) = n+1. - Bernard Schott, Jul 22 2022
a(n) = 1 iff n is in A093688. - Bernard Schott, Jul 23 2022
a(n) = Sum_{d|n} A010060(d). - Ridouane Oudra, Apr 12 2025

Extensions

More terms from Peter J. C. Moses, Oct 25 2013

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

A330289 Numbers all of whose divisors are odious numbers (A000069) with a record number of divisors.

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, 5055232, 8077888, 10110464, 16155776, 20220928, 32311552, 64623104, 129246208, 258492416, 516984832
Offset: 1

Views

Author

Amiram Eldar, Dec 09 2019

Keywords

Comments

A number m is in this sequence if it is in A093696, and d(m) > d(k) for all terms k < m in A093696, where d(m) is the number of divisors of m (A000005).
The corresponding record numbers of divisors are 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 20, ... (see the link for more values).

Examples

			The first 5 terms of A093696 are 1, 2, 4, 7, 8 and their numbers of divisors are 1, 2, 3, 2, 4. The record values 1, 2, 3, and 4 are reached at 1, 2, 4 and 8 that are the first 4 terms of this sequence.
		

Crossrefs

Subsequence of A000069 and A093696.
Cf. A000005.

Programs

  • Mathematica
    odiousQ[n_] := OddQ @ DigitCount[n, 2][[1]]; allDivOdiousQ[n_] := AllTrue[ Divisors[n], odiousQ]; divNumMax = 0; seq={}; Do[If[allDivOdiousQ[n] && (divNum = DivisorSigma[0, n]) > divNumMax, divNumMax = divNum; AppendTo[seq, n]], {n, 1, 3000}]; seq

A355969 Positions of records in A227872, i.e., integers whose number of odious divisors sets a new record.

Original entry on oeis.org

1, 2, 4, 8, 16, 28, 56, 84, 112, 168, 336, 672, 1344, 2184, 4368, 8736, 17472, 30576, 34944, 41664, 48048, 61152, 80080, 83328, 96096, 122304, 160160, 192192, 240240, 320320, 336336, 480480, 672672, 960960, 1345344, 1681680, 1921920, 2489760, 2690688, 2738736
Offset: 1

Views

Author

Bernard Schott, Jul 22 2022

Keywords

Comments

Corresponding records of number of odious divisors are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...

Examples

			a(7) = 56 is in the sequence because A227872(56) = 8 is larger than any earlier value in A227872.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; fm = -1; s = {}; Do[If[(fn = f[n]) > fm, fm = fn; AppendTo[s, n]], {n, 1, 10^5}]; s (* Amiram Eldar, Jul 22 2022 *)
  • PARI
    lista(nn)= my(list = List(), m=0, new); for (n=1, nn, new = sumdiv(n, d, isod(d)); if (new > m, listput(list, n); m = new);); Vec(list); \\ Michel Marcus, Jul 22 2022
    
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): return bin(n).count("1")&1
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen(record=-1):
        for k in count(1):
            if f(k) > record: record = f(k); yield k
    print(list(islice(agen(), 30))) # Michael S. Branicky, Jul 23 2022

Extensions

More terms from Amiram Eldar, Jul 22 2022

A356020 Positions of records in A356018, i.e., integers whose number of evil divisors sets a new record.

Original entry on oeis.org

1, 3, 6, 12, 18, 30, 60, 90, 120, 180, 360, 540, 720, 1080, 1440, 2160, 3780, 4320, 6120, 7560, 8640, 12240, 15120, 24480, 27720, 30240, 36720, 48960, 50400, 55440, 73440, 83160, 110880, 128520, 138600, 166320, 221760, 257040, 277200, 332640, 471240, 514080, 554400
Offset: 1

Views

Author

Bernard Schott, Jul 24 2022

Keywords

Comments

Corresponding records of number of evil divisors are 0, 1, 2, 3, 4, 6, 9, 10, 12, 15, ...

Examples

			60 is in the sequence because A356018(60) = 9 is larger than any earlier value in A356018.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, EvenQ[DigitCount[#, 2, 1]] &]; fm = -1; s = {}; Do[If[(fn = f[n]) > fm, fm = fn; AppendTo[s, n]], {n, 1, 10^5}]; s (* Amiram Eldar, Jul 24 2022 *)
  • PARI
    upto(n) = my(res = List(), r=-1); forfactored(i=1, n, if(numdiv(i[2]) > r, d = divisors(i[2]); c=sum(j=1, #d, isevil(d[j])); if(c>r, r=c; listput(res,i[1])))); res
    isevil(n) = bitand(hammingweight(n), 1)==0 \\ David A. Corneth, Jul 24 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(record=-1):
        for k in count(1):
            if f(k) > record: record = f(k); yield k
    print(list(islice(agen(), 40))) # Michael S. Branicky, Jul 24 2022

Extensions

More terms from Amiram Eldar, Jul 24 2022

A355968 a(n) is the smallest number that has exactly n odious divisors (A000069).

Original entry on oeis.org

1, 2, 4, 8, 16, 28, 64, 56, 84, 112, 1024, 168, 4096, 448, 336, 728, 36309, 672, 57057, 1456, 1344, 7168, 105105, 2184, 6384, 24150, 5376, 5208, 405405, 4368, 389025, 11648, 20020, 72618, 10416, 8736, 927675, 114114, 48300, 24024, 855855, 17472, 1426425, 40040
Offset: 1

Views

Author

Bernard Schott, Jul 21 2022

Keywords

Comments

a(n) <= 2^(n-1) with equality for n = 1, 2, 3, 4, 5, 7, 11, 13 up to a(44).

Examples

			a(6) = 28 since 28 has 6 divisors {1, 2, 4, 7, 14, 28} that have all an odd number of 1's in their binary expansion: 1, 10, 100, 111, 1110 and 11100; also, no positive integer smaller than 28 has six divisors that are odious.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[20, 10^6] (* Amiram Eldar, Jul 21 2022 *)
  • PARI
    isod(n) = hammingweight(n) % 2; \\ A000069
    a(n) = my(k=1); while (sumdiv(k, d, isod(d)) != n, k++); k; \\ Michel Marcus, Jul 22 2022
    
  • Python
    from sympy import divisors
    from itertools import count, islice
    def c(n): return bin(n).count("1")&1
    def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
    def agen():
        n, adict = 1, 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(), 36))) # Michael S. Branicky, Jul 25 2022

Extensions

More terms from Amiram Eldar, Jul 21 2022

A237417 Numbers that are the product of an odiousfree number and an evilfree number.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 15, 17, 18, 20, 21, 23, 24, 27, 29, 30, 33, 34, 35, 36, 39, 40, 42, 43, 45, 46, 48, 51, 53, 54, 55, 57, 58, 60, 63, 65, 66, 68, 70, 71, 72, 78, 80, 83, 84, 85, 86, 89, 90, 92, 93, 95, 96, 99, 101, 102, 105, 106, 108, 110, 111, 113, 114, 116, 117, 119, 120, 123, 126, 129
Offset: 1

Views

Author

Irina Gerasimova, Feb 23 2014, following a suggestion from Juri-Stepan Gerasimov

Keywords

Comments

Odiousfree*evilfree numbers: numbers of the form odiousfree*evilfree.
Subsequence of this sequence (A237417): numbers that are not the products of two odious numbers or the products of two evil numbers: 3, 5, 6, 10, 12, 17, 20, 23, 24, 29, 33, 34, 39, 40, 43, 46, 48, 57, 58, 63, 65, 66, 68, 71, 78, 80, 83, 86, 89, 92, 95, 101, 105, 106, 111, 113, 114, 116, 119,...
Putting the 1 aside in A093688, these could be called odiousfree numbers, and are a subsequence of A001969. A093696 would be the evilfree numbers then, and are a subsequence of A000069.

Crossrefs

Programs

  • Maple
    N:= 200: # to get all terms <= N
    Ofree:= {$2..N}: Efree:= {$1..N/3}:
    for n from 2 to N do
      t:= convert(convert(n,base,2),`+`) mod 2;
      if t = 0 then Efree:= Efree minus {seq(i,i=n..N/3,n)}
      else Ofree:= Ofree minus {seq(i,i=n..N,n)}
      fi
    od:
    sort(convert(select(`<=`,{seq(seq(s*t,s=Ofree),t=Efree)},N),list)); # Robert Israel, May 09 2019
  • Mathematica
    odFreeQ[n_] := AllTrue[Rest @ Divisors[n], EvenQ[DigitCount[#, 2, 1]] &]; evFreeQ[n_] := AllTrue[Divisors[n], OddQ[DigitCount[#, 2, 1]] &]; m = 100; o = Select[Range[2, m], odFreeQ]; e = Select[Range[m], evFreeQ]; Union @ Select[Times @@@ Tuples[{o, e}], # <= m &] (* Amiram Eldar, Oct 16 2020 *)
  • PARI
    isA093696(n)= fordiv(n, d, if(hammingweight(d)%2==0, return(0))); 1;
    isA093688(n)= if (n==1, 0, sumdiv(n, d, hammingweight(d)%2)==1);
    lista(nn) = {vn = vector(2*nn, i, i); vof = select(n->isA093696(n), vn); vef = select(n->isA093688(n), vn); vp = []; for (i = 1, #vof, for (j = 1, #vef, vp = Set(concat(vp, vof[i]*vef[j])););); for (i = 1, #vp, if (vp[i] <= nn, print1(vp[i], ", ")););} \\ Michel Marcus, Mar 05 2014

Formula

a(n) = A093688(k+1)*A093696(m).

Extensions

Definition corrected by Jon E. Schoenfield, Feb 26 2014

A238989 Numbers that are not odiousfree*evilfree. The complement of A237417.

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 22, 25, 26, 28, 31, 32, 37, 38, 41, 44, 47, 49, 50, 52, 56, 59, 61, 62, 64, 67, 69, 73, 74, 75, 76, 77, 79, 81, 82, 87, 88, 91, 94, 97, 98, 100, 103, 104, 107, 109, 112, 115, 118, 121, 122, 124, 125, 127, 128
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 08 2014

Keywords

Crossrefs

Cf. A000069 (odious numbers), A001969 (evil numbers), A093688 (1 together with odiousfree numbers), A093696 (evilfree numbers), A237417 (odiousfree*evilfree numbers).

Programs

  • Mathematica
    odFreeQ[n_] := AllTrue[Rest @ Divisors[n], EvenQ[DigitCount[#, 2, 1]] &]; evFreeQ[n_] := AllTrue[Divisors[n], OddQ[DigitCount[#, 2, 1]] &]; m = 100; o = Select[Range[2, m], odFreeQ]; e = Select[Range[m], evFreeQ]; Complement[Range[m], Union @ Select[Times @@@ Tuples[{o, e}], # <= m &]] (* Amiram Eldar, Oct 16 2020 *)

A331832 Numbers k such that all the divisors of k have an odd number of 1's in their negabinary representations.

Original entry on oeis.org

1, 3, 9, 11, 23, 29, 33, 41, 43, 47, 53, 59, 69, 71, 83, 89, 101, 103, 109, 113, 129, 131, 137, 139, 149, 151, 157, 163, 181, 191, 197, 199, 211, 227, 233, 239, 249, 251, 263, 269, 281, 283, 293, 307, 311, 317, 331, 349, 353, 367, 373, 379, 383, 389, 397, 401
Offset: 1

Views

Author

Amiram Eldar, Jan 28 2020

Keywords

Examples

			9 is a term since all of its divisors, 1, 3 and 9, or 1, 111, and 11001 in negabinary representation, have an odd number of 1's.
		

Crossrefs

Subsequence of A268273.

Programs

  • Mathematica
    negaBinWt[n_] := negaBinWt[n] = If[n==0, 0, negaBinWt[Quotient[n-1, -2]] + Mod[n, 2]]; odNegaBinQ[n_] := OddQ[negaBinWt[n]]; seqQ[n_] := AllTrue[Divisors[n], odNegaBinQ]; Select[Range[401],seqQ]
Showing 1-10 of 10 results.