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.

A004288 Least positive multiple of n written in base 8 using only 0 and 1.

This page as a plain text file.
%I A004288 #24 Aug 01 2025 17:05:51
%S A004288 1,10,11,10,101,110,1111111,10,11,1010,10111,110,101,11111110,1111,
%T A004288 100,10001,110,1001,1010,101011111,101110,101001,110,1011111,1010,
%U A004288 1001,11111110,1010011,11110,11111,100,100001,100010,100111111,110
%N A004288 Least positive multiple of n written in base 8 using only 0 and 1.
%H A004288 Chai Wah Wu, <a href="/A004288/b004288.txt">Table of n, a(n) for n = 1..10000</a>
%p A004288 f:= proc(n) local R, S, m, p, Snew, s;
%p A004288    R[1]:= 1; R[0]:= 0; S:= {0,1};
%p A004288    for m from 1 do
%p A004288       p:= 8^m mod n;
%p A004288       Snew:= map(s -> s + p mod n, S);
%p A004288       if member(0,Snew) then return R[-p mod n]+10^m fi;
%p A004288       for s in Snew minus S do R[s] := R[s - p mod n] + 10^m od;
%p A004288       S:= S union Snew;
%p A004288     od
%p A004288 end proc:
%p A004288 1, seq(f(n), n=2..100); # _Robert Israel_, Dec 30 2014
%o A004288 (Python)
%o A004288 def A004288(n):
%o A004288     if n > 0:
%o A004288         for i in range(1, 2**n):
%o A004288             s = bin(i)[2:]
%o A004288             if not int(s,8) % n:
%o A004288                 return int(s)
%o A004288     return 0 # _Chai Wah Wu_, Dec 30 2014
%K A004288 nonn,base
%O A004288 1,2
%A A004288 _David W. Wilson_
%E A004288 a(11), a(22), a(25) corrected by _Chai Wah Wu_, Dec 30 2014
%E A004288 Initial 0 deleted and offset corrected by _N. J. A. Sloane_, Jan 31 2024