login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Least positive multiple of n written in base 5 using only 0 and 1.
2

%I #14 Dec 28 2015 20:53:47

%S 1,11,11,1111,10,11,1001,10111,1001,110,11111,1111,101,1001,110,10111,

%T 101111,1001,110111,11110,1001,101011,100101,11111111,100,101,11011,

%U 11011,1000011,110,111,110101,1011101,111001,10010,11011,101011,111001,1111,101110,10111

%N Least positive multiple of n written in base 5 using only 0 and 1.

%H Robert Israel, <a href="/A004285/b004285.txt">Table of n, a(n) for n = 1..10000</a>

%p N:= 100: # to get a(1) .. a(N)

%p S:= [[1,1]]:

%p A[1]:= 1:

%p Todo:= {$2..N}:

%p count:= 1:

%p for d from 2 while count < N do

%p S:= map(t -> ([5*t[1],10*t[2]],[5*t[1]+1,10*t[2]+1]), S);

%p for p in S do

%p s:= p[1];

%p Ts:= select(t -> s mod t = 0, Todo);

%p Todo:= Todo minus Ts;

%p count:= count + nops(Ts);

%p for m in Ts do

%p A[m]:= p[2];

%p od

%p od;

%p od:

%p seq(A[n],n=1..N); # _Robert Israel_, Dec 28 2015

%o (PARI) a(n) = {k=1; while (vecmax(digits(k*n, 5)) != 1, k++); subst(Pol(digits(k*n, 5)), x, 10);} \\ _Michel Marcus_, Dec 27 2015

%K nonn,base

%O 1,2

%A _David W. Wilson_

%E a(33) corrected by _Sean A. Irvine_, Dec 26 2015

%E More terms from _Michel Marcus_, Dec 27 2015