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

A240235 Least number k such that k*n^k - 1 is prime. a(n) = 0 if no such number exists.

Original entry on oeis.org

3, 2, 1, 1, 8, 1, 2, 1, 10, 2, 2, 1, 2, 1, 2, 167, 2, 1, 12, 1, 2, 2, 29028, 1, 2, 3, 10, 2, 26850, 1, 8, 1, 42, 2, 6, 2, 24, 1, 2, 3, 2, 1, 2, 1, 2, 2, 140, 1, 2, 2, 22, 2, 8, 1, 2064, 2, 468, 6, 2, 1, 362, 1, 2, 2, 6, 3, 26, 1, 2, 3, 20, 1, 2, 1, 28, 2, 38, 5, 3024, 1, 2, 81, 858, 1
Offset: 1

Views

Author

Derek Orr, Apr 02 2014

Keywords

Comments

a(n) = 1 iff n-1 is prime.
a(145) is either 0 or > 275000. - Robert G. Wilson v, Jan 23 2017

Examples

			1*1^1 - 1 = 0 is not prime. 2*1^2 - 1 = 1 is not prime. 3*1^3 - 1 = 2 is prime. Thus, a(1) = 3.
		

Crossrefs

Programs

  • PARI
    a(n)=k=1;while(!ispseudoprime(k*n^k-1),k++);return(k); n=1;while(n<100,print(a(n));n+=1)

Extensions

a(23) and a(29) given using link. - Derek Orr, Aug 16 2014

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

Original entry on oeis.org

3, 2, 1, 1, 4, 1, 8, 1, 40, 3, 10, 1, 56, 1, 10, 0, 46, 1, 6, 1, 42, 51, 4, 1, 8, 67, 0, 18, 102, 1, 98, 1, 38, 6, 136, 0, 90, 1, 10, 3, 52, 1, 12, 1, 18, 3, 28, 1, 72, 165, 40, 657, 418, 1, 44, 205, 94, 9, 426, 1, 482, 1, 4, 0, 418, 252, 38, 1, 400, 165, 28, 1, 140
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 A097764. Note the converse is not true: a(4) = 1, not 0.
Up to a(1000), the largest term is a(456) = 947310. The PFGW program has been used to certify all the terms up to a(1000), using the 'N+1' deterministic test. - Giovanni Resta, Mar 30 2014

Examples

			1*1^1 - 1 = 0 is not prime. 1*2^1 - 1 = 1 is not prime. 1*3^1 - 1 = 2 is prime. Thus a(1) = 3.
		

Crossrefs

Programs

  • Mathematica
    nope[n_] := n > 4 && Catch@Block[{p = 2}, While[n >= p^p, If[ IntegerQ[ n^(1/p)/p], Throw@ True]; p = NextPrime@ p]; False]; a[n_] := If[nope@ n, 0, Block[{k = 1}, While[! PrimeQ[n*k^n - 1], k++]; k]]; Array[a, 80] (* Giovanni Resta, Mar 30 2014 *)
    A239938[n_] := If[n != 4 && # != 1 && GCD[n, #] != 1 &[GCD @@ FactorInteger[n][[All, -1]]], 0, NestWhile[# + 1 &, 1, Not@PrimeQ[n #^n - 1] &]]; Array[A239938, 73] (* JungHwan Min, Dec 28 2015 *)
  • PARI
    Pro(n) = for(k=1,10^4,if(ispseudoprime(n*k^n-1),return(k)));
    n=1; while(n<100,print1(Pro(n), ", ");n+=1)

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