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.

A360981 a(n) is the least positive multiple of n that is an evil number (A001969).

Original entry on oeis.org

3, 6, 3, 12, 5, 6, 63, 24, 9, 10, 33, 12, 39, 126, 15, 48, 17, 18, 57, 20, 63, 66, 23, 24, 75, 78, 27, 252, 29, 30, 1023, 96, 33, 34, 105, 36, 111, 114, 39, 40, 123, 126, 43, 132, 45, 46, 141, 48, 147, 150, 51, 156, 53, 54, 165, 504, 57, 58, 177, 60, 183, 2046
Offset: 1

Views

Author

Rémy Sigrist, Feb 27 2023

Keywords

Comments

This sequence is well defined: for any n > 0, A020330(n) is both a multiple of n and an evil number.

Crossrefs

Cf. A001969, A020330, A180938, A360980 (variant for odious numbers).

Programs

  • Maple
    f:= proc(n) local k;
      for k from n by n do
        if convert(convert(k,base,2),`+`)::even then return k fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 29 2023
  • Mathematica
    a[n_] := Module[{k = n}, While[OddQ[DigitCount[k, 2, 1]], k +=n]; k]; Array[a, 100] (* Amiram Eldar, Aug 07 2023 *)
  • PARI
    a(n) = { forstep (m=n, oo, n, if (hammingweight(m)%2==0, return (m))) }
    
  • Python
    def A360981(n):
        k = n
        while k.bit_count()&1:
            k += n
        return k # Chai Wah Wu, Feb 28 2023

Formula

a(n) = A180938(n) * n.
a(n) = n iff n belongs to A001969.