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.

A239321 Numbers n such that n - k! is never prime; or A175940(n) = 0.

Original entry on oeis.org

1, 2, 10, 16, 22, 28, 34, 36, 40, 46, 50, 51, 52, 56, 57, 58, 64, 66, 70, 76, 78, 82, 86, 87, 88, 92, 93, 94, 96, 100, 101, 106, 112, 116, 117, 118, 120, 124, 126, 130, 134, 135, 136, 142, 144, 146, 147, 148, 154, 156, 160, 162, 166, 170, 171, 172, 176, 177
Offset: 1

Views

Author

Derek Orr, Mar 15 2014

Keywords

Examples

			51 - 0! = 51 - 1! = 50 is not prime. 51 - 2! = 49 is not prime. 51 - 3! = 45 is not prime. 51 - 4! = 27 is not prime. For k >= 5, 51 - k! is negative and thus not prime. Hence 51 is a member of this sequence since 51 - k! is not prime for any k.
		

Crossrefs

Programs

  • PARI
    isok(n) = {k = 0; while (((nmk =(n - k!)) > 0), if (isprime(nmk), return (0)); k++;); return (1);} \\ Michel Marcus, Mar 16 2014
  • Python
    import sympy
    from sympy import isprime
    import math
    def Prf(x):
      count = 0
      for i in range(x):
        if isprime(x-math.factorial(i)):
          count += 1
      return count
    x = 1
    while x < 10**3:
      if Prf(x) == 0:
        print(x)
      x += 1
    

A181676 Number of ways of writing n = m + f! with m a semiprime and f > 0.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 0, 2, 2, 2, 0, 0, 2, 3, 1, 0, 0, 1, 1, 1, 2, 1, 0, 1, 3, 3, 0, 1, 1, 1, 1, 2, 2, 2, 1, 1, 3, 3, 2, 0, 0, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 0, 1, 1, 3, 2, 3, 1, 1, 1, 3, 2, 0, 1, 1, 1, 0, 2, 2, 0, 1, 0, 3, 1, 0, 1, 2, 1, 1, 1, 2, 1, 0, 2, 2, 3, 2, 0, 1, 2, 3, 1, 2, 2, 2, 1, 1, 1, 2, 0, 0, 0, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Nov 04 2010

Keywords

Comments

Number of partitions of n into a semiprime and a factorial.

Examples

			a(16)=3 because 16 = 2*5 + 3! = 2*7 + 2! = 3*5 + 1!.
		

Crossrefs

Programs

  • Maple
    N:= 200: # for a(1) .. a(N)
    R:= Vector(N):
    S:= select(t -> numtheory:-bigomega(t)=2, [$1..N]):
    F:= 1: v:= 1:
    for i from 2 do v:= v*i; if v > N then break fi; F:= F,v od:
    F:= [F]:
    for s in S do
      for f in F do
        v:= s+f;
         if v > N then break fi;
         R[v]:= R[v]+1
    od od:
    convert(R,list); # Robert Israel, Sep 20 2024

A241424 Largest number k > 0 such that n - k! is prime, or 0 if no such k exists.

Original entry on oeis.org

0, 0, 1, 2, 2, 1, 2, 3, 3, 0, 3, 1, 3, 1, 2, 0, 3, 1, 3, 1, 2, 0, 3, 1, 3, 4, 4, 0, 4, 1, 4, 1, 2, 0, 4, 0, 4, 1, 2, 0, 4, 1, 4, 1, 2, 0, 4, 1, 3, 0, 0, 0, 4, 1, 4, 0, 0, 0, 3, 1, 4, 1, 2, 0, 4, 0, 4, 1, 2, 0, 4, 1, 3, 1, 2, 0, 4, 0, 3, 1, 2, 0, 4, 1, 4, 0, 0, 0, 3, 1, 4, 0, 0, 0, 4
Offset: 1

Views

Author

Derek Orr, Aug 08 2014

Keywords

Comments

If k > n, n - k! is negative and therefore, not prime.

Crossrefs

Programs

  • Maple
    a:= proc(n) local k, r;
    r:= 0;
    for k from 1 do
       if k! >= n then return r
       elif isprime(n-k!) then r:= k
       fi
    od
    end proc:
    seq(a(n),n=1..100); # Robert Israel, Aug 10 2014
  • Mathematica
    a[n_] := Module[{k, r = 0}, For[k = 1, True, k++, If[k! >= n, Return[r], If[PrimeQ[n - k!], r = k]]]];
    Array[a, 100] (* Jean-François Alcover, Jul 27 2020, after Maple *)
  • PARI
    a(n)=forstep(k=n,1,-1,if(ispseudoprime(n-k!),return(k)))
    n=1;while(n<150,print1(a(n),", ");n++)

A242041 Number of k >= 1 that make n + k! and n - k! both prime.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 2, 0, 1, 0, 0, 1, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Derek Orr, Aug 12 2014

Keywords

Comments

0 <= a(n) <= min{A125162(n), A175940(n)}.
a(n) < A020639(n). - Robert Israel, Aug 12 2014

Crossrefs

Programs

  • Maple
    a:= n ->  nops(select(k -> isprime(n+k!) and isprime(n-k!),
          [$1 ..min(numtheory:-factorset(n))-1])):
    0, seq(a(n),n=2..100); # Robert Israel, Aug 12 2014
  • PARI
    a(n)=c=0;for(k=1,n,if(ispseudoprime(n+k!)&&ispseudoprime(n-k!),c++));return(c)
    vector(100,n,a(n))
Showing 1-4 of 4 results.