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.

A239666 a(n) = least number k such that n*k^n+1 is prime, or 0 if no such number exists.

Original entry on oeis.org

1, 1, 4, 1, 8, 1, 4, 3, 10, 1, 42, 1, 60, 15, 22, 1, 8, 1, 198, 42, 10, 1, 8, 115, 34, 21, 0, 1, 54, 1, 130, 3, 4, 7, 72, 1, 778, 204, 30, 1, 108, 1, 178, 15, 14, 1, 924, 28, 234, 63, 1376, 1, 44, 3, 16, 27, 256, 1, 180, 1, 706, 51, 98, 0, 546, 1, 4, 153, 150, 1, 170
Offset: 1

Views

Author

Derek Orr, Mar 29 2014

Keywords

Comments

a(n) = 1 iff n+1 is prime.
If a(n) = 0, then n is in A097792. Note that the converse is not true: a(4) = 1, not 0.
If n is in A097792 and n > 4, then a(n) = 0. For a sketch of this proof, either n = 4b^4 for some positive integer b > 2 or n = (bp)^p for some prime p > 2 and some positive integer b. In the first case, n*k^n+1 can be factored by Sophie Germain's identity into two trinomials where neither can equal 1 since b > 2, so n*k^n+1 must be composite. In the second case, (bpk^{b^p p^(p-1)}+1) is a factor of n*k^n+1 since p is odd. - William Dean, Oct 23 2024

Examples

			3*1^3+1 = 4 is not prime. 3*2^3+1 = 25 is not prime. 3*3^3+1 = 82 is not prime. 3*4^3+1 = 193 is prime. Thus, a(3) = 4.
		

Crossrefs

Programs

  • PARI
    is_A097792(n)={my(p,t); n%4==0 && ispower(n\4, 4) || ((2 < p = ispower(n, , &t)) && if(isprime(p), t%p==0, foreach(factor(p)[, 1], q, q%2 && n%q==0 && return(1))))}
    a(n) = if(n!=4 && is_A097792(n), 0, for(k=1,oo,if(ispseudoprime(n*k^n+1),return(k)))); \\ [corrected by Andrew Howroyd, Oct 25 2024]

A239787 Numbers n such that 3n^3 - 1 is prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 14, 26, 34, 36, 40, 44, 54, 64, 66, 70, 84, 86, 92, 100, 102, 116, 122, 134, 146, 150, 152, 156, 160, 172, 174, 176, 180, 190, 194, 200, 216, 252, 254, 262, 274, 306, 320, 322, 334, 336, 350, 352, 374, 384, 402, 414, 440, 442, 444, 460
Offset: 1

Views

Author

Derek Orr, Mar 26 2014

Keywords

Comments

All the numbers in this sequence, excluding a(1), are even.

Examples

			3*2^3 - 1 = 23 is prime. Thus, 2 is a member of this sequence.
		

Crossrefs

Cf. A116954.

Programs

  • Magma
    [n: n in [0..1000] | IsPrime(3*n^3-1)]; // Vincenzo Librandi, Mar 29 2014
  • Mathematica
    Select[Range[1000], PrimeQ[3 #^3 - 1] &] (* Vincenzo Librandi, Mar 29 2014 *)
  • PARI
    s=[]; for(n=1, 1000, if(isprime(3*n^3-1), s=concat(s, n))); s \\ Colin Barker, Mar 27 2014
    
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**3) if isprime(3*(n**3)-1)}
    

A240234 Least number k such that k*n^k + 1 is prime, or 0 if no such number exists.

Original entry on oeis.org

1, 1, 2, 1, 1242, 1, 34, 5, 2, 1, 10, 1
Offset: 1

Views

Author

Derek Orr, Apr 02 2014

Keywords

Comments

a(n) = 1 if and only if n + 1 is prime.
Next term a(13), if it exists, is greater than 1000000. Other unknown terms are at index: 25, 29, 41, 47, 49, 53, 55, 69, 73, 79. (See links). - Jeppe Stig Nielsen, Aug 08 2014

Examples

			1*3^1 + 1 = 4 is not prime. 2*3^2 + 1 = 19 is prime. Thus, a(3) = 2.
		

Crossrefs

Programs

  • PARI
    a(n) = for(k=1,4000,if(ispseudoprime(k*n^k+1),return(k)))
    n=1;while(n<100,print1(a(n),", ");n++)

A239788 Numbers n such that 3n^3 +/- 1 are twin primes.

Original entry on oeis.org

4, 10, 14, 36, 54, 64, 70, 86, 150, 174, 176, 180, 200, 306, 384, 440, 494, 650, 706, 800, 824, 924, 976, 980, 986, 1020, 1026, 1054, 1360, 1464, 1504, 1506, 1536, 1564, 1604, 1680, 1724, 1736, 2066, 2076, 2116, 2134, 2136, 2166, 2200, 2220, 2314, 2380, 2456
Offset: 1

Views

Author

Derek Orr, Mar 26 2014

Keywords

Comments

Numbers in this sequence are all even.

Examples

			3*4^3-1 = 191 is prime and 3*4^3+1 = 193 is prime. Thus, 4 is a member of this sequence.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..5000] | IsPrime(3*n^3-1) and IsPrime(3*n^3+1)]; // Vincenzo Librandi, Mar 29 2014
  • Mathematica
    Select[Range[5000], PrimeQ[3 #^3 - 1] && PrimeQ[3 #^3 + 1]&] (* Vincenzo Librandi, Mar 29 2014 *)
  • PARI
    s=[]; for(n=1, 3000, if(isprime(3*n^3-1) && isprime(3*n^3+1), s=concat(s, n))); s \\ Colin Barker, Mar 27 2014
    
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(3*(n**3)+1) and isprime(3*(n**3)-1)}
    
Showing 1-4 of 4 results.