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.

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]

A357680 a(n) is the number of primes that can be written as +-1! +- 2! +- 3! +- ... +- n!.

Original entry on oeis.org

0, 1, 3, 4, 7, 11, 16, 29, 42, 72, 121, 191, 367, 693, 1215, 2221, 4116, 7577, 13900, 25634, 48322, 90046, 169016, 317819, 600982, 1138049, 2158939, 4103414, 7818761, 14923641, 28534404, 54624906, 104786140, 201233500, 386914300, 744876280, 1435592207
Offset: 1

Views

Author

Zhining Yang, Oct 09 2022

Keywords

Examples

			For n=4, a(4)=4 means there exist 4 solutions ([17, 19, 29, 31]) as follows:
  17 =  1! - 2! - 3! + 4!;
  19 = -1! + 2! - 3! + 4!;
  29 =  1! - 2! + 3! + 4!;
  31 = -1! + 2! + 3! + 4!.
		

Crossrefs

Programs

  • Python
    from sympy import isprime,factorial
    def A357680(nmax):
        a=[0]
        t=[1]
        for n in range(2, nmax+1):
            k=factorial(n)
            s=[]
            for j in t:
                s.append(k-j)
                s.append(k+j)
            a.append(sum(1 for p in s if isprime(p)))
            t=s
        return(a)
    print(A357680(21))
    
  • Python
    from sympy import isprime
    from math import factorial
    from itertools import product
    def a(n):
        f = [2*factorial(i) for i in range(1, n+1)]
        t = sum(f)//2
        return sum(1 for s in product([0, 1], repeat=n-1) if isprime(t-sum(f[i] for i in range(n-1) if s[i])))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Oct 15 2022

Extensions

a(28)-a(30) from Michael S. Branicky, Oct 09 2022
a(31)-a(32) from Michael S. Branicky, Oct 10 2022
a(33)-a(34) from Michael S. Branicky, Oct 13 2022
a(35)-a(36) from Michael S. Branicky, Oct 26 2022
a(37) from Michael S. Branicky, Nov 13 2022
Showing 1-4 of 4 results.