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.

Previous Showing 21-30 of 57 results. Next

A275272 a(n) = p - n!, where p is the second smallest prime > n!.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 31, 23, 19, 17, 43, 73, 41, 149, 41, 53, 61, 109, 37, 37, 71, 109, 193, 97, 173, 47, 101, 229, 163, 241, 83, 139, 103, 83, 577, 311, 47, 269, 61, 61, 107, 97, 89, 379, 149, 269, 83, 137, 167, 281, 89, 79, 443, 229, 157, 179, 563, 389
Offset: 1

Views

Author

Clark Kimberling, Jul 23 2016

Keywords

Comments

p-n! where p = nextprime(nextprime(n!)).
Is every term a prime?

Examples

			For n = 4, we have n! = 24, so that p = 31 and a(4) = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[NextPrime[n!, 2] - n!, {n, 1, 150}]
  • PARI
    a(n) = nextprime(nextprime(n!+1)+1) - n!; \\ Michel Marcus, Mar 05 2022
    
  • Python
    from sympy import factorial, nextprime
    def a(n): fn = factorial(n); return nextprime(nextprime(fn)) - fn
    print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 05 2022

Formula

a(n) = A187874(n) - A000142(n). - Michel Marcus, Mar 05 2022

A067363 a(n)=p-n!^3, where p is the smallest prime > n!^3+1.

Original entry on oeis.org

2, 3, 7, 5, 17, 11, 17, 23, 23, 103, 59, 17, 29, 79, 59, 23, 347, 307, 53, 227, 131, 83, 67, 223, 29, 59, 197, 83, 181, 293, 71, 71, 139, 43, 67, 103, 431, 743, 1279, 197, 419, 127, 271, 73, 229, 503, 211, 181, 1597, 151, 151, 197, 1013, 179, 587, 71, 137, 547
Offset: 1

Views

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 118 terms are primes. Are all terms prime? For n!^i, with 0
The first 2278 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^3+i], Return[i]]]
    spn[n_]:=Module[{c=(n!)^3},NextPrime[c+1]-c]; Array[spn,60] (* Harvey P. Dale, May 25 2023 *)
  • MuPAD
    for n from 1 to 50 do f := n!^3:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1, 100, f=n!^3; print1(nextprime(f+2)-f,", ")) \\ Dana Jacobsen, May 13 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**3; say "$n ", next_prime($f+1)-$f; } # Dana Jacobsen, May 13 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A067364 a(n)=p-n!^4, where p is the smallest prime > n!^4+1.

Original entry on oeis.org

2, 3, 5, 5, 7, 29, 19, 29, 181, 19, 31, 173, 79, 43, 379, 61, 101, 127, 101, 83, 37, 29, 271, 233, 109, 233, 293, 1039, 137, 241, 173, 197, 613, 1933, 277, 71, 503, 449, 1667, 53, 67, 163, 179, 211, 53, 613, 1171, 1069, 359, 199, 839, 433, 1523, 463, 677
Offset: 1

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 102 terms are primes. Are all terms prime? For n!^i, with 0
The first 1865 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^4+i], Return[i]]]
  • MuPAD
    for n from 1 to 50 do f := n!^4:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1, 500, f=n!^4; print1(nextprime(f+2)-f, ", ")) \\ Dana Jacobsen, May 13 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**4; say "$n ", next_prime($f+1)-$f; } # Dana Jacobsen, May 13 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A067365 a(n) = p-n!^5, where p is the smallest prime > n!^5+1.

Original entry on oeis.org

2, 5, 13, 13, 7, 7, 11, 71, 23, 19, 197, 17, 101, 53, 17, 47, 73, 97, 53, 433, 251, 251, 47, 263, 281, 353, 53, 61, 179, 41, 53, 401, 449, 79, 89, 1283, 367, 2011, 139, 227, 1597, 1657, 1123, 397, 131, 727, 137, 167, 89, 379, 421, 653, 223, 373, 2221, 1447
Offset: 1

Author

Frank Buss (fb(AT)frank-buss.de), Jan 19 2002

Keywords

Comments

The first 60 terms are primes. Are all terms prime? For n!^i, with 0
The first 1592 terms are primes. - Dana Jacobsen, May 13 2015

Programs

  • Mathematica
    a[n_] := For[i=2, True, i++, If[PrimeQ[n!^5+i], Return[i]]]
    spf[n_]:=Module[{c=(n!)^5},NextPrime[c+1]-c]; Array[spf,60] (* Harvey P. Dale, Feb 24 2015 *)
  • MuPAD
    for n from 1 to 50 do f := n!^5:a := nextprime(f+2)-f:print(a) end_for
    
  • PARI
    for(n=1, 100, f=n!^5; print1(nextprime(f+2)-f, ", ")) \\ Dana Jacobsen, May 13 2015
    
  • Perl
    use ntheory ":all"; use Math::GMP qw/:constant/; for my $n (1..500) { my $f=factorial($n)**5; say "$n ", next_prime($f+1)-$f; } # Dana Jacobsen, May 13 2015

Extensions

Edited by Dean Hickerson, Mar 02 2002

A087202 a(n) is the smallest m such that m > A037153(n) and n!+ m is prime.

Original entry on oeis.org

4, 5, 7, 7, 11, 13, 19, 31, 23, 19, 19, 43, 73, 41, 149, 41, 53, 61, 109, 37, 37, 71, 109, 193, 97, 173, 59, 101, 229, 163, 241, 83, 139, 103, 83, 577, 397, 47, 269, 61, 211, 107, 97, 89, 379, 149, 269, 83, 137, 167, 281, 89, 79, 443, 229, 157, 179, 563, 389, 277
Offset: 1

Author

Farideh Firoozbakht, Sep 01 2003

Keywords

Comments

a(n) is the second m (first m is A037153(n)) such that m > 1 and n!+ m is prime.
Conjecture: For n > 1, a(n) is prime (compare the conjecture about A037153).
Conjecture holds through 1200 terms.

Crossrefs

Programs

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

Extensions

Edited by Ray Chandler, Mar 08 2010

A264050 a(n) = least m > 1 such that m + 2^n is prime.

Original entry on oeis.org

3, 3, 3, 3, 5, 3, 3, 7, 9, 7, 5, 3, 17, 27, 3, 3, 29, 3, 21, 7, 17, 15, 9, 43, 35, 15, 29, 3, 11, 3, 11, 15, 17, 25, 53, 31, 9, 7, 23, 15, 27, 15, 29, 7, 59, 15, 5, 21, 69, 55, 21, 21, 5, 159, 3, 81, 9, 69, 131, 33, 15, 135, 29, 13, 131, 9, 3, 33, 29, 25, 11, 15, 29, 37, 33
Offset: 1

Author

Alexei Kourbatov, Nov 02 2015

Keywords

Comments

The definition is similar to Fortunate numbers (A005235) but uses 2^n instead of primorial A002110(n).
Terms a(n) are often but not always prime; sometimes they are prime powers or semiprimes or have a more general form.
An analog of Fortune's conjecture for this sequence would be "a(n) is either a prime power or a semiprime." But even this relaxed conjecture is disproved by, e.g., a(62)=135, a(93)=a(97)=105, a(99)=255.
By definition, a(n) >= A013597(n). The integers n such that a(n) > A013597(n) are those with A013597(n)=1, i.e., 1, 2, 4, 8, 16, and then? - Michel Marcus, Nov 06 2015

Examples

			a(56)=81 because m=81 is the least m > 1 such that m + 2^56 is prime.
		

Crossrefs

Programs

Extensions

a(60) corrected by Charles R Greathouse IV, Nov 02 2015

A324656 a(n) is the number of successive primorials A002110(i) larger than n that need to be tried before sum n + A002110(i) is found to be composite.

Original entry on oeis.org

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

Author

Antti Karttunen, Mar 11 2019

Keywords

Comments

a(n) = 0 if n + A002110(A235224(n)), i.e., n plus {the least primorial > n} is composite.
a(n) = 1 if n + A002110(A235224(n)) is prime, but n + A002110(1+A235224(n)) is composite.
a(n) = k if n + A002110(j+A235224(n)) is prime for j=0..k-1, but n + A002110(k+A235224(n)) is composite.

Examples

			For n=1, it is not a composite number, so we add a next larger primorial (A002110) to it, which is 2, and we see that 3 is also noncomposite, thus we try to add (to the original n, which is 1) the next larger primorial, which is 6, and 7 is also prime, as are also 31, 211 and 2311. Only with A002110(6), 30030 + 1 is not a prime, thus a(1) = 5.
For n=3, the next larger primorial is 6, but 3+6 = 9 is composite, thus a(3) = 0.
For n=29, which is prime, we try adding it to four successively larger primorial numbers 30, 210, 2310, 30030, until we find 510510 which gives sum 510539 which is composite, thus a(29) = 4. In primorial base (A049345), 29 is written as 421 and the successive sums tested are: 1421, 10421, 100421, 1000421 and 10000421.
For n=121, which is not prime, but 210+121 = 331 is, while 2310+121 = 2431 is not, a(121) = 1.
		

Crossrefs

Programs

A038708 Primes of the form (k-th primorial) + (k+1)-st prime.

Original entry on oeis.org

5, 11, 37, 30047, 510529, 9699713, 13082761331670077, 32589158477190044789, 1922760350154212639131, 40729680599249024150621323549
Offset: 1

Author

Labos Elemer, May 02 2000

Keywords

Examples

			k=6: 6th primorial 2*3*5*7*11*13 + prime(7) = 300030 + 17 = 30047 is a prime.
		

Crossrefs

Programs

  • Mathematica
    With[{nn=30},Select[Total/@Thread[{FoldList[Times,Prime[ Range[ nn]]],Prime[ Range[ 2,nn+1]]}],PrimeQ]] (* Harvey P. Dale, Oct 12 2018 *)

Extensions

Next term has 149 decimal digits.

A263925 a(n) = least m > 1 such that m + (prime(n)#)^n is prime.

Original entry on oeis.org

3, 5, 11, 19, 89, 323, 29, 61, 79, 199, 563, 181, 353, 1307, 257, 709, 1237, 1277, 1609, 1237, 4157, 2017, 577, 157, 191, 1063, 239, 823, 1607, 4159, 139, 11527, 2339, 18457, 4079, 463, 1861, 1123, 8699, 16561, 719, 4327, 9311, 1693, 3067, 4243, 22397, 4079, 3989, 24071
Offset: 1

Author

Alexei Kourbatov, Oct 30 2015

Keywords

Comments

Here prime(n)# denotes the primorial A002110(n), i.e., the product of the first n primes. Terms a(n) are often (but not always) prime; out of the first fifty terms, only one (a(6)=323) is composite.
The definition is similar to Fortunate numbers (A005235); however, in A005235 the primorial is not raised to the n-th power. Unlike this sequence, all known Fortunate numbers are prime.

Examples

			(prime(2)#)^2=36. a(2)=5 because 5 is the minimal m>1 such that m+36 is prime.
		

Crossrefs

Programs

  • Mathematica
    Table[m = 2; While[! PrimeQ[m + Product[Prime@ i, {i, n}]^n], m++]; m, {n, 30}] (* Michael De Vlieger, Nov 11 2015 *)
  • PARI
    a(n)=my(s=prod(i=1,n,prime(i))^n); nextprime(s+2)-s

A375007 Numbers t which satisfy the equation: t mod k = floor((t - k)/k) mod k (1 <= k <= t) only for k = 1 and t.

Original entry on oeis.org

1, 2, 3, 4, 8, 24, 28, 40, 60, 112, 316, 508, 568, 760, 796, 1212, 1228, 2616, 5296, 6220, 8016, 12456, 14620, 16888, 21772, 23116, 23356, 25656, 30312, 30712, 30808, 32716, 33720, 38328, 46072, 52816, 59112, 61728, 67960, 69808, 72972
Offset: 1

Author

Lechoslaw Ratajczak, Jul 27 2024

Keywords

Comments

Every term greater than 3 is divisible by 4.
Let b(z) be the number of elements of this sequence <= z:
--------------
z | b(z)
--------------
10^2 | 9
10^3 | 15
10^4 | 21
10^5 | 45
10^6 | 106
10^7 | 296
10^8 | 869
--------------
Conjecture: a(n) + 1 is prime for n > 6. Verified for all terms < 10^8.
Conjecture: nextprime(u(n)) - u(n), where u(n) = Product_{m=1..n} (a(m+1) - a(m)), is a noncomposite number. Verified for all terms < 10^8.

Examples

			Let T(i,j) be the triangle read by rows: T(i,j) = 1 if i mod j = floor((i - j)/j) mod j, T(i,j) = 0 otherwise, for 1 <= j <= i. The triangle begins:
i\j | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...
-----------------------------------------
  1 | 1
  2 | 1 1
  3 | 1 0 1
  4 | 1 0 0 1
  5 | 1 1 0 0 1
  6 | 1 1 0 0 0 1
  7 | 1 0 1 0 0 0 1
  8 | 1 0 0 0 0 0 0 1
  9 | 1 1 0 1 0 0 0 0 1
 10 | 1 1 0 0 0 0 0 0 0  1
 11 | 1 0 1 0 1 0 0 0 0  0  1
 12 | 1 0 1 0 0 0 0 0 0  0  0  1
 13 | 1 1 0 0 0 1 0 0 0  0  0  0  1
 14 | 1 1 0 1 0 0 0 0 0  0  0  0  0  1
 15 | 1 0 0 0 0 0 1 0 0  0  0  0  0  0  1
...
The j-th column has period j^2.
		

Crossrefs

Programs

  • Maxima
    (f(i,j):=mod((i-floor((i-j)/j)),j),
    (n:4, for t:4 thru 100000 step 4 do
    (for k:2 while f(t,k)#0 and k
    				
Previous Showing 21-30 of 57 results. Next