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 12 results. Next

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

A357761 a(n) = A227872(n) - A356018(n).

Original entry on oeis.org

1, 2, 0, 3, 0, 0, 2, 4, -1, 0, 2, 0, 2, 4, -2, 5, 0, -2, 2, 0, 2, 4, 0, 0, 1, 4, -2, 6, 0, -4, 2, 6, 0, 0, 2, -3, 2, 4, 0, 0, 2, 4, 0, 6, -4, 0, 2, 0, 3, 2, -2, 6, 0, -4, 2, 8, 0, 0, 2, -6, 2, 4, 0, 7, 0, 0, 2, 0, 0, 4, 0, -4, 2, 4, -2, 6, 2, 0, 2, 0, -1, 4, 0
Offset: 1

Views

Author

Amiram Eldar, Oct 12 2022

Keywords

Comments

The excess of the number of odious (A000069) divisors of n over the number of evil (A001969) divisors of n.
Every integer occurs in this sequence.

Crossrefs

Cf. A000005, A000069, A000290 (positions of odd terms), A001969, A027697, A027699, A106400, A227872, A230851 (positions of 0's), A356018, A357762.
Similar sequences: A046660, A048272.

Programs

  • Mathematica
    a[n_] := -DivisorSum[n, (-1)^DigitCount[#, 2, 1] &]; Array[a, 100]
  • PARI
    a(n) = -sumdiv(n, d, (-1)^hammingweight(d));

Formula

a(n) = -Sum_{d|n} A106400(d).
a(n) = A000005(n) - 2*A356018(n).
a(n) = 2*A227872(n) - A000005(n).
a(n) = 0 iff n is in A230851.
a(n) == 1 (mod 2) iff n is a square (A000290).
a(2^n) = n + 1.
a(p*2^n) = 0 when p is an evil prime (A027699).
a(p^2*2^n) = n + 1 when p is an evil prime (A027699) and p^2 is odious, and when p is an odd odious prime (A027697) and p^2 is evil.
a(p^2*2^n) = -(n+1) when p is an evil prime and p^2 is also evil.
a(p^2*2^n) = 3*(n+1) when p is an odd odious prime and p^2 is also odious.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = -Sum_{k>=1} A106400(k)/k = 1.196283264... (A357762).

A356040 a(n) is the smallest integer that has exactly n odious divisors (A227872) and n evil divisors (A356018).

Original entry on oeis.org

3, 6, 12, 24, 48, 96, 192, 210, 252, 528, 3072, 420, 12288, 2112, 1008, 840, 196608, 2016, 786432, 1680, 4032, 33792, 12582912, 3360, 30000, 135168, 16128, 6720, 805306368, 19152, 3221225472, 13440, 64512, 2162688, 120000, 26880, 206158430208, 8650752, 258048, 31920
Offset: 1

Views

Author

Bernard Schott, Jul 24 2022

Keywords

Comments

As the number of divisors is even, there is no square in the sequence.

Examples

			48 has ten divisors, five of which are odious {1, 2, 4, 8, 16} as they have an odd number of 1's in their binary expansion: 1, 10, 100, 1000 and 10000; the five other divisors are evil {3, 6, 12, 24, 48} as they have an even number of 1's in their binary expansion: 11, 110, 1100, 11000 and 110000; also, no positive integer smaller than 48 has five divisors that are evil and five divisors that are odious, hence a(5) = 48.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, {1, (-1)^DigitCount[#, 2][[1]]} &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i, d}, While[c < len && n < nmax, i = f[n]; If[i[[2]] == 0, d = i[[1]]/2; If[d <= len && s[[d]] == 0, c++; s[[d]] = n]]; n++]; s]; seq[16, 10^6] (* Amiram Eldar, Jul 24 2022 *)
  • PARI
    a(n) = if(isprime(n), return(2^(n-1)*3)); forfactored(i=1, 2^(n-1)*3, if(numdiv(i[2]) == 2*n, d=divisors(i[2]); if(sum(j=1, #d, isevil(d[j])) == n, return(i[1]))))
    isevil(n) = bitand(hammingweight(n), 1) == 0 \\ David A. Corneth, Jul 24 2022
    
  • Python
    from sympy import divisors, isprime
    from itertools import count, islice
    def f(n):
        counts = [0, 0]
        for d in divisors(n, generator=True):
            counts[bin(d).count("1")&1] += 1
        return counts[0] if counts[0] == counts[1] else -1
    def a(n):
        if isprime(n): return 2**(n-1) * 3
        return next(k for k in count(1) if f(k) == n)
    print([a(n) for n in range(1, 34)]) # Michael S. Branicky, Jul 24 2022

Formula

a(n) <= 2^(n-1) * 3.
a(n) = 2^(n-1) * 3 if n is prime. - David A. Corneth, Jul 24 2022
a(n) >= A005179(2*n). - Michael S. Branicky, Jul 24 2022

Extensions

a(9)-a(37) from Amiram Eldar, Jul 24 2022
a(38)-a(40) from David A. Corneth, Jul 24 2022

A093696 Numbers n such that all divisors of n have an odd number of 1's in their binary expansions.

Original entry on oeis.org

1, 2, 4, 7, 8, 11, 13, 14, 16, 19, 22, 26, 28, 31, 32, 37, 38, 41, 44, 47, 49, 52, 56, 59, 61, 62, 64, 67, 73, 74, 76, 79, 82, 88, 91, 94, 97, 98, 103, 104, 107, 109, 112, 118, 121, 122, 124, 127, 128, 131, 133, 134, 137, 143, 146, 148, 151, 152, 157, 158, 164, 167, 173
Offset: 1

Views

Author

Jason Earls, May 16 2004

Keywords

Comments

Subsequence of A000069. - Michel Marcus, Feb 09 2014
Numbers all of whose divisors are odious. - Bernard Schott, Jul 22 2022

Examples

			14 is in the sequence because its divisors are [1, 2, 7, 14] and in binary: 1, 10, 111 and 1110, all have an odd number of 1's.
		

Crossrefs

Similar sequences: A062687, A190217, A337741, A337941, A355596.
A000079 is a subsequence.

Programs

  • Maple
    isA001969 := proc(n)
        if wt(n) mod 2 = 0 then
            true;
        else
            false;
        end if;
    end proc:
    isA093696 := proc(n)
        for d in numtheory[divisors](n) do
            if isA001969(d) then
                return false;
            end if;
        end do;
        true;
    end proc:
    for n from 1 to 200 do
        if isA093696(n) then
            printf("%d,",n);
        end if;
    end do: # R. J. Mathar, Feb 13 2014
  • Mathematica
    odiousQ[n_] := OddQ @ DigitCount[n, 2][[1]]; Select[Range[200], AllTrue[ Divisors[#], odiousQ ] &] (* Amiram Eldar, Dec 09 2019 *)
  • PARI
    is(n)=fordiv(n,d,if(hammingweight(d)%2==0, return(0))); 1 \\ Charles R Greathouse IV, Mar 29 2013
    
  • Python
    from sympy import divisors, isprime
    def c(n): return bin(n).count("1")&1
    def ok(n): return n > 0 and all(c(d) for d in divisors(n, generator=True))
    print([k for k in range(174) if ok(k)]) # Michael S. Branicky, Jul 24 2022

Formula

{n: A356018(n) =0 }. - R. J. Mathar, Aug 07 2022

A227891 Numbers for which the number of odious proper divisors (A000069) equals the number of evil proper divisors (A001969).

Original entry on oeis.org

1, 9, 25, 289, 441, 529, 625, 841, 1849, 2809, 3249, 5041, 6889, 7225, 7569, 7921, 10201, 12769, 15129, 15625, 19321, 21025, 22201, 26569, 31329, 38809, 46225, 48841, 53361, 55225, 66049, 69169, 72361, 76729, 78961, 83521, 85849, 93025, 96721, 100489, 103041
Offset: 1

Views

Author

Keywords

Comments

All terms are odd squares (see Shevelev links).

Examples

			1 has no proper divisors, so it is in the sequence.
9 has two proper divisors 1 (odious) and 3 (evil). Thus 9 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    isQ[n_] := Sum[Switch[Mod[Total[IntegerDigits[d, 2]], 2], 0, 1, 1, -1], {d, Most[Divisors[n]]}] == 0; Select[(2*Range[200]-1)^2, isQ] (* Jean-François Alcover, Dec 04 2015 *)
  • PARI
    is(n)=sumdiv(n,d,(-1)^hammingweight(d))==(-1)^hammingweight(n)
    select(is, vector(10^4,i,(2*i-1)^2)) \\ Charles R Greathouse IV, Oct 26 2013
    
  • PARI
    c=0; forstep(i=1, 8135, 2, n=i^2; nd=numdiv(n); d=divisors(n); ce=0; co=0; for(j=1, nd-1, if(hammingweight(d[j])%2==0, ce++, co++)); if(ce==co, c++; write("b227891.txt", c " " n))) \\ Donovan Johnson, Oct 30 2013

Formula

Common value for numbers of considered divisors is (A000005(a(n))-1)/2.

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

A227873 Sum of odious divisors of n. See A000069 for odious numbers.

Original entry on oeis.org

1, 3, 1, 7, 1, 3, 8, 15, 1, 3, 12, 7, 14, 24, 1, 31, 1, 3, 20, 7, 29, 36, 1, 15, 26, 42, 1, 56, 1, 3, 32, 63, 12, 3, 43, 7, 38, 60, 14, 15, 42, 87, 1, 84, 1, 3, 48, 31, 57, 78, 1, 98, 1, 3, 67, 120, 20, 3, 60, 7, 62, 96, 29, 127, 14, 36, 68, 7, 70, 129, 1, 15
Offset: 1

Views

Author

Vladimir Shevelev, Oct 25 2013

Keywords

Comments

Sum of evil divisors of n is A000203(n) - a(n) = A260934(n). See A001969 for evil numbers.

Crossrefs

Programs

  • Maple
    A227873 := proc(n)
        option remember ;
        local a,d ;
        a := 0 ;
        for d in numtheory[divisors](n) do
            if not isA001969(d) then
                a := a+d ;
            end if;
        end do:
        a ;
    end proc:
    seq(A227873(n),n=1..200) ; # R. J. Mathar, Aug 17 2022
  • Mathematica
    Total[Select[Divisors@ #, OddQ@ First@ DigitCount[#, 2] &]] & /@ Range@ 72 (* Michael De Vlieger, Aug 04 2015 *)
  • PARI
    a(n) = sumdiv(n, d, d*(hammingweight(d) % 2)); \\ Michel Marcus, Aug 04 2015

Formula

a(n) = Sum_{d|n} A102392(d). - Ridouane Oudra, Apr 19 2025

Extensions

More terms from Peter J. C. Moses
Minor changes. - Wolfdieter Lang, Aug 23 2015

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

A230851 Numbers with divisors which are half odious (A000069) and half evil (A001969).

Original entry on oeis.org

3, 5, 6, 10, 12, 17, 20, 23, 24, 29, 33, 34, 39, 40, 43, 46, 48, 53, 57, 58, 63, 65, 66, 68, 69, 71, 78, 80, 83, 86, 87, 89, 92, 95, 96, 101, 105, 106, 111, 113, 114, 115, 116, 117, 119, 123, 125, 126, 130, 132, 136, 138, 139, 141, 142, 145, 149, 156, 160, 163, 166, 171, 172, 174, 177, 178, 183
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 31 2013

Keywords

Crossrefs

Programs

  • Mathematica
    aQ[n_] := DivisorSum[n, (-1)^DigitCount[#, 2][[1]] &] == 0; Select[Range[200], aQ] (* Amiram Eldar, Sep 23 2019 *)
  • PARI
    is(n)=!sumdiv(n,d,(-1)^hammingweight(d)) \\ Charles R Greathouse IV, Oct 31 2013

Formula

Numbers n such that d(n) = 2*A227872(n) where A227872(n) is number of odious divisors of n.

Extensions

Corrected by Charles R Greathouse IV, Oct 31 2013

A290090 a(n) is the number of proper divisors of n that are odious (A000069).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 03 2017

Keywords

Comments

If n is odd and k >= 1, then a(2^k*n) = (k+1)*n+k if n is in A000069 and (k+1)*n if n is not in A000069. - Robert Israel, Oct 03 2017

Examples

			For n = 55 whose proper divisors are 1, 5 and 11 (in binary "1", "101" and "1011"), only 1 and 11 have an odd number of 1's in their binary representations, thus a(55) = 2.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) nops(select(t -> convert(convert(t,base,2),`+`)::odd, numtheory:-divisors(n) minus {n})) end proc:
    map(f, [$1..200]); # Robert Israel, Oct 03 2017
  • Mathematica
    Table[DivisorSum[n, 1 &, And[OddQ@ DigitCount[#, 2, 1], # < n] &], {n, 120}] (* Michael De Vlieger, Oct 03 2017 *)
  • PARI
    A290090(n) = sumdiv(n,d,(d
    				

Formula

a(n) = Sum_{d|n, dA010060(d).
a(n) = A227872(n) - A010060(n).
a(n) = A007814(A293231(n)).
A000035(a(n)) = A000035(A292257(n)). [Parity-wise equivalent with A292257.]
Showing 1-10 of 12 results. Next