login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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. 5
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

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

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

EXAMPLE

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

MAPLE

f:= n ->

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

map(f, [$1..200]); # Robert Israel, Jul 04 2018

MATHEMATICA

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

PROG

(PARI) a(n) = sum(b=2, n, #select(x->(x>1), digits(n, b)) == 0); \\ Michel Marcus, Jul 04 2018

CROSSREFS

Cf. A059972.

Sequence in context: A035390 A092938 A320110 * A189635 A109785 A058224

Adjacent sequences:  A068950 A068951 A068952 * A068954 A068955 A068956

KEYWORD

nonn,base

AUTHOR

Dean Hickerson, Mar 31 2002

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 17 00:49 EST 2020. Contains 331976 sequences. (Running on oeis4.)