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 10 results.

A257687 Discard the most significant digit from factorial base representation of n, then convert back to decimal: a(n) = n - A257686(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0
Offset: 0

Views

Author

Antti Karttunen, May 04 2015

Keywords

Comments

A060130(n) gives the number of steps needed to reach zero, when starting iterating as a(k), a(a(k)), etc., from the starting value k = n.

Examples

			Factorial base representation (A007623) of 1 is "1", discarding the most significant digit leaves nothing, taken to be zero, thus a(1) = 0.
Factorial base representation of 2 is "10", discarding the most significant digit leaves "0", thus a(2) = 0.
Factorial base representation of 3 is "11", discarding the most significant digit leaves "1", thus a(3) = 1.
Factorial base representation of 4 is "20", discarding the most significant digit leaves "0", thus a(4) = 0.
		

Crossrefs

Can be used (together with A099563) to define simple recurrences for sequences like A034968, A060130, A227153, A246359, A257511, A257679, A257680.
Cf. also A257684.

Programs

  • Mathematica
    f[n_] := Block[{m = p = 1}, While[p*(m + 1) <= n, p = p*m; m++]; Mod[n, p]]; Array[f, 101, 0] (* Robert G. Wilson v, Jul 21 2015 *)
  • Python
    from sympy import factorial as f
    def a007623(n, p=2): return n if n
  • Scheme
    (define (A257687 n) (- n (A257686 n)))
    

Formula

a(n) = n - A257686(n).

A278236 Filter-sequence for factorial base (digit values): least number with the same prime signature as A276076(n).

Original entry on oeis.org

1, 2, 2, 6, 4, 12, 2, 6, 6, 30, 12, 60, 4, 12, 12, 60, 36, 180, 8, 24, 24, 120, 72, 360, 2, 6, 6, 30, 12, 60, 6, 30, 30, 210, 60, 420, 12, 60, 60, 420, 180, 1260, 24, 120, 120, 840, 360, 2520, 4, 12, 12, 60, 36, 180, 12, 60, 60, 420, 180, 1260, 36, 180, 180, 1260, 900, 6300, 72, 360, 360, 2520, 1800, 12600, 8, 24, 24, 120, 72, 360, 24, 120, 120, 840, 360, 2520
Offset: 0

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Comments

This sequence can be used for filtering certain factorial base related sequences, because it matches only with any such sequence b that can be computed as b(n) = f(A276076(n)), where f(n) is any function that depends only on the prime signature of n (some of these are listed under the index entry for "sequences computed from exponents in ...").
Matching in this context means that the sequence a matches with the sequence b iff for all i, j: a(i) = a(j) => b(i) = b(j). In other words, iff the sequence b partitions the natural numbers to the same or coarser equivalence classes (as/than the sequence a) by the distinct values it obtains.
Any such sequence should match where the result is computed from the nonzero digits (that may also be > 9) in the factorial base representation of n, but does not depend on their order. Some of these are listed on the last line of the Crossrefs section.
Note that as A275735 is present in that list it means that the sequences matching to its filter-sequence A278235 form a subset of the sequences matching to this sequence. Also, for A275735 there is a stronger condition that for any i, j: a(i) = a(j) <=> A275735(i) = A275735(j), which if true, would imply that there is an injective function f such that f(A275735(n)) = A278236(n), and indeed, this function seems to be A181821.

Crossrefs

Similar sequences: A278222 (base-2 related), A069877 (base-10), A278226 (primorial base), A278225, A278234, A278235 (other variants for factorial base),
Differs from A278226 for the first time at n=24, where a(24)=2, while A278226(24)=16.
Sequences that partition N into same or coarser equivalence classes: A275735 (<=>), A034968, A060130, A227153, A227154, A246359, A257079, A257511, A257679, A257694, A257695, A257696, A264990, A275729, A275806, A275948, A275964, A278235.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; s = ReverseSort[s]; Times @@ (Prime[Range[Length[s]]] ^ s)]; Array[a, 100, 0] (* Amiram Eldar, Feb 07 2024 *)
  • Scheme
    (define (A278236 n) (A046523 (A276076 n)))

Formula

a(n) = A046523(A276076(n)).
a(n) = A181821(A275735(n)). [Empirical formula found with the help of equivalence class matching. Not yet proved.]

A208575 Product of digits of n in factorial base.

Original entry on oeis.org

0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 4, 0, 0, 0, 3, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 4, 0, 0, 0, 3, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 4, 0, 0, 0, 4, 0, 8, 0, 0, 0, 6, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 0, 0, 0, 6, 0, 12, 0, 0, 0, 9, 0, 18
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    (* For the definition of the factorial base version of IntegerDigits, see A007623 *) Table[Times@@factBaseIntDs[n], {n, 0, 99}] (* Alonso del Arte, Feb 28 2012 *)
  • PARI
    a(n)=my(k=1,s=1);while(n,s*=n%k++;n\=k);s
    
  • Python
    from functools import reduce
    from operator import mul
    def A(n, p=2):
        return n if n

A277012 Factorial base representation of n is rewritten as a base-2 number with each nonzero digit k replaced by a run of k 1's (followed by one extra zero if not the rightmost run of 1's) and with each 0 kept as 0.

Original entry on oeis.org

0, 1, 2, 5, 6, 13, 4, 9, 10, 21, 22, 45, 12, 25, 26, 53, 54, 109, 28, 57, 58, 117, 118, 237, 8, 17, 18, 37, 38, 77, 20, 41, 42, 85, 86, 173, 44, 89, 90, 181, 182, 365, 92, 185, 186, 373, 374, 749, 24, 49, 50, 101, 102, 205, 52, 105, 106, 213, 214, 429, 108, 217, 218, 437, 438, 877, 220, 441, 442, 885, 886, 1773, 56, 113, 114, 229, 230, 461, 116, 233
Offset: 0

Views

Author

Antti Karttunen, Sep 25 2016

Keywords

Examples

			9 = "111" in factorial base (3! + 2! + 1! = 9) is converted to three 1-bits with separating zeros between, in binary as "10101" = A007088(21), thus a(9) = 21.
91 = "3301" in factorial base (91 = 3*4! + 3*3! + 1!) is converted to binary number "1110111001" = A007088(953), thus a(91) = 953. Between the rightmost 1-runs the other zero comes from the factorial base representation, while the other zero is an extra separating zero inserted after each run of 1-bits apart from the rightmost 1-run. The single zero between the two leftmost 1-runs is similarly used to separate the two "unary representations" of 3's.
		

Crossrefs

Cf. A277008 (terms sorted into ascending order).
Cf. A277011 (a left inverse).
Differs from analogous A277022 for the first time at n=24, where a(24) = 8, while A277022(24) = 60.

Programs

  • Scheme
    (define (A277012 n) (let loop ((n n) (z 0) (i 2) (j 0)) (if (zero? n) z (let ((d (remainder n i))) (loop (quotient n i) (+ z (* (A000225 d) (A000079 j))) (+ 1 i) (+ 1 j d))))))

Formula

a(n) = A156552(A276076(n)).
Other identities. For all n >= 0:
A277011(a(n)) = n.
A005940(1+a(n)) = A276076(n).
A000035(a(n)) = A000035(n). [Preserves the parity of n.]
A000120(a(n)) = A034968(n).
A069010(a(n)) = A060130(n).
A227349(a(n)) = A227153(n).

A227154 Product of digits+1 of n in factorial base.

Original entry on oeis.org

1, 2, 2, 4, 3, 6, 2, 4, 4, 8, 6, 12, 3, 6, 6, 12, 9, 18, 4, 8, 8, 16, 12, 24, 2, 4, 4, 8, 6, 12, 4, 8, 8, 16, 12, 24, 6, 12, 12, 24, 18, 36, 8, 16, 16, 32, 24, 48, 3, 6, 6, 12, 9, 18, 6, 12, 12, 24, 18, 36, 9, 18, 18, 36, 27, 54, 12, 24, 24, 48, 36, 72, 4, 8, 8
Offset: 0

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Examples

			5 has factorial base representation A007623(5) = "21" (as 2*2 + 1*1 = 5). Adding one to these digits and multiplying, we get 3*2 = 6, thus a(5)=6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, p = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, p *= (r+1); m++]; p]; Array[a, 100, 0] (* Amiram Eldar, Feb 13 2024 *)
  • PARI
    a(n)=my(b=2,t=1); while(n, t *= n%b + 1; n \= b; b++); t \\ Charles R Greathouse IV, Jun 06 2017

Extensions

a(0)=1 added by Tom Edgar, Jun 05 2017

A257694 a(0) = 1; for n >= 1, a(n) = A060130(n) * a(A257684(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 2, 3, 4, 6, 1, 2, 2, 3, 4, 6, 1, 2, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 3, 4, 6, 8, 2, 3, 3, 4, 6, 8, 1, 2, 2, 3, 4, 6, 2, 3, 3, 4, 6, 8, 4, 6, 6, 8, 9, 12, 4, 6, 6, 8, 9, 12, 1, 2, 2, 3, 4, 6, 2, 3, 3, 4, 6, 8, 4, 6, 6, 8, 9, 12, 8, 12, 12, 16, 18, 24, 1, 2, 2, 3, 4, 6, 2, 3, 3, 4, 6, 8, 4, 6, 6, 8, 9, 12, 8, 12, 12, 16, 18, 24, 1
Offset: 0

Views

Author

Antti Karttunen, May 05 2015

Keywords

Crossrefs

Formula

a(0) = 1; for n >= 1, a(n) = A060130(n) * a(A257684(n)).
Other identities:
For all n >= 1, a(A033312(n)) = A000142(n-1).

A227191 a(n) = n minus (product of nonzero digits in factorial base representation of n).

Original entry on oeis.org

0, 1, 2, 2, 3, 5, 6, 7, 8, 8, 9, 10, 11, 12, 13, 12, 13, 15, 16, 17, 18, 16, 17, 23, 24, 25, 26, 26, 27, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 36, 37, 39, 40, 41, 42, 40, 41, 46, 47, 48, 49, 48, 49, 52, 53, 54, 55, 54, 55, 56, 57, 58, 59, 56, 57, 60, 61, 62
Offset: 1

Views

Author

Antti Karttunen, Jul 04 2013

Keywords

Examples

			22 has factorial expansion A007623(22) = "320", and multiplying the nonzero digits, we get 3*2 = 6, and 22-6 = 16, thus a(22)=16.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, p = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, If[r > 0, p *= r]; m++]; n - p]; Array[a, 100] (* Amiram Eldar, Feb 14 2024 *)
  • Scheme
    (define (A227191 n) (- n (A227153 n)))

Formula

a(n) = n - A227153(n).

A328581 Product of nonzero digits in primorial base expansion of n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 4, 4, 4, 4, 8, 8, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 4, 4, 3, 3, 3, 3, 6, 6, 4, 4, 4, 4, 8, 8, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 6, 6, 6, 6, 12, 12, 8, 8, 8, 8, 16, 16, 3, 3, 3, 3, 6, 6, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6
Offset: 0

Views

Author

Antti Karttunen, Oct 21 2019

Keywords

Comments

a(0) = 1 as an empty product.

Crossrefs

Cf. A276156 (positions of 1's).
Cf. also A227153 (an analogous sequence).

Programs

  • Mathematica
    a[n_] := Module[{k = n, p = 2, s = 1, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, If[r > 0, s *= r]; p = NextPrime[p]]; s]; Array[a, 100, 0] (* Amiram Eldar, Mar 06 2024 *)
  • PARI
    A328581(n) = { my(m=1, p=2); while(n, if(n%p, m *= (n%p)); n = n\p; p = nextprime(1+p)); (m); };

Formula

a(n) = A005361(A276086(n)).

A286606 a(n) = n mod product of nonzero digits of n in factorial base.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 4, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 4, 5, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 10, 11, 0, 1, 2, 0, 4, 5, 0, 1, 2, 0, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 6, 7, 8, 9, 22, 23, 0
Offset: 1

Views

Author

Antti Karttunen, Jun 18 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, p = 1}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, If[r > 0, p *= r]; m++]; Mod[n, p]]; Array[a, 100] (* Amiram Eldar, Feb 21 2024 *)
  • Python
    from operator import mul
    from functools import reduce
    def a007623(n, p=2): return n if n
  • Scheme
    (define (A286606 n) (modulo n (A227153 n)))
    

Formula

a(n) = n mod A227153(n).

A301652 Triangle read by rows: row n gives the digits of n in factorial base in reversed order.

Original entry on oeis.org

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

Views

Author

Seiichi Manyama, Mar 25 2018

Keywords

Comments

Row n gives exponents for successive primes 2, 3, 5, 7, 11, etc., in the prime factorization of A276076(n). - Antti Karttunen, Mar 11 2024

Examples

			   n | 1  2  6
  ---+---------
   0 | 0;
   1 | 1;
   2 | 0, 1;
   3 | 1, 1;
   4 | 0, 2;
   5 | 1, 2;
   6 | 0, 0, 1;
   7 | 1, 0, 1;
   8 | 0, 1, 1;
   9 | 1, 1, 1;
  10 | 0, 2, 1;
  11 | 1, 2, 1;
  12 | 0, 0, 2;
  13 | 1, 0, 2;
  14 | 0, 1, 2;
  15 | 1, 1, 2;
  16 | 0, 2, 2;
  17 | 1, 2, 2;
  18 | 0, 0, 3;
  19 | 1, 0, 3;
		

Crossrefs

Triangle A108731 with rows reversed.
Cf. A007623, A034968 (row sums), A208575 (row products), A227153 (products of nonzero terms on row n), A276076, A301593.

Programs

  • Mathematica
    row[n_] := Module[{k = n, m = 2, r, s = {}}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, AppendTo[s, r]; m++]; s]; row[0] = {0}; Array[row, 31, 0] // Flatten (* Amiram Eldar, Mar 11 2024 *)
  • Sage
    terms=25; print([0]+[x for sublist in [[floor(n/factorial(i))%(i+1) for i in [k for k in [1..n] if factorial(k)<=n]] for n in [1..terms]] for x in sublist]) # Tom Edgar, Aug 15 2018

Formula

T(n,k) = floor(n/k!) mod k+1. - Tom Edgar, Aug 15 2018
Showing 1-10 of 10 results.