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-6 of 6 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

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

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

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