A258107
Smallest number > 1 whose representation in all bases up to n consists only of 0's and 1's.
Original entry on oeis.org
a(4) = 4 because it is 100 in base 2, 11 in base 3 and 10 in base 4. No smaller number, except 1, can be expressed in such bases with only 0's and 1's.
a(5) = 82000: 82000 in bases 2 through 5 is 10100000001010000, 11011111001, 110001100, 10111000, containing only 0's and 1's, while all smaller numbers have a larger digit in one of those bases. For example, 12345 is 11000000111001, 121221020, 3000321, 343340. - _N. J. A. Sloane_, Feb 01 2016
-
Table[k = 2; While[Total[Total@ Drop[RotateRight[DigitCount[k, #]], 2] & /@ Range[3, n]] > 0, k++]; k, {n, 2, 5}] (* Michael De Vlieger, Aug 29 2015 *)
A258981
Numbers containing only 1's and 0's in their base-2, base-3, and base-4 representations.
Original entry on oeis.org
0, 1, 4, 81, 84, 85, 256, 273, 324, 325, 336, 337, 1089, 1092, 1093, 20496, 20497, 20736, 20737, 20740, 65620, 65856, 65857, 81921, 81984, 81985, 82000, 86032, 86277, 86292, 86293, 86356, 262468, 262480, 263169
Offset: 1
81 is 10000 in base 3 and 1101 in base 4 so 81 is a term.
273 is 101010 in base 3 and 10101 in base 4 so 273 is a term.
-
N:= 20: # to get all terms < 2*4^(N-1)
g:= proc(n)
local L, j, m, a;
L:= convert(n,base, 2);
a:= add(4^(j-1)*L[j],j=1..nops(L));
if has(convert(a,base,3),2) then NULL else a fi
end proc:
map(g, [$0..2^N]); # Robert Israel, Jul 14 2015
-
ok3[n_] := 1 == Max@ IntegerDigits[n, 3]; to4[n_] := FromDigits[ IntegerDigits[n, 2], 4]; Select[to4/@ Range[2^20], ok3] (* Giovanni Resta, Jun 16 2015 *)
-
digitsb(m)=vecsort(concat(digits(m,3),digits(m,4)),,8)
is_ok(n)={my(v=digitsb(n),r=0, i);for(i=2,9,r = r || vecsearch(v,i));!r}
first(m)={ my(v=vector(m),i,k=0);for(i=1, m, while(!is_ok(k), k++); v[i] = k;k++); v;} /* Anders Hellström, Jul 19 2015 */
-
isok(n) = (n==0) || ((vecmax(digits(n,3)) < 2) && (vecmax(digits(n,4)) < 2)); \\ Michel Marcus, Aug 05 2015
-
print1(0);for(n=1,1e5,vecmax(digits(t=subst(Pol(binary(n)),'x,4),3))<2&&print1(","t)) \\ M. F. Hasler, Feb 01 2016
-
\\ See links too.
-
def digits(n, b=10): # digits of n in base 2 <= b <= 62
x, y = n, ''
while x >= b:
x, r = divmod(x,b)
y += str(r) if r < 10 else (chr(r+87) if r < 36 else chr(r+29))
y += str(x) if x < 10 else (chr(x+87) if x < 36 else chr(x+29))
return y[::-1]
A258981_list = [n for n in (int(format(d,'b'),4) for d in range(10**4)) if max(digits(n,3)) <= '1'] # Chai Wah Wu, Aug 13 2015
-
[0]+[n for n in [1..1000000] if max(n.digits(base=3))==1 and max(n.digits(base=4))==1] # Tom Edgar, Jul 11 2015
A146026
Numbers that can be written from base 2 to base 9 using only the digits 0 to 3.
Original entry on oeis.org
0, 1, 2, 3, 8281, 8282, 8283
Offset: 1
-
Select[Range[0, 10^5], Function[n, Times @@ Boole@ Map[Max@ IntegerDigits[n, #] <= 3 &, Range[2, 9]] > 0]] (* Michael De Vlieger, Aug 15 2016 *)
A146027
Numbers that can be written from base 2 to base 10 using only the digits 0 to 4.
Original entry on oeis.org
0, 1, 2, 3, 4, 10, 100, 140004, 140304, 140312, 1131032, 1131033, 1131034, 1131040
Offset: 1
-
imax:= 20: # to consider numbers < 6^imax
L:= Matrix(5,imax):
Delta:= proc(L,b)
local i,j,m,Lloc;
if max(L) <= 4 then return 0 fi;
Lloc:= L;
m:= 0;
for j from 1 to imax while max(Lloc[j..imax]) > 4 do
m:= m + b^(j-1)*(b-Lloc[j]);
if j < imax then Lloc[j+1]:= Lloc[j+1]+1 fi
od;
m
end proc:
n:= 0: count:= 1: A[1]:= 0:
isdone:= false;
while max(L[..,imax]) < 5 and not isdone do
n:= n+1;
L[..,1]:= L[..,1]+<1,1,1,1,1>;
m:= max(seq(Delta(L[b-5,..],b),b=6..10));
while m > 0 and not isdone do
n:= n+m;
for b from 6 to 10 do
Lb:= convert(n,base,b);
if nops(Lb) > imax then isdone:= true; break fi;
L[b-5,1..nops(Lb)]:= Vector[row](Lb);
od:
m:= max(seq(Delta(L[b-5,..],b),b=6..10));
od;
if not isdone then
count:= count+1;
A[count]:= n;
fi
od:
seq(A[i],i=1..count); # Robert Israel, Aug 31 2015
-
f[n_] := Total[Total@ Drop[RotateRight[DigitCount[n, #]], 5] & /@ Range[6, 10]]; Select[Range[0, 1200000], f@ # == 0 &] (* Aug 29 2015, or *)
Select[Range[0, 1200000], Function[n, Times @@ Boole@ Map[Max@ IntegerDigits[n, #] <= 4 &, Range[2, 10]] > 0]] (* Michael De Vlieger, Aug 15 2016 *)
-
isok(n) = if (n, for (b=6, 10, if (vecmax(digits(n,b))>4, return(0)))); 1; \\ Michel Marcus, Aug 30 2015
A275600
Numbers that can be written in all bases from base 2 to base 6 using only the digits 0, 1 and 2.
Original entry on oeis.org
0, 1, 2, 6, 36, 37, 260, 1302, 1376, 1380, 1381, 1382, 1556, 1560, 1561, 1562, 16932, 562500, 562501, 562502, 562506, 562512, 562536, 562537, 562752, 562760, 23610752, 23610756, 23610757, 23610786, 23615750, 23615760, 23615761, 23615762, 23615785, 23615786, 23626310
Offset: 1
16932 is in the sequence because this number can be written in bases 2 through 6 using only the digits 0, 1 and 2: 16932(b4) = 10020210 / (b5) = 1020212 / (b6) = 210220.
-
Select[Range[10^6], Function[k, Max@ Flatten@ Map[IntegerDigits[k, #] &, Range[4, 6]] < 3]] (* or *)
Select[Range[10^5], Function[k, Total@ Flatten@ Map[Take[RotateRight@ DigitCount[k, #], -(# - 3)] &, Range[4, 6]] == 0]] (* (not as efficient) Michael De Vlieger, Aug 03 2016 *)
-
nextWithSmallDigits(n, base) = my (pow=1, rem=n, val=0, d); while (rem>0, d = rem % base; rem = rem \ base; if (d>2, val = 0; rem = rem+1, val = val + d*pow); pow = pow * base); return (val)
{ n = 0; prev = 0; while (n < 300, succ = prev; for (b=4,6, succ = nextWithSmallDigits(succ, b)); if (prev==succ, n = n+1; print(n " " prev); prev = succ+1, prev = succ)) } \\ Rémy Sigrist, Sep 08 2016
-
use ntheory ":all"; my($x,$n10)=(0,0); while ($x < 50) { my $n = fromdigits( todigitstring($n10++, 3), 6); next if vecany { $ > 2 } todigits($n, 4); next if vecany { $ > 2 } todigits($n, 5); print ++$x," $n\n"; } # Dana Jacobsen, Aug 16 2016
-
from gmpy2 import digits
A275600_list = [n for n in (int(digits(m,3),6) for m in range(10**6)) if max(digits(n,5)) <= '2' and max(digits(n,4)) <= '2'] # Chai Wah Wu, Aug 15 2016
A131646
Numbers that can be written from base 2 to base 18 using only the digits 0 to 9 (conjectured to be complete).
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 19, 20, 1027, 1028, 1029, 14745, 9020076688681, 9439828025162228377, 9439829801208141318
Offset: 1
- B. R. Barwell, Numbers Without Letters, Journal of Recreational Mathematics, Vol. 25:3 (1993), 174-179.
-
f[n_] := Total[Total@ Drop[RotateRight[DigitCount[n, #]], 10] & /@ Range[11, 18]]; Select[Range[0, 20000], f@ # == 0 &] (* Michael De Vlieger, Aug 29 2015 *)
-
isok(n) = if (n, for (b=11, 18, if (vecmax(digits(n,b))>9, return(0)))); 1; \\ Michel Marcus, Aug 30 2015
A146028
Numbers that can be written from base 2 to base 15 using only the digits 0 to 7.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 15, 16, 174731235562130, 174731235562131, 174731235562132, 174731235562143, 174731235562147, 174731235562170, 174731235562171, 174731235564710, 174731235564711, 174731236371006, 25354527232277132536350, 25354527232277132536351
Offset: 1
-
Select[Range[0, 10^5], Function[n, Times @@ Boole@ Map[Max@ IntegerDigits[n, #] <= 7 &, Range[2, 15]] > 0]] (* Michael De Vlieger, Aug 15 2016 *)
A146029
Numbers that can be written from base 2 to base 17 using only the digits 0 to 8 (conjectured to be complete).
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18
Offset: 1
-
Select[Range[0, 10^5], Function[n, Times @@ Boole@ Map[Max@ IntegerDigits[n, #] <= 8 &, Range[2, 17]] > 0]] (* Michael De Vlieger, Aug 15 2016 *)
A230360
a(n) is the number of base-4 n-digit numbers requiring only binary digits in bases 3 and 4.
Original entry on oeis.org
2, 1, 0, 3, 6, 3, 0, 5, 12, 11, 0, 5, 12, 0, 0, 5, 0, 0, 0, 48, 14, 0, 61, 188, 83, 0, 81, 232, 268, 0, 0, 650, 0, 0, 622, 299, 0, 0, 0, 501, 0, 0, 2655, 602, 0, 6429, 8990, 7856, 0, 26187, 17898, 3744, 0, 40300, 16395, 0, 0, 0, 0, 0, 0, 124876, 173552, 0, 0
Offset: 1
The first 8 values are 0, 1, 4, 81, 84, 85, 256 and 273--0, 1, 11, 10000, 10010, 10011, 10000111 and 10001010 in base 3, and 0, 1, 10, 1101, 1110, 1111, 10000 and 10101 in base 4; and, from the base-4 listing, a(1)=2, a(2)=1, a(3)=0, a(4)=3, and a(5) is at least 2.
-
MapAt[# + 1 &, Array[Count[FromDigits[#, 4] & /@ IntegerDigits[Range[2^(# - 1), 2^# - 1], 2], ?(DigitCount[#, 3][[2]] == 0 &)] &, 20], 1] (* _Michael De Vlieger, Jun 11 2019 *)
-
{
\\ This program finds the number of d-digit base B>b\\
\\ numbers not requiring digits beyond those of base b\\
\\ for bases b+1 through B. It runs a check in reverse\\
\\ down to base b+1, maintaining additions not yet done\\
\\ in vector S, where the digits in each base are kept\\
\\ in matrix N. The value itself is kept as n, at each\\
\\ new base checked for n, the value in S is transfered\\
\\ to variable t; with the check being done of whether\\
\\ the criterion is satisfied for n in the base under\\
\\ consideration. A flag f is used to see if n passed\\
\\ for all bases or there was a break. If pass, then\\
\\ count variable c is incremented (as is n) for the\\
\\ next run through bases. At each addition, a check\\
\\ of whether the base is B and the number of digits\\
\\ changes is done, and if so a new term is output.\\
\\ pos and POS are variables for the digit-positions\\
\\ under consideration in additions essentially mimic-\\
\\ king hand addition. Flag g identifies whether or\\
\\ not a large addition is warranted by virtue of an\\
\\ addition resulting in a digit larger than b-1, the\\
\\ leftmost of these being the point from which this\\
\\ addition is made using variable s calculated four\\
\\ lines above the bottom one of the program. This \\
\\ program is readily modified to store a smaller #\\
\\ of digits (D), change the b and B values, and print\\
\\ specific n values as desired.\\
b=2;B=4;d=1;c=1;D=10000;
N=matrix(B-b,D);n=1;S=vector(B-b,x,1);
while(1,
f=1;forstep(i=B,b+1,-1,
t=S[i-b];if(t,
S[i-b]=0;pos=0;ca=0;
while(t,
pos++;N[i-b,pos]+=t%i+ca;
if(N[i-b,pos]>=i,ca=1;N[i-b,pos]-=i,ca=0);
t\=i);
if(ca,pos++;N[i-b,pos]++;if(i==B,if(pos==d+1,
print1(c",");d++;c=0)));
POS=pos;g=1;
while(POS,
if(N[i-b,POS]>=b,g=0;break(),POS--));
if(g==0,
f=0;POS++;while(N[i-b,POS]==b-1,POS++);
N[i-b,POS]++;for(j=1,POS-1,N[i-b,j]=0);
s=i^(POS-1)-n%(i^(POS-1));
for(j=1,B-b,if(j!=i-b,S[j]+=s));
if(i==B,if(POS==d+1,print1(c",");d++;c=0));
n+=s;break())));
if(f,c++;n++;S=vector(B-b,x,1)))
}
A258946
Numbers that can be expressed using only the digits 0 and 1 in no more than three different bases.
Original entry on oeis.org
2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 18, 19, 22, 23, 24, 29, 32, 33, 34, 35, 38, 41, 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, 58, 59, 60, 61, 62, 63, 66, 67, 70, 71, 74, 75, 76, 77, 78, 79, 83, 86, 87, 88, 89, 92, 95, 96, 97, 98, 99, 102, 103, 104, 105, 106, 107
Offset: 1
5 is a term of the sequence, because 5 may be expressed using only the digits 0 and 1 in precisely three different bases: 2, 4 and 5 (5 is '12' in base 3).
9 is not a term of the sequence, because 9 can be expressed using only the digits 0 and 1 in four different bases: 2, 3, 8, 9 (9 is '100' in base 3).
-
filter:= proc(n)
local b;
for b from 3 to n-2 do
if max(convert(n,base,b)) <= 1 then return false
fi
od:
true
end proc:
select(filter, [$2..1000]); # Robert Israel, Jun 19 2015
-
is(n)=if(n<2, return(0)); for(b=3,sqrtint(n),if(vecmax(digits(n,b))<2, return(0))); 1 \\ Charles R Greathouse IV, Jun 15 2015
Showing 1-10 of 12 results.
Comments