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.

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