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.

A258946 Numbers that can be expressed using only the digits 0 and 1 in no more than three different bases.

This page as a plain text file.
%I A258946 #21 Jul 19 2015 07:26:00
%S A258946 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,
%T A258946 47,48,51,52,53,54,55,58,59,60,61,62,63,66,67,70,71,74,75,76,77,78,79,
%U A258946 83,86,87,88,89,92,95,96,97,98,99,102,103,104,105,106,107
%N A258946 Numbers that can be expressed using only the digits 0 and 1 in no more than three different bases.
%C A258946 All integers n >= 4 may trivially be expressed using only the digits 0 and 1 in three different bases: 2, n-1 (as '11') and n (as '10'). The numbers in this sequence cannot be expressed using only 0 and 1 in any other base.
%C A258946 The only positive integers that may be expressed using only the digits 0 and 1 in fewer than three different bases are 2 and 3, for which the values {2, n-1, n} are not all distinct or are not all valid bases.
%C A258946 An equivalent definition: For each term a(n) of this sequence, there are at most three integers k >= 2 for which a(n) is a sum of distinct nonnegative integer powers of k.
%H A258946 Thomas Oléron Evans, <a href="/A258946/b258946.txt">Table of n, a(n) for n = 1..10000</a>
%H A258946 Thomas Oléron Evans, <a href="/A258946/a258946.txt">Python program</a>
%e A258946 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).
%e A258946 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).
%p A258946 filter:= proc(n)
%p A258946   local b;
%p A258946   for b from 3 to n-2 do
%p A258946     if max(convert(n,base,b)) <= 1 then return false
%p A258946     fi
%p A258946   od:
%p A258946 true
%p A258946 end proc:
%p A258946 select(filter, [$2..1000]); # _Robert Israel_, Jun 19 2015
%o A258946 (PARI) 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
%Y A258946 Subsequence of A074940.
%Y A258946 Cf. A146025, A258107, A005836, A000695, A033042.
%K A258946 nonn,base
%O A258946 1,1
%A A258946 _Thomas Oléron Evans_, Jun 15 2015