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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A276084 a(n) = Number of trailing zeros in primorial base representation of n (A049345); largest k such that A002110(k) divides n. 10
0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,6

COMMENTS

Terms begin from a(1)=0 because for zero the count is ambiguous.

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..2310

Index entries for sequences related to primorial base

FORMULA

a(n) = A257993(n)-1.

Other identities. For all n >= 1:

A053589(n) = A002110(a(n)).

EXAMPLE

For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), there are two trailing zeros, thus a(24) = 2.

MATHEMATICA

Table[If[# == 0, 0, j = #; While[! Divisible[n, Times @@ Prime@ Range@ j], j--]; j] &@ If[OddQ@ n, 0, k = 1; While[Times @@ Prime@ Range[k + 1] <= n, k++]; k], {n, 120}] (* or *)

nn = 120; b = MixedRadix[Reverse@ Prime@ Range@ PrimePi[nn + 1]]; Table[Length@ TakeWhile[Reverse@ IntegerDigits[n, b], # == 0 &], {n, nn}] (* Version 10.2, or *)

f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Length@ TakeWhile[Reverse@ f@ n, # == 0 &], {n, 120}] (* Michael De Vlieger, Aug 30 2016 *)

PROG

(Scheme)

(define (A276084 n) (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) (- i 1) (loop (/ (- n d) p) (+ 1 i))))))

(Python)

from sympy import nextprime, primepi

def a053669(n):

    p = 2

    while True:

        if n%p!=0: return p

        else: p=nextprime(p)

def a(n): return primepi(a053669(n)) - 1 # Indranil Ghosh, May 12 2017

CROSSREFS

Cf. A000040, A002110, A049345, A053589.

One less than A257993.

Differs from the related A230403 for the first time at n=24.

Sequence in context: A286998 A097796 A117188 * A230403 A248908 A133565

Adjacent sequences:  A276081 A276082 A276083 * A276085 A276086 A276087

KEYWORD

nonn,base

AUTHOR

Antti Karttunen, Aug 22 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 April 18 08:37 EDT 2019. Contains 322209 sequences. (Running on oeis4.)