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

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

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
Showing 1-4 of 4 results.