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 11 results. Next

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

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

A059589 Sums of factorials of distinct integers.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 10, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 120, 121, 122, 123, 124, 126, 127, 128, 129, 130, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 720, 721, 722, 723, 724, 726, 727, 728, 729, 730, 744, 745, 746, 747, 748, 750, 751, 752, 753
Offset: 1

Views

Author

Henry Bottomley, Jan 24 2001

Keywords

Comments

0! and 1! are treated as distinct.
From Bernard Schott, Apr 13 2017: (Start)
Factorial numbers (A000142) are included in this sequence.
Only one factorial (2!) is the sum of distinct factorials in more than one way: 2! = 0! + 1!.
(End)
Sequence contains the same nonzero terms as A059590, and in addition also each term immediately after each maximal run of consecutive terms in A059590. For example, because A059590 contains numbers 30, 31, 32, 33, this sequence contains the same four terms, and also 34 which follows them but is not included in A059590. - Antti Karttunen, Apr 15 2017

Examples

			128 is in the sequence since 5! + 3! + 2! = 128.
2 = 0! + 1!.
		

Crossrefs

Cf. A000142, A059590 (subsequences).

Programs

  • Mathematica
    Rest@Union[Plus @@@ (Subsets@Range[0, 6]!)] (* Ivan Neretin, Jun 05 2016 *)

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

A051760 Numbers that are simultaneously a sum of distinct factorials and of the form a^b with b >= 3.

Original entry on oeis.org

1, 8, 27, 32, 128, 729
Offset: 1

Views

Author

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

Keywords

Comments

No further terms up to 10^18. - Robert Israel, Jan 30 2019

Examples

			2! + 3! = 2^3;
1! + 2! + 4! = 3^3;
2! + 3! + 4! = 2^5;
2! + 3! + 5! = 2^7;
1! + 2! + 3! + 6! = 3^6 = 9^3.
		

Crossrefs

Programs

  • Maple
    N:= 10^5; # to get all terms <= N
    S:= {1}:
    for n from 2 do
    v:= n!;
    if v > N then break fi;
    S:= S union {v} union map(`+`,S,v)
    od:
    filter:= proc(n) local F;
      F:= ifactors(n)[2];
      igcd(op(map(t ->t[2],F))) >= 3
    end proc:
    filter(1):= true:
    select(filter, S); # Robert Israel, Jan 30 2019

A115645 Powerful(1) numbers (A001694) that are sums of distinct factorials.

Original entry on oeis.org

1, 8, 9, 25, 27, 32, 121, 128, 144, 729, 841, 864, 5041, 5184, 40328, 41067, 45369, 45387, 46208, 46225, 363609, 403225, 3674889, 43954688, 6230694987, 1401602635449
Offset: 1

Views

Author

Giovanni Resta, Jan 27 2006

Keywords

Comments

Factorials 0! and 1! are not considered distinct.
a(27) > 10^18, if it exists. - Amiram Eldar, Feb 24 2024

Examples

			6230694987 = 13!+10!+8!+7!+4!+2!+1! = 3^3*11^2*1381^2.
		

Crossrefs

Intersection of A001694 and A059590.

Programs

  • Mathematica
    pwfQ[n_] := n==1 || Min[Last /@ FactorInteger@n] > 1; fac=Range[20]!;lst={}; Do[ n = Plus@@(fac*IntegerDigits[k, 2, 20]); If[pwfQ[n], AppendTo[lst, n]], {k, 2^20-1}]; lst
    q[n_] := Module[{k = n, m = 2, r, ans = True}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r > 1, ans = False; Break[]]; m++]; ans]; With[{max = 2^20-1}, Select[Union[Flatten[Table[i^2*j^3, {j, 1, max^(1/3)}, {i, 1, Sqrt[max/j^3]}]]], q]] (* Amiram Eldar, Feb 24 2024 *)

A115644 Brilliant numbers (A078972) that are sums of distinct factorials.

Original entry on oeis.org

6, 9, 25, 121, 841, 871, 5041, 5767, 363721, 368761, 409111, 3633841, 3992431, 3992551, 4032121, 4037791, 39962281, 39962311, 39963031, 40279711, 40279801, 43585921, 43591687, 43909207, 479047801, 479365321, 479370271, 482631271
Offset: 1

Views

Author

Giovanni Resta, Jan 27 2006

Keywords

Examples

			39962281 = 11! + 8! + 7! + 5!+ 1! = 4861*8221.
		

Crossrefs

Programs

  • Mathematica
    brillQ[n_] := Block[{d = FactorInteger[n]}, Plus@@Last/@d==2 && (Last/@d=={2} || Length@IntegerDigits@((First/@d)[[1]])==Length@IntegerDigits@((First/@d)[[2]]))]; fac=Range[20]!;lst={}; Do[ n = Plus@@(fac*IntegerDigits[k, 2, 20]); If[brillQ[n], AppendTo[lst, n]], {k, 2^20-1}]; lst

A115646 Semiprimes (A001358) that are sums of distinct factorials.

Original entry on oeis.org

6, 9, 25, 26, 33, 121, 122, 123, 129, 145, 146, 721, 723, 745, 746, 753, 841, 842, 843, 849, 865, 866, 871, 5041, 5042, 5065, 5071, 5161, 5163, 5169, 5186, 5191, 5761, 5767, 5793, 5905, 5906, 5911, 40321, 40322, 40323, 40345, 40346, 40353, 40441
Offset: 1

Views

Author

Giovanni Resta, Jan 27 2006

Keywords

Comments

Factorials 0! and 1! are not considered distinct.

Examples

			721 = 6!+1! = 7*103.
		

Crossrefs

Programs

  • Mathematica
    semipQ[n_] := Plus @@ Last /@ FactorInteger[n] == 2; fac=Range[10]!;lst={}; Do[ n = Plus@@(fac*IntegerDigits[k, 2, 10]); If[semipQ[n], AppendTo[lst, n]], {k, 2^10-1}]; Union[lst]

A115647 Triangular numbers that are sums of distinct factorials.

Original entry on oeis.org

1, 3, 6, 120, 153, 5886, 40470, 41041, 40279800
Offset: 1

Views

Author

Giovanni Resta, Jan 27 2006

Keywords

Comments

Factorials 0! and 1! are not considered distinct.
A115944(a(n)) > 0; subsequence of A059590. - Reinhard Zumkeller, Feb 02 2006
If there are any terms beyond 40279800 they must be larger than 48!. - Jon E. Schoenfield, Aug 04 2006

Examples

			1 = T(1) = 1!.
3 = T(2) = 2!+1!.
6 = T(3) = 3!.
120 = T(15) = 5!.
153 = T(17) = 5!+4!+3!+2!+1!.
5886 = T(108) = 7!+6!+5!+3!.
40470 = T(284) = 8!+5!+4!+3!.
41041 = T(286) = 8!+6!+1!.
40279800 = T(8975) = 11!+9!+5!.
		

Crossrefs

Cf. A025494.

Programs

  • Mathematica
    triQ[n_] := IntegerQ@Sqrt[8n+1]; fac=Reverse@Range[21]!; lst={}; Do[ n = Plus@@(fac*IntegerDigits[k, 2, 21]); If[triQ[n], AppendTo[lst, n]; Print[{n, k}]], {k, 2^21-1}]; Union@lst

A115648 Square numbers which are the sum of distinct double factorials (A006882).

Original entry on oeis.org

1, 4, 9, 16, 25, 49, 64, 121, 169, 400, 441, 961, 1444, 3844, 3969, 4225, 4356, 4900, 5184, 10404, 11449, 11881, 14400, 15625, 47089, 47524, 56644, 57600, 139129, 145924, 149769, 182329, 192721, 695556, 705600, 792100, 837225, 2073600
Offset: 1

Views

Author

Giovanni Resta, Jan 28 2006

Keywords

Comments

Double factorials 0!! and 1!! are not considered distinct. Note that double factorial (n!!) is different from (n!)!.

Examples

			10404 = 102^2 = 1!! + 4!! + 11!!.
		

Crossrefs

Showing 1-10 of 11 results. Next