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!)
A215879 Written in base 3, n ends in a(n) consecutive nonzero digits. 6
0, 1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0, 3, 3, 0, 3, 3, 0, 1, 1, 0, 3, 3, 0, 3, 3, 0, 1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0, 4, 4, 0, 4, 4, 0, 1, 1, 0, 4, 4, 0, 4, 4, 0, 1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0, 4, 4, 0, 4, 4, 0, 1, 1, 0, 4, 4, 0, 4, 4, 0, 1, 1, 0, 2, 2, 0, 2, 2, 0, 1, 1, 0, 3, 3, 0, 3, 3, 0, 1, 1, 0, 3, 3, 0, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

Somehow complementary to A007949, the 3-adic valuation of n.

The base 2 analog of this sequence essentially coincides with the 2-adic valuation A007814 (up to a shift in the index).

One gets back the same sequence by concatenation of the pattern (0,1,1) successively multiplied by a(n)+1 = 1,2,2,1,3,3,... for n=0,1,2,3,4,5.... This is equivalent to the formula a(n)+1 = a(3n). - M. F. Hasler, Aug 26 2012

a(A008585(n)) = 0; a(A001651(n)) > 0. - Reinhard Zumkeller, Dec 28 2012

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

FORMULA

a(3^(t+1)*k+m) = t  for  3^t > m > 3^(t-1).

a(3n)=a(n)+1. - M. F. Hasler, Aug 26 2012

EXAMPLE

The numbers 0,1,2,3,4,5,6,7 are written in base 3 as 0,1,2,10,11,12,20,21 and thus end in a(0..7)=0,1,1,0,2,2,0,2 nonzero digits.

MATHEMATICA

cnzd[n_]:=Module[{idn3=IntegerDigits[n, 3], len}, len=Length[idn3]; Which[ idn3[[len]] == 0, 0, Position[idn3, 0]=={}, len, True, len-Position[idn3, 0] [[-1, 1]]]]; Array[cnzd, 110, 0] (* Harvey P. Dale, Jun 07 2016 *)

PROG

(PARI) A215879(n, b=3)=n=divrem(n, b); for(c=0, 9e9, n[2]||return(c); n=divrem(n[1], b))

(PARI) a(n)=my(k); while(n%3, n\=3; k++); k \\ Charles R Greathouse IV, Sep 26 2013

(Haskell)

a215879 n = if t == 0 then 0 else a215879 n' + 1

            where (n', t) = divMod n 3

-- Reinhard Zumkeller, Dec 28 2012

CROSSREFS

The base 4, 5 and 10 analogs of this sequence are given in A215883, A215884 and A215887.

Cf. A007089.

Sequence in context: A214665 A229723 A258040 * A114700 A140666 A202145

Adjacent sequences:  A215876 A215877 A215878 * A215880 A215881 A215882

KEYWORD

nonn,base,nice

AUTHOR

M. F. Hasler, Aug 25 2012

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 September 28 08:23 EDT 2020. Contains 337394 sequences. (Running on oeis4.)