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-4 of 4 results.

A255411 Shift factorial base representation of n one digit left (with 0 added to right), increment all nonzero digits by one, then convert back to decimal; Numbers with no digit 1 in their factorial base representation.

Original entry on oeis.org

0, 4, 12, 16, 18, 22, 48, 52, 60, 64, 66, 70, 72, 76, 84, 88, 90, 94, 96, 100, 108, 112, 114, 118, 240, 244, 252, 256, 258, 262, 288, 292, 300, 304, 306, 310, 312, 316, 324, 328, 330, 334, 336, 340, 348, 352, 354, 358, 360, 364, 372, 376, 378, 382, 408, 412, 420, 424, 426, 430, 432, 436, 444
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2015

Keywords

Comments

Nonnegative integers such that the number of ones (A257511) in their factorial base representation (A007623) is zero.
Nonnegative integers such that the least missing nonzero digit (A257079) in their factorial base representation is one.
a(n) can be also directly computed from n by "shifting left" its factorial base representation (that is, by appending one zero to the right, see A153880) and then incrementing all nonzero digits by one, and then converting the resulting (still valid) factorial base number back to decimal. See the examples.
The sequences A227130 and A227132 are closed under a(n), in other words, permutation listed as the a(n)-th entry in tables A060117 & A060118 has the same parity as the n-th entry in those same tables.

Examples

			Factorial base representation (A007623) of 1 is "1", shifting it left yields "10", and when we increment all nonzero digits by one, we get "20", which is the factorial base representation of 4 (as 4 = 2*2! + 0*1!), thus a(1) = 4.
F.b.r. of 2 is "10", shifting it left yields "100", and "200" is f.b.r. of 12, thus a(2) = 12.
F.b.r. of 43 is "1301", shifting it left and incrementing all nonzeros by one yields "24020", which is f.b.r of 340, thus a(43) = 340.
		

Crossrefs

Complement: A256450.
Positions of ones in A257079, fixed points of A257080, positions of zeros in A257511, A257081 and A257261.
Cf. also A227130/A227132, A060117/A060118 and also arrays A257503 & A257505.

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, 500}]; {0}~Join~Flatten@ Position[s, x_ /; DigitCount[x][[1]] == 0](* Michael De Vlieger, Apr 27 2015, after Alonso del Arte at A007623 *)
    Select[Range[0, 444], ! MemberQ[IntegerDigits[#, MixedRadix[Reverse@ Range@ 12]], 1] &] (* Michael De Vlieger, May 30 2016, Version 10.2 *)
    r = MixedRadix[Reverse@Range[2, 12]]; Table[FromDigits[Map[If[# == 0, 0, # + 1] &, IntegerDigits[n, r]]~Join~{0}, r], {n, 0, 60}] (* Michael De Vlieger, Aug 14 2016, Version 10.2 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n

    0 else '0' for i in x)[::-1] return 0 if n==0 else sum(int(y[i])*f(i + 1) for i in range(len(y))) print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 20 2017

A275736 a(n) has base-2 representation with ones in those digit-positions where n contains ones in its factorial base representation, and zeros in all the other positions.

Original entry on oeis.org

0, 1, 2, 3, 0, 1, 4, 5, 6, 7, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 8, 9, 10, 11, 8, 9, 12, 13, 14, 15, 12, 13, 8, 9, 10, 11, 8, 9, 8, 9, 10, 11, 8, 9, 0, 1, 2, 3, 0, 1, 4, 5, 6, 7, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 4, 5, 6, 7, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 4, 5, 6, 7, 4, 5, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2016

Keywords

Comments

Each natural numbers occurs an infinite number of times.
Can be used when computing A275727.

Examples

			22 has factorial base representation "320" (= A007623(22)), which does not contain any "1". Thus a(22) = 0, as the empty sum is 0.
35 has factorial base representation "1121" (= A007623(35)). Here 1's occur in the following positions, when counted from right (starting with 0 for the least significant position): 0, 2 and 3. Thus a(35) = 2^0 + 2^2 + 2^3 = 1*4*8 = 13.
		

Crossrefs

Left inverse of A059590.
Cf. A255411 (indices of zeros).
Cf. also A275732.

Programs

  • Mathematica
    nn = 120; m = 1; While[Factorial@ m < nn, m++]; m; Map[FromDigits[#, 2] &[IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] /. k_ /; k != 1 -> 0] &, Range[0, nn]] (* Michael De Vlieger, Aug 11 2016, Version 10.2 *)

Formula

If A257261(n) = 0, then a(n) = 0, otherwise a(n) = A000079(A257261(n)-1) + a(A275730(n, A257261(n)-1)). [Here A275730(n,p) is a bivariate function that "clears" the digit at zero-based position p in the factorial base representation of n].
Other identities and observations. For all n >= 0:
a(n) = A048675(A275732(n)).
A000120(a(n)) = A257511(n).
a(A007489(n)) = A000225(n).
a(A059590(n)) = n.
a(A255411(n)) = 0.

A275732 One-based positions of 1-digits in the factorial base representation of n are converted to primes with those indices, then multiplied together.

Original entry on oeis.org

1, 2, 3, 6, 1, 2, 5, 10, 15, 30, 5, 10, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 7, 14, 21, 42, 7, 14, 35, 70, 105, 210, 35, 70, 7, 14, 21, 42, 7, 14, 7, 14, 21, 42, 7, 14, 1, 2, 3, 6, 1, 2, 5, 10, 15, 30, 5, 10, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 5, 10, 15, 30, 5, 10, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 5, 10, 15, 30
Offset: 0

Views

Author

Antti Karttunen, Aug 08 2016

Keywords

Comments

All terms are squarefree (A005117), and each squarefree number occurs an infinitely many times.

Examples

			22 has factorial base representation "320" (= A007623(22)), which does not contain any "1". Thus a(22) = 1, as the empty product is 1.
35 has factorial base representation "1121" (= A007623(35)). 1's occur in the following positions, when counted from right, starting with 1: 1, 3 and 4. Thus a(35) = prime(1)*prime(3)*prime(4) = 2*5*7 = 70.
		

Crossrefs

Cf. A255411 (indices of ones).
Can be used to compute A275733 and A275734.
Cf. also to A275736.

Programs

  • Mathematica
    nn = 105; m = 1; While[Factorial@ m < nn, m++]; m; Map[Times @@ Map[Prime, Flatten@ Position[#, 1]] &@ Reverse@ IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, Range[0, nn]] (* Michael De Vlieger, Aug 11 2016, Version 10.2 *)
  • Python
    from operator import mul
    from sympy import prime
    def a007623(n, p=2): return n if n
  • Scheme
    ;; Recursive definition using memoizing definec-macro:
    (definec (A275732 n) (cond ((zero? (A257261 n)) 1) (else (* (A000040 (A257261 n)) (A275732 (A275730bi n (- (A257261 n) 1)))))))
    (define (A275732 n) (let loop ((z 1) (n n)) (let ((y (A257261 n))) (cond ((zero? y) z) (else (loop (* z (A000040 y)) (A275730bi n (- y 1))))))))
    ;; Code for A275730bi given in A275730.
    

Formula

If A257261(n) = 0, then a(n) = 1, otherwise a(n) = A000040(A257261(n)) * a(A275730(n, A257261(n)-1)). [Here A275730(n,p) is a bivariate function that "clears" the digit at zero-based position p in the factorial base representation of n].
Other identities and observations. For all n >= 0:
a(A007489(n)) = A002110(n).
a(A255411(n)) = 1.
A001221(a(n)) = A001222(a(n)) = A257511(n).
A048675(a(n)) = A275736(n).

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-4 of 4 results.