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).

This page as a plain text file.
%I A361943 #7 Apr 01 2023 08:54:24
%S A361943 3,10,3,36,10,36,63,136,9,10,33,36,130,154,15,528,34,36,190,520,63,
%T A361943 132,46,528,150,130,54,588,725,150,1023,2080,33,34,630,36,222,190,156,
%U A361943 520,615,588,43,132,45,46,235,528,147,150,51,156,53,54,165,2296,513
%N A361943 a(n) is the least multiple of n whose binary expansion is an abelian square (A272653).
%C A361943 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.
%H A361943 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A361943 a(n) = A361944(n) * n.
%F A361943 a(n) <= A020330(n).
%F A361943 a(n) >= n with equality iff n belongs to A272653.
%e A361943 The first terms, alongside their binary expansion, are:
%e A361943   n   a(n)  bin(a(n))
%e A361943   --  ----  ----------
%e A361943    1     3          11
%e A361943    2    10        1010
%e A361943    3     3          11
%e A361943    4    36      100100
%e A361943    5    10        1010
%e A361943    6    36      100100
%e A361943    7    63      111111
%e A361943    8   136    10001000
%e A361943    9     9        1001
%e A361943   10    10        1010
%e A361943   11    33      100001
%e A361943   12    36      100100
%e A361943   13   130    10000010
%e A361943   14   154    10011010
%e A361943   15    15        1111
%e A361943   16   528  1000010000
%o A361943 (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))) }
%o A361943 (Python)
%o A361943 from itertools import count
%o A361943 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)
%o A361943 print([a(n) for n in range(1, 60)]) # _Michael S. Branicky_, Mar 31 2023 after _Rémy Sigrist_
%Y A361943 Cf. A020330, A272653, A361944.
%K A361943 nonn,base
%O A361943 1,1
%A A361943 _Rémy Sigrist_, Mar 31 2023