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.

A361943 a(n) is the least multiple of n whose binary expansion is an abelian square (A272653).

Original entry on oeis.org

3, 10, 3, 36, 10, 36, 63, 136, 9, 10, 33, 36, 130, 154, 15, 528, 34, 36, 190, 520, 63, 132, 46, 528, 150, 130, 54, 588, 725, 150, 1023, 2080, 33, 34, 630, 36, 222, 190, 156, 520, 615, 588, 43, 132, 45, 46, 235, 528, 147, 150, 51, 156, 53, 54, 165, 2296, 513
Offset: 1

Views

Author

Rémy Sigrist, Mar 31 2023

Keywords

Comments

This sequence is well defined as for any n > 0, A020330(n) is a multiple of n and its binary expansion is an abelian square.

Examples

			The first terms, alongside their binary expansion, are:
  n   a(n)  bin(a(n))
  --  ----  ----------
   1     3          11
   2    10        1010
   3     3          11
   4    36      100100
   5    10        1010
   6    36      100100
   7    63      111111
   8   136    10001000
   9     9        1001
  10    10        1010
  11    33      100001
  12    36      100100
  13   130    10000010
  14   154    10011010
  15    15        1111
  16   528  1000010000
		

Crossrefs

Programs

  • PARI
    a(n) = { forstep (m = n, oo, n, my (w = #binary(m)); if (w%2==0 && hammingweight(m)==2*hammingweight(m % (2^(w/2))), return (m))) }
    
  • Python
    from itertools import count
    def a(n): return next(m for m in count(n, n) if not (w:=m.bit_length())&1 and m.bit_count() == ((m>>(w>>1)).bit_count())<<1)
    print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 31 2023 after Rémy Sigrist

Formula

a(n) = A361944(n) * n.
a(n) <= A020330(n).
a(n) >= n with equality iff n belongs to A272653.