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

A087203 a(n) is the smallest m such that m > A037155(n) and n!- m is prime.

Original entry on oeis.org

4, 7, 11, 19, 19, 37, 17, 17, 17, 17, 61, 43, 59, 71, 61, 43, 113, 71, 41, 101, 191, 103, 191, 179, 71, 127, 37, 97, 113, 373, 71, 373, 293, 157, 149, 241, 167, 211, 151, 89, 131, 113, 73, 107, 179, 227, 173, 113, 257, 239, 151, 227, 163, 509, 293, 347, 643, 373, 457
Offset: 3

Views

Author

Farideh Firoozbakht, Sep 01 2003

Keywords

Comments

a(1) and a(2) are not defined. a(n) is the second m (first m is A037155(n)) such that m > 1 and n!- m is prime.For 3 < n < 643,a(n) is prime. I guess (compare the conjecture about A087202) except for the first term, every term of this sequence is prime.

Crossrefs

Programs

  • Mathematica
    A037155[3]=3; A037155[n_] := (For[m=Prime[PrimePi[n]+1], !PrimeQ[n!-m], m++ ]; m); a[n_] := (For[m=A037155[n]+1, !PrimeQ[n!-m], m++ ]; m); Table[a[n], {n, 3, 62}]

Formula

A037155[3]=3; A037155[n_] := (For[m=Prime[PrimePi[n]+1], !PrimeQ[n!-m], m++ ]; m); a[n_] := (For[m=A037155[n]+1, !PrimeQ[n!-m], m++ ]; m)

A082432 a(n) = p - A072181(n), where p is the least prime > A072181(n) + 1.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 11, 13, 13, 13, 13, 13, 17, 17, 17, 23, 59, 47, 41, 23, 23, 23, 83, 293, 383, 383, 103, 563, 107, 107, 71, 1399, 1399, 1399, 1399, 2803, 983, 983, 983, 10589, 5693, 5693, 19553, 827, 31699, 31699, 33001, 12193
Offset: 1

Views

Author

Naohiro Nomoto, Apr 25 2003

Keywords

Comments

Is a(n) always prime?

Examples

			a(4) = 17 - A072181(4) = 17 - 12 = 5.
		

Crossrefs

Extensions

a(36)-a(47) from Iain Fox, Nov 23 2017
a(48) from Iain Fox, Nov 29 2017

A301427 Least nonnegative integer k such that n! - n - k is prime.

Original entry on oeis.org

0, 1, 2, 5, 10, 23, 4, 1, 2, 1, 10, 3, 32, 37, 42, 23, 82, 11, 10, 51, 66, 49, 124, 11, 16, 73, 2, 49, 30, 131, 14, 159, 78, 91, 60, 41, 34, 43, 90, 37, 66, 65, 8, 43, 32, 55, 10, 47, 128, 15, 6, 73, 6, 405, 220, 51, 78, 79, 10, 9, 38, 295, 62, 251, 124, 183, 34, 27, 680, 91, 300
Offset: 3

Views

Author

Seiichi Manyama, Mar 21 2018

Keywords

Comments

The (n-1) consecutive numbers n!-n, ... , n!-2 (for n > 3) are not prime.

Examples

			a(3)=0 because 3! - 3 - 0 =   3 is prime.
a(4)=1 because 4! - 4 - 1 =  19 is prime and 20 is not.
a(5)=2 because 5! - 5 - 2 = 113 is prime and 114 and 115 are not prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local r; r:= n!-n;
      r - prevprime(r)
    end proc:
    f(3):= 0:
    seq(f(i),i=3..100); # Robert Israel, Mar 23 2018
  • Mathematica
    a[n_] := n! - NextPrime[n! - 1, -1] - n;
    a /@ Range[3, 100] (* Jean-François Alcover, Oct 26 2020 *)
  • PARI
    a(n) = apply(x->(x-precprime(x)), n!-n);
    vector(99, n, a(n+2)) \\ Altug Alkan, Mar 21 2018

Formula

a(n) = A037155(n) - n.

A058020 Difference between lcm(1,..,n) and the smallest prime > lcm(1,...,n) + 1, where n runs over A000961, lcm(n) runs through A051451.

Original entry on oeis.org

3, 5, 5, 7, 11, 13, 11, 13, 31, 23, 19, 37, 41, 29, 31, 43, 53, 41, 53, 79, 59, 97, 59, 61, 113, 97, 179, 73, 73, 97, 103, 101, 109, 101, 229, 109, 139, 113, 227, 131, 191, 163, 139, 199, 151, 139, 181, 223, 229, 367, 239, 499, 251, 509, 251, 227, 373, 281, 233
Offset: 1

Views

Author

Labos Elemer, Nov 14 2000

Keywords

Comments

Analogous to Fortunate numbers and like them so far proved to be primes. This holds for x<=421: if Q is the first follower prime, then Q(421)-lcm(1,...421) = 557. For first some cases when 1+LCM is also a prime, the 2nd primes give 3,5,5,7,11,11,.. deviations, i.e. give primes.

Crossrefs

Programs

  • PARI
    N=1; for(n=2,1e3, if(isprimepower(n,&p), N*=p; print1(nextprime(N+2)-N", "))) \\ Charles R Greathouse IV, Nov 18 2015

Extensions

Name corrected by Charles R Greathouse IV, Nov 18 2015

A082433 a(n) = A072181(n) - p, where p is the largest prime < A072181(n) - 1.

Original entry on oeis.org

3, 5, 7, 7, 11, 11, 11, 11, 13, 23, 17, 17, 17, 41, 191, 47, 31, 53, 53, 53, 31, 179, 61, 61, 337, 131, 523, 523, 419, 223, 223, 223, 223, 79, 3821, 3821, 3821, 23399, 21269, 21269, 3607
Offset: 3

Views

Author

Naohiro Nomoto, Apr 25 2003

Keywords

Comments

Are all terms prime?
All terms are odd. - Michael S. Branicky, Sep 05 2021

Examples

			a(4) = A072181(4)-7 = 12-7 = 5.
		

Crossrefs

Programs

  • Python
    from sympy import factorint, isprime
    def afindn(terms):
        prev_factors, prevan, prevk, n = dict(), 1, None, 2
        for n in range(2, terms+1):
            n_factors, an = factorint(n), 1
            for pi in set(prev_factors.keys()) | set(n_factors.keys()):
                ei = prev_factors[pi] if pi in prev_factors else 1
                fi = n_factors[pi] if pi in n_factors else 1
                an *= pi**(ei*fi)
            if n >= 3:
                if an != prevan:
                    k = 3
                    while not isprime(an - k): k += 2
                else:
                    k = prevk
                print(k, end=", ")
                prevk = k
            prev_factors, prevan = factorint(an), an
    afindn(36) # Michael S. Branicky, Sep 05 2021

Extensions

a(36)-a(40) from Jinyuan Wang, Sep 05 2020
a(41)-a(43) from Michael S. Branicky, Sep 05 2021
Showing 1-5 of 5 results.