login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216194 a(n) = Smallest b for which the base b representation of n contains at least one 2 (or 0 if no such base exists). 14
0, 3, 0, 0, 3, 3, 3, 3, 4, 4, 3, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 10, 3, 4, 11, 3, 3, 3, 3, 4, 4, 3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, 4, 3, 6, 5, 3, 3, 3, 3, 4, 4, 3, 6, 4, 3, 3, 3, 3, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(n)=3 if and only if n is in A074940.

a(n) > 0 for n >= 5 since 12 is n written in base n-2.

The only perfect k-th powers (k>=2) that can appear in this sequence are 2^k with k a prime number.

The first n for which a(n)=7 is 849.

The first n for which a(n)=8 is 1084.

The first n for which a(n)=10 is 28.  The second is 243.

The first n for which a(n)=11 is 31.  The second is 58130496.

a(n)<=11 for all n with fewer than 3000 base 10 digits.  No n for which a(n)>11 has been found.

LINKS

Nathan Fox, Table of n, a(n) for n = 1..10000

MAPLE

firstNTerms:=proc(n) local b, i, rep, L:

L:=[]:

for i from 5 to n do

    b:=3:

    while true do

        rep:=convert(i, base, b):

        if evalb(2 in rep) then

            L:=[op(L), b]:

            break:

        fi:

        b:=b+1:

    od:

od:

L:

end:

MATHEMATICA

sb2[n_]:=Module[{b=3}, While[DigitCount[n, b, 2]<1, b++]; b]; Array[sb2, 110, 5] (* Harvey P. Dale, Jan 16 2016 *)

Table[SelectFirst[Range[3, 1200], DigitCount[n, #, 2] > 0 &], {n, 5, 120}] (* Michael De Vlieger, Mar 09 2016, Version 10 *)

PROG

(PARI) a(n) = if ((n<5) && (n!=2), 0, my(b=3); while (! vecsearch(vecsort(digits(n, b)), 2), b++); b);  \\ Michel Marcus, Aug 06 2014, Mar 11 2016

CROSSREFS

Cf. A216192, A270027, A270028, A270029, A270030, A270031, A270032, A270033, A270034, A270035.

Sequence in context: A178153 A267794 A282499 * A279168 A111787 A200524

Adjacent sequences:  A216191 A216192 A216193 * A216195 A216196 A216197

KEYWORD

nonn,easy,base

AUTHOR

Nathan Fox, Mar 12 2013

EXTENSIONS

Modified the definition to make the offset 1 by Nathan Fox, Mar 10 2016

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 June 25 09:48 EDT 2019. Contains 324347 sequences. (Running on oeis4.)