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

A306263 Numbers k such that, for any divisor d of k, the Hamming weight of d divides k.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 32, 34, 36, 40, 42, 48, 60, 64, 66, 68, 72, 80, 84, 92, 96, 108, 116, 120, 126, 128, 132, 136, 144, 156, 160, 168, 172, 180, 184, 192, 204, 212, 216, 222, 228, 232, 240, 246, 252, 256, 264, 272, 276, 284, 288, 300, 310
Offset: 1

Views

Author

Rémy Sigrist, Mar 02 2019

Keywords

Comments

The Hamming weight of a number is given by A000120.
This sequence is a binary variant of A285815.
This sequence is infinite as it contains all powers of 2 (A000079).
All terms belong to A049445.
If k belongs to the sequence, then 2*k belongs to the sequence.
All terms except 1 are even. - Robert Israel, Mar 05 2019

Examples

			For n = 108:
- the divisors of 108 are 1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 108,
- the corresponding Hamming weights are 1, 1, 2, 1, 2, 2, 2, 2, 4, 2, 4, 4,
- they all divide 108,
- hence 108 belongs to the sequence.
For n = 98:
- the divisors of 98 are 1, 2, 7, 14, 49, 98,
- the correspond Hamming weights are 1, 1, 3, 3, 3, 3,
- 3 does not divide 98,
- hence 98 does not belong to the sequence.
		

Crossrefs

Positions of zeros in A324393.

Programs

  • Magma
    [k:k in [1..310]| forall{d:d in Divisors(k)| k mod &+Intseq(d,2) eq 0}]; // Marius A. Burtea, Dec 30 2019
  • Maple
    filter:= proc(n) local F;
      F:= map(convert,map(convert,numtheory:-divisors(n),base,2),`+`);
      andmap(t -> n mod t = 0, F)
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Mar 05 2019
  • Mathematica
    Select[Range@ 310, With[{k = #}, AllTrue[Divisors@ k, Mod[k, DigitCount[#, 2, 1]] == 0 &]] &] (* Michael De Vlieger, Mar 05 2019 *)
  • PARI
    is(n) = fordiv(n,d,if (n%hammingweight(d), return (0))); return ( )
    

A324392 a(n) is the number of divisors d of n such that A000120(d) divides n, where A000120(d) gives the binary weight of d.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 05 2019

Keywords

Comments

Number of such positive integers k that both k and A000120(k) [the Hamming weight of k] divide n.

Crossrefs

Programs

  • Mathematica
    a[n_] := DivisorSum[n, 1 &, Divisible[n, DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Dec 04 2020 *)
  • PARI
    A324392(n) = sumdiv(n, d, !(n%hammingweight(d)));

Formula

a(n) = Sum_{d|n} [A000120(d) does divide n], where [ ] is the Iverson bracket.
a(n) = A000005(n) - A324393(n).
a(p) = 1 for all odd primes p.
Showing 1-2 of 2 results.