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

A173688 Numbers m such that the sum of square of factorial of decimal digits is prime.

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 19, 20, 21, 30, 31, 40, 41, 50, 51, 90, 91, 100, 101, 110, 111, 123, 132, 133, 134, 135, 138, 143, 144, 147, 153, 156, 158, 165, 168, 169, 174, 177, 183, 185, 186, 196, 203, 213, 230, 231, 302, 303, 304, 305, 308, 312, 313, 314, 315, 318, 320
Offset: 1

Views

Author

Michel Lagneau, Nov 25 2010

Keywords

Comments

Let the decimal expansion of m = d(0)d(1)...d(p). Numbers such that Sum_{k=0..p} (d(k)!)^2 is prime.

Examples

			a(5) = 14 is in the sequence because (1!)^2 + (4!)^2 = 1 + 24^2 = 577 and 577 is prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 500 do:l:=length(n):n0:=n:s:=0:for m from 1
      to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+(u!)^2:od: if type(s,prime)=true
      then printf(`%d, `,n):else fi:od:
  • Mathematica
    Select[Range[400],PrimeQ[Total[(IntegerDigits[#]!)^2]]&]  (* Harvey P. Dale, Mar 23 2011 *)
  • Python
    from itertools import count, islice, combinations_with_replacement
    from math import factorial
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A173688_gen(): # generator of terms
        for l in count(0):
            for i in range(1,10):
                fi = factorial(i)**2
                yield from sorted(int(str(i)+''.join(map(str,k))) for j in combinations_with_replacement(range(10), l) for k in multiset_permutations(j) if isprime(fi+sum(map(lambda n:factorial(n)**2,j))))
    A173688_list = list(islice(A173688_gen(),50)) # Chai Wah Wu, Feb 23 2023

A173689 Numbers m such that the sum of square of factorial of decimal digits is square.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 122, 202, 212, 220, 221, 244, 424, 442, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 2222, 3333, 3444, 4344, 4434, 4443, 4444, 5555, 6666, 6677, 6767, 6776, 6888, 7667, 7676, 7766, 7777, 8688, 8868, 8886, 8888, 9999
Offset: 1

Views

Author

Michel Lagneau, Nov 25 2010

Keywords

Comments

Let the decimal expansion of m = d(0)d(1)...d(p). Numbers such that Sum_{k=0..p} (d(k)!)^2 is square.

Examples

			a(16) = 244 is in the sequence because (2!)^2 + (4!)^2 + (4!)^2 = 1156 = 34^2.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 0 to 10000 do:l:=length(n):n0:=n:s:=0:for m from
      1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+(u!)^2:od: q:=sqrt(s):if
      floor(q)= q then printf(`%d, `,n):else fi:od:
  • Mathematica
    Select[Range[0,10000],IntegerQ[Sqrt[Total[(IntegerDigits[#]!)^2]]]&] (* Harvey P. Dale, Dec 19 2011 *)
  • Python
    from itertools import count, islice, combinations_with_replacement
    from math import factorial
    from sympy.ntheory.primetest import is_square
    from sympy.utilities.iterables import multiset_permutations
    def A173689_gen(): # generator of terms
        yield 0
        for l in count(0):
            for i in range(1,10):
                fi = factorial(i)**2
                yield from sorted(int(str(i)+''.join(map(str,k))) for j in combinations_with_replacement(range(10), l) for k in multiset_permutations(j) if is_square(fi+sum(map(lambda n:factorial(n)**2,j))))
    A173689_list = list(islice(A173689_gen(),50)) # Chai Wah Wu, Feb 23 2023

Extensions

Offset changed to 1 by Jinyuan Wang, Feb 26 2020
Showing 1-2 of 2 results.