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

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

A025494 Squares which are the sum of factorials of distinct integers (probably finite).

Original entry on oeis.org

1, 4, 9, 25, 121, 144, 729, 841, 5041, 5184, 45369, 46225, 363609, 403225, 3674889, 1401602635449
Offset: 1

Views

Author

Keywords

Comments

No other elements < 31!. - Paul.Jobling(AT)WhiteCross.com, Aug 10 2000
If there are any terms in either A014597 or A025494 beyond the last one given (i.e., n = 1183893 in A014597; equivalently n^2 = 1401602635449 in A025494), then n^2 must be greater than 48! (about 1.24139*10^61). - Jon E. Schoenfield, Aug 04 2006

Crossrefs

A014597 Numbers k such that k^2 is a sum of distinct factorials.

Original entry on oeis.org

1, 3, 5, 11, 12, 27, 29, 71, 72, 213, 215, 603, 635, 1917, 1183893
Offset: 1

Views

Author

Keywords

Comments

a(16)^2 > 48! (about 1.24139*10^61), if it exists. - Jon E. Schoenfield, Aug 04 2006
A197183(a(n)) = 1. - Reinhard Zumkeller, Dec 04 2011
a(16) > 4.3*10^55 if it exists. - Bert Dobbelaere, Sep 16 2020

Examples

			1183893^2 = 1! + 2! + 3! + 7! + 8! + 9! + 10! + 11! + 12! + 13! + 14! + 15!.
2 is not a member since 4 is not a sum of distinct factorials.
		

References

  • Posting by Dan Hoey to math-fun mailing list.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a014597 n = a014597_list !! (n-1)
    a014597_list = tail $ elemIndices 1 $ map a197183 [0..]
    -- Reinhard Zumkeller, Dec 04 2011
    
  • Mathematica
    ok[n_] := (k=1; ff={}; While[k! < n^2, AppendTo[ff, k!]; k++]; xx = Array[x, Length[ff]]; Reduce[And @@ (0 <= # <= 1 & /@ xx) && n^2 == xx.ff, xx, Integers] =!= False); ok[1] = True; Reap[Do[If[ok[n], Print[n]; Sow[n]], {n, 1, 2*10^6}]][[2, 1]] (* Jean-François Alcover, Jul 16 2012 *)
  • Python
    from math import factorial, isqrt
    from itertools import chain, combinations
    from sympy.ntheory.primetest import is_square
    fac =[factorial(n) for n in range(1, 16)] # raise 16 to search higher
    def powerset(s): # skipping empty set
      return chain.from_iterable(combinations(s, r) for r in range(1, len(s)+1))
    gen = (isqrt(sum(s)) for s in powerset(fac) if is_square(sum(s)))
    print(sorted(set(gen))) # Michael S. Branicky, Jan 03 2021

Extensions

15th term from Jud McCranie, who remarks that there are no others involving terms < 21!.

A051761 Numbers that are simultaneously a sum of factorials of distinct integers and of the form a^b with b >= 2.

Original entry on oeis.org

0, 1, 4, 8, 9, 25, 27, 32, 121, 128, 144, 729, 841, 5041, 5184, 45369, 46225, 363609, 403225, 3674889, 1401602635449
Offset: 1

Views

Author

Paul.Jobling(AT)WhiteCross.com, Aug 10 2000

Keywords

Comments

0! and 1! are treated as distinct.

Examples

			4 is in the sequence since 2! + 1! + 0! = 4 = 2^2.
		

Crossrefs

A290249 Numbers that are the sum of distinct primorial numbers (A002110) (not including 1).

Original entry on oeis.org

2, 6, 8, 30, 32, 36, 38, 210, 212, 216, 218, 240, 242, 246, 248, 2310, 2312, 2316, 2318, 2340, 2342, 2346, 2348, 2520, 2522, 2526, 2528, 2550, 2552, 2556, 2558, 30030, 30032, 30036, 30038, 30060, 30062, 30066, 30068, 30240, 30242, 30246, 30248, 30270, 30272, 30276, 30278, 32340, 32342, 32346, 32348, 32370
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 24 2017

Keywords

Examples

			38 is in the sequence because 38 = 2 + 6 + 30 = 2 + 2*3 + 2*3*5.
		

Crossrefs

Programs

  • Mathematica
    Rest[f[x_] := Product[1 + x^Product[Prime[m], {m, 1, k}], {k, 1, 6}]; Exponent[#, x] & /@ List @@ Normal[Series[f[x], {x, 0, 32370}]]]

Formula

Nonzero exponents in expansion of Product_{k>=1} (1 + x^A002110(k)).

A177441 Partial sums of A014597.

Original entry on oeis.org

1, 4, 9, 20, 32, 59, 88, 159, 231, 444, 659, 1262, 1897, 3814, 1187707
Offset: 1

Views

Author

Jonathan Vos Post, May 08 2010

Keywords

Comments

Partial sums of numbers n such that n^2 is a sum of distinct factorials. The subsequence of primes in this partial sum begins: 59, 659, 1187707. If there is a larger value (the sequence might be finite), a(n)^2 must be greater than 48! (about 1.24139 * 10^61).

Examples

			a(15) = 1 + 3 + 5 + 11 + 12 + 27 + 29 + 71 + 72 + 213 + 215 + 603 + 635 + 1917 + 1183893 is prime.
		

Crossrefs

Formula

a(n) = SUM[i=1..n] A014597(i) = SUM[i=1..n] {i such that i^2 is a sum of distinct factorials} = SUM[i=1..n] {i such that i^2 is a sum of distinct A000142(j)}.

A306583 Positive integers that cannot be represented as a sum or difference of factorials of distinct integers.

Original entry on oeis.org

11, 12, 13, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 107, 108, 109, 131, 132, 133, 155, 156, 157
Offset: 1

Views

Author

Ivan Stoykov, Feb 25 2019

Keywords

Comments

It can be proved that any number in the gap between n! + (n-1)! + (n-2)! + ... + 2! + 1! + 0! and (n+1)! - (n! + (n-1)! + (n-2)! + ... + 2! + 1! + 0!) is in this sequence.
0! and 1! are treated as distinct. - Bernard Schott, Feb 25 2019

Examples

			10 can be represented as 10 = 0! + 1! + 2! + 3!, so it is not a term.
11 cannot be represented as a sum or a difference of factorials, so it is a term.
		

Crossrefs

Cf. A000142 and A007489.
Cf. A059589 (Sums of factorials of distinct integers with 0! and 1! treated as distinct), A059590 (Sums of factorials of distinct integers with 0! and 1! treated as identical), A005165 (Alternating factorials).

Programs

  • Mathematica
    Complement[Range[160], Total[# Range[0, 5]!] & /@ (IntegerDigits[ Range[3^6 - 1], 3, 6] - 1)] (* Giovanni Resta, Feb 27 2019 *)

Extensions

More terms from Giovanni Resta, Feb 27 2019
Showing 1-7 of 7 results.