cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 13 results. Next

A249150 Number of trailing zeros in the factorial base representation of products of binomial coefficients: a(n) = A230403(A001142(n)).

Original entry on oeis.org

0, 0, 1, 0, 3, 1, 5, 0, 1, 3, 9, 6, 11, 5, 3, 0, 15, 1, 17, 3, 5, 9, 21, 10, 3, 11, 1, 5, 27, 24, 29, 0, 9, 15, 5, 35, 35, 17, 11, 39, 39, 5, 41, 9, 22, 21, 45, 18, 5, 3, 15, 11, 51, 1, 9, 34, 17, 27, 57, 46, 59, 29, 62, 0, 11, 9, 65, 15, 21, 48, 69, 40, 71, 35, 3, 17, 9, 11, 77, 79, 1
Offset: 0

Views

Author

Antti Karttunen, Oct 25 2014

Keywords

Comments

a(n) = A249151(n)-1. Please see the comments and graph of that sequence.

Crossrefs

One less than A249151.
Cf. A249423 (values k such that a(k) = k).
Cf. A249425 (record positions).
Cf. A249426 (record values).

Programs

Formula

a(n) = A230403(A001142(n)).

A265893 a(n) = A084558(n) - A230403(n); the length of factorial base representation of n without its trailing zeros.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 1, 3, 2, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 3, 2, 3, 2, 3, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 2, 4, 3, 4, 3, 4, 1
Offset: 0

Views

Author

Antti Karttunen, Dec 20 2015

Keywords

Examples

			In factorial base A007623, 0 is shown as "0", but in this case all the zeros are trailing, so we set a(0) = 0 by convention.
For n = 2, A007623(2) = "10", and by discarding the trailing zero only one significant digit "1" is left, thus a(2) = 1.
For n = 132, A007623(132) = "10200", and by discarding its trailing zeros we are left with just three digits "102", thus a(132) = 3.
		

Crossrefs

Column 1 of A265892.

Programs

Formula

a(n) = A084558(n) - A230403(n).

A055881 a(n) = largest m such that m! divides n.

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1
Offset: 1

Views

Author

Leroy Quet and Labos Elemer, Jul 16 2000

Keywords

Comments

Number of factorial divisors of n. - Amarnath Murthy, Oct 19 2002
The sequence may be constructed as follows. Step 1: start with 1, concatenate and add +1 to last term gives: 1,2. Step 2: 2 is the last term so concatenate twice those terms and add +1 to last term gives: 1, 2, 1, 2, 1, 3 we get 6 terms. Step 3: 3 is the last term, concatenate 3 times those 6 terms and add +1 to last term gives: 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, iterates. At k-th step we obtain (k+1)! terms. - Benoit Cloitre, Mar 11 2003
From Benoit Cloitre, Aug 17 2007, edited by M. F. Hasler, Jun 28 2016: (Start)
Another way to construct the sequence: start from an infinite series of 1's:
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ... Replace every second 1 by a 2 giving:
1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, ... Replace every third 2 by a 3 giving:
1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, ... Replace every fourth 3 by a 4 etc. (End)
This sequence is the fixed point, starting with 1, of the morphism m, where m(1) = 1, 2, and for k > 1, m(k) is the concatenation of m(k - 1), the sequence up to the first k, and k + 1. Thus m(2) = 1, 2, 1, 3; m(3) = 1, 2, 1, 3, 1, 2, 1, 2, 1, 4; m(4) = 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 5, etc. - Franklin T. Adams-Watters, Jun 10 2009
All permutations of n elements can be listed as follows: Start with the (arbitrary) permutation P(0), and to obtain P(n + 1), reverse the first a(n) + 1 elements in P(n). The last permutation is the reversal of the first, so the path is a cycle in the underlying graph. See example and fxtbook link. - Joerg Arndt, Jul 16 2011
Positions of rightmost change with incrementing rising factorial numbers, see example. - Joerg Arndt, Dec 15 2012
Records appear at factorials. - Robert G. Wilson v, Dec 21 2012
One more than the number of trailing zeros (A230403(n)) in the factorial base representation of n (A007623(n)). - Antti Karttunen, Nov 18 2013
A062356(n) and a(n) coincide quite often. - R. J. Cano, Aug 04 2014
For n>0 and 1<=j<=(n+1)!-1, (n+1)^2-1=A005563(n) is the number of times that a(j)=n-1. - R. J. Cano, Dec 23 2016

Examples

			a(12) = 3 because 3! is highest factorial to divide 12.
From _Joerg Arndt_, Jul 16 2011: (Start)
All permutations of 4 elements via prefix reversals:
   n:   permutation  a(n)+1
   0:   [ 0 1 2 3 ]  -
   1:   [ 1 0 2 3 ]  2
   2:   [ 2 0 1 3 ]  3
   3:   [ 0 2 1 3 ]  2
   4:   [ 1 2 0 3 ]  3
   5:   [ 2 1 0 3 ]  2
   6:   [ 3 0 1 2 ]  4
   7:   [ 0 3 1 2 ]  2
   8:   [ 1 3 0 2 ]  3
   9:   [ 3 1 0 2 ]  2
  10:   [ 0 1 3 2 ]  3
  11:   [ 1 0 3 2 ]  2
  12:   [ 2 3 0 1 ]  4
  13:   [ 3 2 0 1 ]  2
  14:   [ 0 2 3 1 ]  3
  15:   [ 2 0 3 1 ]  2
  16:   [ 3 0 2 1 ]  3
  17:   [ 0 3 2 1 ]  2
  18:   [ 1 2 3 0 ]  4
  19:   [ 2 1 3 0 ]  2
  20:   [ 3 1 2 0 ]  3
  21:   [ 1 3 2 0 ]  2
  22:   [ 2 3 1 0 ]  3
  23:   [ 3 2 1 0 ]  2
(End)
From _Joerg Arndt_, Dec 15 2012: (Start)
The first few rising factorial numbers (dots for zeros) with 4 digits and the positions of the rightmost change with incrementing are:
  [ 0]    [ . . . . ]   -
  [ 1]    [ 1 . . . ]   1
  [ 2]    [ . 1 . . ]   2
  [ 3]    [ 1 1 . . ]   1
  [ 4]    [ . 2 . . ]   2
  [ 5]    [ 1 2 . . ]   1
  [ 6]    [ . . 1 . ]   3
  [ 7]    [ 1 . 1 . ]   1
  [ 8]    [ . 1 1 . ]   2
  [ 9]    [ 1 1 1 . ]   1
  [10]    [ . 2 1 . ]   2
  [11]    [ 1 2 1 . ]   1
  [12]    [ . . 2 . ]   3
  [13]    [ 1 . 2 . ]   1
  [14]    [ . 1 2 . ]   2
  [15]    [ 1 1 2 . ]   1
  [16]    [ . 2 2 . ]   2
  [17]    [ 1 2 2 . ]   1
  [18]    [ . . 3 . ]   3
  [19]    [ 1 . 3 . ]   1
  [20]    [ . 1 3 . ]   2
  [21]    [ 1 1 3 . ]   1
  [22]    [ . 2 3 . ]   2
  [23]    [ 1 2 3 . ]   1
  [24]    [ . . . 1 ]   4
  [25]    [ 1 . . 1 ]   1
  [26]    [ . 1 . 1 ]   2
(End)
		

Crossrefs

This sequence occurs also in the next to middle diagonals of A230415 and as the second rightmost column of triangle A230417.
Other sequences related to factorial base representation (A007623): A034968, A084558, A099563, A060130, A227130, A227132, A227148, A227149, A153880.
Analogous sequence for binary (base-2) representation: A001511.

Programs

  • Mathematica
    Table[Length[Intersection[Divisors[n], Range[5]!]], {n, 125}] (* Alonso del Arte, Dec 10 2012 *)
    f[n_] := Block[{m = 1}, While[Mod[n, m!] == 0, m++]; m - 1]; Array[f, 105] (* Robert G. Wilson v, Dec 21 2012 *)
  • PARI
    See Cano link.
    
  • PARI
    n=5; f=n!; x='x+O('x^f); Vec(sum(k=1,n,x^(k!)/(1-x^(k!)))) \\ Joerg Arndt, Jan 28 2014
    
  • PARI
    a(n)=for(k=2,n+1,if(n%k, return(k-1),n/=k)) \\ Charles R Greathouse IV, May 28 2015
  • Scheme
    (define (A055881 n) (let loop ((n n) (i 2)) (cond ((not (zero? (modulo n i))) (- i 1)) (else (loop (/ n i) (+ 1 i))))))
    

Formula

G.f.: Sum_{k > 0} x^(k!)/(1 - x^(k!)). - Vladeta Jovovic, Dec 13 2002
a(n) = A230403(n)+1. - Antti Karttunen, Nov 18 2013
a(n) = A230415(n-1,n) = A230415(n,n-1) = A230417(n,n-1). - Antti Karttunen, Nov 19 2013
a(m!+n) = a(n) if 1 <= n <= m*m! - 1 = A001563(m) - 1. - R. J. Cano, Jun 27 2016
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = e - 1 (A091131). - Amiram Eldar, Jul 23 2022

A276084 a(n) = Number of trailing zeros in primorial base representation of n (A049345); largest k such that A002110(k) divides n.

Original entry on oeis.org

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
Offset: 1

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

Terms begin from a(1)=0 because for zero the count is ambiguous.
From Amiram Eldar, Mar 10 2021: (Start)
The asymptotic density of the occurrences of k is (prime(k+1)-1)/A002110(k+1).
The asymptotic mean of this sequence is Sum_{k>=1} 1/A002110(k) = 0.705230... (A064648). (End)

Examples

			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.
		

Crossrefs

One less than A257993.
Differs from the related A230403 for the first time at n=24.

Programs

  • 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 *)
  • 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
  • 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))))))
    

Formula

a(n) = A257993(n)-1.
Other identities. For all n >= 1:
A053589(n) = A002110(a(n)).
a(n) = A001221(A053589(n)) = A001221(A340346(n)). - Peter Munn, Jan 14 2021

A257510 Number of nonleading zeros in factorial base representation of n (A007623).

Original entry on oeis.org

0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 3, 2, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 3, 2, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 3, 2, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 3, 2, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 2, 1, 1, 0, 1, 0, 4
Offset: 1

Views

Author

Antti Karttunen, Apr 27 2015

Keywords

Comments

Sequence starts from n=1, because 0 is an ambiguous case.

Crossrefs

Cf. A227157 (numbers n such that a(n) = 0), A227187 (n for which a(n) > 0).
Cf. also A257511.
Cf. also A023416, A080791 (analogous sequences for base-2), A055641 (for base-10).

Programs

  • Mathematica
    factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++]; m = n; len = i; dList = Table[0, {len}]; Do[currDigit = 0; While[m >= j!, m = m - j!; currDigit++]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; s = Table[FromDigits[factBaseIntDs[n]], {n, 120}]; Last@ DigitCount[#] & /@ s (* Michael De Vlieger, Apr 27 2015, after Alonso del Arte at A007623 *)
  • Scheme
    (define (A257510 n) (let loop ((n n) (i 2) (s 0)) (cond ((zero? n) s) (else (loop (floor->exact (/ n i)) (+ 1 i) (+ s (if (zero? (modulo n i)) 1 0)))))))

Formula

a(n) = A084558(n) - A060130(n).
Other identities and observations:
For all n >= 0, a(A000142(n+1)) = n. [(n+1)! gives the position where n first appears.]
For all n, a(n) >= A230403(n).

A232741 Numbers n for which the largest m such that (m-1)! divides n is a prime.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76
Offset: 1

Views

Author

Antti Karttunen, Dec 01 2013

Keywords

Comments

Numbers n for which A055881(n) is one of the terms of A006093.
Equally: Numbers n for which {the number of the trailing zeros in their factorial base representation A007623(n)} + 2 is a prime.
The sequence can be described in the following manner: Sequence includes all multiples of 1! and 2! (odd and even numbers), except that it excludes from those the multiples of 3! (6), except that it includes the multiples of 4! (24), except that it excludes the multiples of 5! (120), except that it includes the multiples of 6! (720), except that it excludes the multiples of 7! (5040) (and also those of 8! and 9!, because here 8+1 = 9 is the first odd composite), except that it includes the multiples of 10!, but excludes the multiples of 11!, but includes the multiples of 12!, but excludes the multiples of 13! (and also of 14! and 15!, because 14-16 are all composites), but includes the multiples of 16!, and so on, ad infinitum.

Crossrefs

A232743 Numbers n for which the largest m such that (m-1)! divides n is a composite number > 5.

Original entry on oeis.org

120, 240, 360, 480, 600, 840, 960, 1080, 1200, 1320, 1560, 1680, 1800, 1920, 2040, 2280, 2400, 2520, 2640, 2760, 3000, 3120, 3240, 3360, 3480, 3720, 3840, 3960, 4080, 4200, 4440, 4560, 4680, 4800, 4920, 5040, 5160, 5280, 5400, 5520, 5640, 5880, 6000, 6120, 6240
Offset: 1

Views

Author

Antti Karttunen, Dec 01 2013

Keywords

Comments

Numbers n for which A055881(n)>4 and is one of the terms of A072668.
Numbers n for which two plus the number of the trailing zeros in their factorial base representation A007623(n) is a composite number larger than 5.
All terms are multiples of 120. Specifically, these are all those terms of A232742 which are divisible by 120 (or equally: 24).
Please see also the comments in A055926, whose subset this sequence is.

Examples

			120 is included because A055881(120)=5 and 5+1 is a composite number larger than 5. Note that A007623(120) = '10000', with four trailing zeros.
720 is the first missing multiple of 120, as A055881(720)=6 and 7 is a prime, not composite, so 720 is not included in this sequence. Note that A007623(720) = '100000', with five trailing zeros, and 5+2 is not a composite.
120960 (= 3*8!) is included because A055881(120960)=8 and 9 is a composite number larger than 5. Note that A007623(120960) = '30000000', with seven trailing zeros.
		

Crossrefs

Subset of both A232742 and A055926.

A232742 Numbers n for which the largest m such that (m-1)! divides n is a composite.

Original entry on oeis.org

6, 12, 18, 30, 36, 42, 54, 60, 66, 78, 84, 90, 102, 108, 114, 120, 126, 132, 138, 150, 156, 162, 174, 180, 186, 198, 204, 210, 222, 228, 234, 240, 246, 252, 258, 270, 276, 282, 294, 300, 306, 318, 324, 330, 342, 348, 354, 360, 366, 372, 378, 390, 396, 402, 414
Offset: 1

Views

Author

Antti Karttunen, Dec 01 2013

Keywords

Comments

Numbers n for which A055881(n) is one of the terms of A072668.
Equally: numbers n for which {the number of the trailing zeros in their factorial base representation A007623(n)} + 2 is a composite number.
All terms are divisible by 6.
The sequence can be described in the following manner: Sequence includes all multiples of 3!, except that it excludes from those the multiples of 4! (24), except that it includes the multiples of 5! (120), except that it excludes the multiples of 6! (720), except that it includes the multiples of 7! (5040) (and also those of 8! and 9!, because here 8+1 = 9 is the first odd composite), of which it however excludes the multiples of 10!, except that it includes the multiples of 11!, but excludes the multiples of 12!, but includes the multiples of 13! (and 14! and 15!, because 14-16 are all composites), but excludes the multiples of 16!, and so on, ad infinitum.

Examples

			6 is included because A055881(6)=3 and 3+1 is a composite number.
24 is the first excluded multiple of 6, as A055881(24)=4 and 5 is a prime, not composite, so 24 is not included in this sequence.
120 is the first included multiple of 24, as A055881(120)=5 and 6 is a composite.
		

Crossrefs

Complement: A232741. Subset: A232743.

A230404 a(n) = the largest k such that (k+1)! divides 2n; the number of trailing zeros in the factorial base representation of even numbers.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Oct 31 2013

Keywords

Crossrefs

Used to compute A230405 and A219650. See A007623 for factorial base representation.
Analogous sequence for binary system: A001511.
Cf. A019762.

Programs

Formula

a(n) = A230403(2n) = A055881(2n) - 1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2*e - 4 = A019762 - 4 = 1.436563... . - Amiram Eldar, Jan 05 2024

A257260 One-based position of the rightmost zero in the factorial base representation of n (A007623), 0 if no nonleading zeros present.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2015

Keywords

Comments

a(n) gives the distance of the rightmost zero from the right hand end of factorial base representation of n (A007623), particularly, 1 when n is even, and 0 for those cases when there are no nonleading zeros present (terms of A227157).
Sequence starts from n=1, to avoid ambiguities with case zero.

Examples

			For n = 1, with factorial base representation (A007623) "1", there are no nonleading zeros at all, thus a(1) = 0.
For n = 6, with representation "100", the rightmost zero occurs at digit-position 1 (when the least significant digit has index 1, etc.), thus a(6) = 1.
For n = 7, with representation "101", the rightmost zero occurs at position 2, thus a(7) = 2.
		

Crossrefs

Cf. A007623, A227157 (positions of zeros), A000012 (even bisection).
Cf. also A257261, A230403, and arrays of permutations A060117 and A060118.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, s = {}, p}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; If[MissingQ[(p = FirstPosition[s, 0])], 0, p[[1]]]]; Array[a, 100] (* Amiram Eldar, Feb 07 2024 *)
  • Scheme
    (define (A257260 n) (let loop ((n n) (i 2)) (cond ((zero? n) 0) ((zero? (modulo n i)) (- i 1)) (else (loop (floor->exact (/ n i)) (+ 1 i))))))
Showing 1-10 of 13 results. Next