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

A275727 a(0) = 0, for n >= 1, a(n) = A275736(n) + 2*a(A257684(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2016

Keywords

Comments

a(n) has ones in those positions of its base-2 representation where n has nonzero digits in its factorial base representation.

Examples

			For n=19, A007623(19) = 301, thus a(19) = 5 because A007088(5) = 101.
		

Crossrefs

Formula

a(0) = 0, for n >= 1, a(n) = A275736(n) + 2*a(A257684(n)).
a(n) = A048675(A275733(n)).
Other identities and observations. For all n >= 0:
A000120(a(n)) = A060130(n).

A275808 a(0) = 0, for n >= 1, a(n) = A275736(n) XOR a(A257684(n)), where XOR is given by A003987.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2016

Keywords

Crossrefs

Cf. A275809 (positions of zeros), A275810 (and their first differences).
Cf. also A275728.

Formula

a(0) = 0, for n >= 1, a(n) = A275736(n) XOR a(A257684(n)), where 2-argument function XOR is given by A003987.
a(n) = A248663(A275734(n)).

A275728 a(0) = 0, for n >= 1, a(n) = A275736(n) + a(A257684(n)); a(n) = A048675(A275734(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2016

Keywords

Comments

See graph: pine trees on a snowy mountain. - N. J. A. Sloane, Aug 12 2016

Crossrefs

Formula

a(0) = 0, for n >= 1, a(n) = A275736(n) + a(A257684(n)).
a(n) = A048675(A275734(n)).

A276010 a(0) = 0, for n >= 1, a(n) = A275736(n) OR a(A257684(n)), where OR is given by A003986.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 17 2016

Keywords

Crossrefs

Formula

a(0) = 0, for n >= 1, a(n) = A275736(n) OR a(A257684(n)), where OR is given by A003986.
a(n) = A087207(A275734(n)).
Other identities. For all n >= 1:
A000120(a(n)) = A060502(n).

A225901 Write n in factorial base, then replace each nonzero digit d of radix k with k-d.

Original entry on oeis.org

0, 1, 4, 5, 2, 3, 18, 19, 22, 23, 20, 21, 12, 13, 16, 17, 14, 15, 6, 7, 10, 11, 8, 9, 96, 97, 100, 101, 98, 99, 114, 115, 118, 119, 116, 117, 108, 109, 112, 113, 110, 111, 102, 103, 106, 107, 104, 105, 72, 73, 76, 77, 74, 75, 90, 91, 94, 95, 92, 93, 84, 85, 88, 89, 86, 87, 78, 79, 82, 83, 80, 81, 48, 49, 52, 53, 50, 51, 66, 67, 70, 71, 68
Offset: 0

Views

Author

Paul Tek, May 20 2013

Keywords

Comments

Analogous to A004488 or A048647 for the factorial base.
A self-inverse permutation of the natural numbers.
From Antti Karttunen, Aug 16-29 2016: (Start)
Consider the following way to view a factorial base representation of nonnegative integer n. For each nonzero digit d_i present in the factorial base representation of n (where i is the radix = 2.. = one more than 1-based position from the right), we place a pebble to the level (height) d_i at the corresponding column i of the triangular diagram like below, while for any zeros the corresponding columns are left empty:
.
Level
6 o
─ ─
5 . .
─ ─ ─
4 . . .
─ ─ ─ ─
3 . . . .
─ ─ ─ ─ ─
2 . . o . .
─ ─ ─ ─ ─ ─
1 . o . . o o
─ ─ ─ ─ ─ ─ ─
Radix: 7 6 5 4 3 2
Digits: 6 1 2 0 1 1 = A007623(4491)
Instead of levels, we can observe on which "slope" each pebble (nonzero digit) is located at. Formally, the slope of nonzero digit d_i with radix i is (i - d_i). Thus in above example, both the most significant digit (6) and the least significant 1 are on slope 1 (called "maximal slope", because it contains digits that are maximal allowed in those positions), while the second 1 from the right is on slope 2 ("submaximal slope").
This involution (A225901) sends each nonzero digit at level k to the slope k (and vice versa) by flipping such a diagram by the shallow diagonal axis that originates from the bottom right corner. Thus, from above diagram we obtain:
Slope (= digit's radix - digit's value)
1
2 .
3 . .╲
4 . .╲o╲
5 . .╲.╲.╲
6 . .╲.╲o╲.╲
. .╲.╲.╲.╲o╲
o╲.╲.╲.╲.╲o╲
-----------------
1 5 3 0 2 1 = A007623(1397)
and indeed, a(4491) = 1397 and a(1397) = 4491.
Thus this permutation maps between polynomial encodings A275734 & A275735 and all the respective sequences obtained from them, where the former set of sequences are concerned with the "slopes" and the latter set with the "levels" of the factorial base representation. See the Crossrefs section.
Sequences A231716 and A275956 are closed with respect to this sequence, in other words, for all n, a(A231716(n)) is a term of A231716 and a(A275956(n)) is a term of A275956.
(End)

Examples

			a(1000) = a(1*6! + 2*5! + 1*4! + 2*3! + 2*2!) = (7-1)*6! + (6-2)*5! + (5-1)*4! + (4-2)*3! + (3-2)*2! = 4910.
a(1397) = a(1*6! + 5*5! + 3*4! + 0*3! + 2*2! + 1*1!) = (7-1)*6! + (6-5)*5! + (5-3)*4! + (3-2)*2! + (2-1)*1! = 4491.
		

Crossrefs

Cf. A275959 (fixed points), A231716, A275956.
This involution maps between the following sequences related to "levels" and "slopes" (see comments): A275806 <--> A060502, A257511 <--> A260736, A264990 <--> A275811, A275729 <--> A275728, A275948 <--> A275946, A275949 <--> A275947, A275964 <--> A275962, A059590 <--> A276091.

Programs

  • Mathematica
    b = MixedRadix[Reverse@ Range[2, 12]]; Table[FromDigits[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #), b] &@ IntegerDigits[n, b], {n, 0, 82}] (* Version 10.2, or *)
    f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Range[# + 1] <= n &]; Most@ Rest[a][[All, 1]] /. {} -> {0}]; g[w_List] := Total[Times @@@ Transpose@ {Map[Times @@ # &, Range@ Range[0, Length@ w]], Reverse@ Append[w, 0]}]; Table[g[Map[Boole[# > 0] &, #] (Reverse@ Range[2, Length@ # + 1] - #)] &@ f@ n, {n, 0, 82}] (* Michael De Vlieger, Aug 29 2016 *)
  • PARI
    a(n)=my(s=0,d,k=2);while(n,d=n%k;n=n\k;if(d,s=s+(k-d)*(k-1)!);k=k+1);return(s)
    
  • Python
    from sympy import factorial as f
    def a(n):
        s=0
        k=2
        while(n):
            d=n%k
            n=(n//k)
            if d: s=s+(k - d)*f(k - 1)
            k+=1
        return s
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 19 2017
  • Scheme
    (define (A225901 n) (let loop ((n n) (z 0) (m 2) (f 1)) (cond ((zero? n) z) (else (loop (quotient n m) (if (zero? (modulo n m)) z (+ z (* f (- m (modulo n m))))) (+ 1 m) (* f m))))))
    ;; One implementing the first recurrence, with memoization-macro definec:
    (definec (A225901 n) (if (zero? n) n (+ (A276091 (A275736 n)) (A153880 (A225901 (A257684 n))))))
    ;; Antti Karttunen, Aug 29 2016
    

Formula

From Antti Karttunen, Aug 29 2016: (Start)
a(0) = 0; for n >= 1, a(n) = A276091(A275736(n)) + A153880(a(A257684(n))).
or, for n >= 1, a(n) = A276149(n) + a(A257687(n)).
(End)
Other identities. For n >= 0:
a(n!) = A001563(n).
a(n!-1) = A007489(n-1).
From Antti Karttunen, Aug 16 2016: (Start)
A275734(a(n)) = A275735(n) and vice versa, A275735(a(n)) = A275734(n).
A060130(a(n)) = A060130(n). [The flip preserves the number of nonzero digits.]
A153880(n) = a(A255411(a(n))) and A255411(n) = a(A153880(a(n))). [This involution conjugates between the two fundamental factorial base shifts.]
a(n) = A257684(a(A153880(n))) = A266193(a(A255411(n))). [Follows from above.]
A276011(n) = A273662(a(A273670(n))).
A276012(n) = A273663(a(A256450(n))).
(End)

A059590 Numbers obtained by reinterpreting base-2 representation of n in the factorial base: a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1).

Original entry on oeis.org

0, 1, 2, 3, 6, 7, 8, 9, 24, 25, 26, 27, 30, 31, 32, 33, 120, 121, 122, 123, 126, 127, 128, 129, 144, 145, 146, 147, 150, 151, 152, 153, 720, 721, 722, 723, 726, 727, 728, 729, 744, 745, 746, 747, 750, 751, 752, 753, 840, 841, 842, 843, 846, 847, 848, 849, 864, 865
Offset: 0

Views

Author

Henry Bottomley, Jan 24 2001

Keywords

Comments

Numbers that are sums of distinct factorials (0! and 1! not treated as distinct).
Complement of A115945; A115944(a(n)) > 0; A115647 is a subsequence. - Reinhard Zumkeller, Feb 02 2006
A115944(a(n)) = 1. - Reinhard Zumkeller, Dec 04 2011
From Tilman Piesk, Jun 04 2012: (Start)
The inversion vector (compare A007623) of finite permutation a(n) (compare A055089, A195663) has only zeros and ones. Interpreted as a binary number it is 2*n (or n when the inversion vector is defined without the leading 0).
The inversion set of finite permutation a(n) interpreted as a binary number (compare A211362) is A211364(n).
(End)

Examples

			128 is in the sequence since 5! + 3! + 2! = 128.
a(22) = 128. a(22) = a(6) + (1 + floor(log(16) / log(2)))! = 8 + 5! = 128. Also, 22 = 10110_2. Therefore, a(22) = 1 * 5! + 0 * 4! + 1 * 3! + 1 + 2! + 0 * 0! = 128. - _David A. Corneth_, Aug 21 2016
		

Crossrefs

Indices of zeros in A257684.
Cf. A275736 (left inverse).
Cf. A025494, A060112 (subsequences).
Subsequence of A060132, A256450 and A275804.
Other sequences that are built by replacing 2^k in the binary representation with other numbers: A029931 (naturals), A089625 (primes), A022290 (Fibonacci), A197433 (Catalans), A276091 (n*n!), A275959 ((2n)!/2). Cf. also A276082 & A276083.

Programs

  • Haskell
    import Data.List (elemIndices)
    a059590 n = a059590_list !! n
    a059590_list = elemIndices 1 $ map a115944 [0..]
    -- Reinhard Zumkeller, Dec 04 2011
    
  • Maple
    [seq(bin2facbase(j),j=0..64)]; bin2facbase := proc(n) local i; add((floor(n/(2^i)) mod 2)*((i+1)!),i=0..floor_log_2(n)); end;
    floor_log_2 := proc(n) local nn,i; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;
    # next Maple program:
    a:= n-> (l-> add(l[j]*j!, j=1..nops(l)))(Bits[Split](n)):
    seq(a(n), n=0..57);  # Alois P. Heinz, Aug 12 2025
  • Mathematica
    a[n_] :=  Reverse[id = IntegerDigits[n, 2]].Range[Length[id]]!; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Jun 19 2012, after Philippe Deléham *)
  • PARI
    a(n) = if(n>0, a(n-msb(n)) + (1+logint(n,2))!, 0)
    msb(n) = 2^#binary(n)>>1
    {my(b = binary(n)); sum(i=1,#b,b[i]*(#b+1-i)!)} \\ David A. Corneth, Aug 21 2016
    
  • Python
    def facbase(k, f):
        return sum(f[i] for i, bi in enumerate(bin(k)[2:][::-1]) if bi == "1")
    def auptoN(N): # terms up to N factorial-base digits; 13 generates b-file
        f = [factorial(i) for i in range(1, N+1)]
        return list(facbase(k, f) for k in range(2**N))
    print(auptoN(5)) # Michael S. Branicky, Oct 15 2022

Formula

G.f. 1/(1-x) * Sum_{k>=0} (k+1)!*x^2^k/(1+x^2^k). - Ralf Stephan, Jun 24 2003
a(n) = Sum_{k>=0} A030308(n,k)*A000142(k+1). - Philippe Deléham, Oct 15 2011
From Antti Karttunen, Aug 19 2016: (Start)
a(0) = 0, a(2n) = A153880(a(n)), a(2n+1) = 1+A153880(a(n)).
a(n) = A225901(A276091(n)).
a(n) = A276075(A019565(n)).
a(A275727(n)) = A276008(n).
A275736(a(n)) = n.
A276076(a(n)) = A019565(n).
A007623(a(n)) = A007088(n).
(End)
a(n) = a(n - mbs(n)) + (1 + floor(log(n) / log(2)))!. - David A. Corneth, Aug 21 2016

Extensions

Name changed (to emphasize the functional nature of the sequence) with the old definition moved to the comments by Antti Karttunen, Aug 21 2016

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).

A275809 Indices of zeros in A275808.

Original entry on oeis.org

0, 5, 14, 19, 22, 54, 59, 74, 84, 89, 93, 97, 100, 111, 114, 119, 264, 269, 278, 283, 286, 366, 371, 408, 413, 422, 427, 430, 440, 463, 466, 482, 492, 497, 501, 536, 552, 557, 566, 571, 574, 579, 589, 592, 596, 601, 604, 615, 618, 623, 655, 658, 675, 685, 688, 692, 696, 701, 710, 715, 718, 1560, 1565, 1574, 1579, 1582, 1614, 1619, 1634, 1644
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2016

Keywords

Comments

Indexing begins from zero, because a(0) = 0 is a special case in this sequence.
Terms A009445(n)-1, [0, 5, 119, 5039, 362879, 39916799, ...] form a subsequence, and also the terms of A010050(n)-2, [0, 22, 718, 40318, 3628798, ...] form a subsequence.

Crossrefs

Cf. A275810 (first differences).
Subsequence of A275813 and of A275805 (after the initial 0).
Cf. also A009445, A010050.

A275730 Square array A(n,d): overwrite with zero the digit at position d from right (indicating radix d+2) in the factorial base representation of n, then convert back to decimal, read by descending antidiagonals as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 08 2016

Keywords

Examples

			Columns 0-4 of rows 0 - 24 of the array:
  0, 0, 0, 0, 0, ... [No matter which digit of zero we clear, it stays zero forever]
  0, 1, 1, 1, 1  ... [When clearing the least significant digit (pos. 0) of one, "1", we get zero, and clearing any other digit past the most significant digit keeps one as one]
2, 0, 2, 2, 2, ... [Clearing the least significant digit of 2, "10", doesn't affect it, but clearing the digit-1 zeros the whole number].
  2, 1, 3, 3, 3, ... [Clearing the least significant factorial base digit of 3 ("11") gives "10", 2, clearing the digit-1 gives "01" = 1, and clearing any digit past the most significant keeps "11" as it is, 3].
  4, 0, 4, 4, 4
  4, 1, 5, 5, 5
  6, 6, 0, 6, 6
  6, 7, 1, 7, 7
  8, 6, 2, 8, 8
  8, 7, 3, 9, 9
  10, 6, 4, 10, 10
  10, 7, 5, 11, 11
  12, 12, 0, 12, 12
  12, 13, 1, 13, 13
  14, 12, 2, 14, 14
  14, 13, 3, 15, 15
  16, 12, 4, 16, 16
  16, 13, 5, 17, 17
  18, 18, 0, 18, 18
  18, 19, 1, 19, 19
  20, 18, 2, 20, 20
  20, 19, 3, 21, 21
  22, 18, 4, 22, 22
  22, 19, 5, 23, 23
  24, 24, 24, 0, 24
  ...
		

Crossrefs

Transpose: A275731.
Column 0: A052928, Main diagonal: A001477.
Can be used when computing A275732 and A275736.

Programs

  • Scheme
    (define (A275730 n) (A275730bi (A002262 n) (A025581 n)))
    (define (A275730bi n c) (let loop ((z 0) (n n) (m 2) (f 1) (c c)) (let ((d (modulo n m))) (cond ((zero? n) z) ((zero? c) (loop z (/ (- n d) m) (+ 1 m) (* f m) (- c 1))) (else (loop (+ z (* f d)) (/ (- n d) m) (+ 1 m) (* f m) (- c 1)))))))

Formula

Other identities:
For all n >= 1, A(n,A084558(n)-1) = A257687(n).
For all n >= 0, A(n,A084558(n)) = n.
Showing 1-9 of 9 results.