The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068953 Number of bases B (2 <= B <= n) such that every digit of n in base B is 0 or 1. 6

%I #18 Jul 04 2018 15:12:41

%S 0,1,2,3,3,3,3,3,4,4,3,4,4,3,3,4,4,3,3,4,4,3,3,3,4,4,4,4,3,5,5,3,3,3,

%T 3,5,5,3,4,4,3,4,4,3,3,3,3,3,4,4,3,3,3,3,3,4,4,3,3,3,3,3,3,5,5,3,3,4,

%U 4,3,3,4,4,3,3,3,3,3,3,4,6,5,3,5,5,3,3,3,3,5,5,3,4,4,3,3,3,3,3,4,4,3,3

%N Number of bases B (2 <= B <= n) such that every digit of n in base B is 0 or 1.

%C All such bases are divisors of n or n-1, since the lowest base-B digit of n is 0 iff B | n, 1 iff B | n-1. - _Robert Israel_, Jul 04 2018

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

%e a(30)=5, since 30 written in the 5 bases 2, 3, 5, 29, 30 is 11110, 1010, 110, 11, 10.

%p f:= n ->

%p nops(select(b -> convert(convert(n,base,b),set) subset {0,1}, {$2..n} intersect (numtheory:-divisors(n) union numtheory:-divisors(n-1)))):

%p map(f, [$1..200]); # _Robert Israel_, Jul 04 2018

%t a[1]=0; a[n_] := Length[Select[Rest[Union[Divisors[n], Divisors[n-1]]], Max@@IntegerDigits[n, # ]==1&]]

%o (PARI) a(n) = sum(b=2, n, #select(x->(x>1), digits(n, b)) == 0); \\ _Michel Marcus_, Jul 04 2018

%Y Cf. A059972.

%K nonn,base

%O 1,3

%A _Dean Hickerson_, Mar 31 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 09:42 EDT 2024. Contains 372683 sequences. (Running on oeis4.)