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.

A250200 Least number k>1 such that (2n-1)^k - 2 is prime, or 0 if no such number exists.

Original entry on oeis.org

0, 2, 2, 2, 2, 4, 2, 2, 6, 2, 2, 24, 7, 2, 2, 3, 2, 2, 2, 4, 4, 2, 11, 2, 2, 8, 4, 2, 12, 4, 2, 2, 8, 3, 2, 2, 4, 2, 2, 38, 130, 4, 4, 4, 2, 3, 2, 4, 747, 3, 4, 2, 10, 2, 3, 17, 10, 13, 2, 2, 2, 6, 42, 2, 3, 2, 6, 2, 10, 2, 4, 4, 2, 16, 50, 3, 9, 2, 22, 25
Offset: 1

Views

Author

Robert Price, Mar 02 2015

Keywords

Crossrefs

Programs

  • Mathematica
    lst = {0}; For[n = 2, n ≤ 143, n++, For[k = 2, k >= 1, k++, If[PrimeQ[(2*n - 1)^k - 2], AppendTo[lst, k]; Break[]]]]; lst
    lnk[n_]:=Module[{k=2,c=2n-1},While[!PrimeQ[c^k-2],k++];k]; Join[{0}, Array[ lnk,80,2]] (* Harvey P. Dale, Jul 24 2017 *)

A253178 Least k>=1 such that 2*A007494(n)^k+1 is prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 47, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 1, 1, 1, 2729, 1, 1, 2, 1, 2, 175, 1, 1, 1, 1, 1, 1, 3, 3, 3, 43, 1, 1, 2, 1, 1, 3, 2, 1, 1, 3, 1, 11, 1, 1, 4, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 192275, 2, 1233, 1, 3, 5, 51, 1, 1, 1, 1, 286, 1, 1, 755, 2, 1, 4, 1, 6, 1, 2
Offset: 1

Views

Author

Eric Chen, Mar 20 2015

Keywords

Comments

If n == 1 (mod 3), then for every positive integer k, 2*n^k+1 is divisible by 3 and cannot be prime (unless n=1). Thus we restrict the domain of this sequence to A007494 (n which is not in the form 3j+1).
Conjecture: a(n) is defined for all n.
a(145) > 200000, a(146) .. a(156) = {1, 1, 66, 1, 4, 3, 1, 1, 1, 1, 6}, a(157) > 100000, a(158) .. a(180) = {2, 1, 2, 11, 1, 1, 3, 321, 1, 1, 3, 1, 2, 12183, 5, 1, 1, 957, 2, 3, 16, 3, 1}.
a(n) = 1 if and only if n is in A144769.

Crossrefs

Programs

  • Mathematica
    A007494[n_] := 2n - Floor[n/2];
    Table[k=1; While[!PrimeQ[2*A007494[n]^k+1], k++]; k, {n, 1, 144}]
  • PARI
    a007494(n) = n+(n+1)>>1;
    a(n) = for(k=1, 2^24, if(ispseudoprime(2*a007494(n)^k+1),return(k)));

Formula

a(n) = A119624(A007494(n)).

A292201 a(n) is the smallest value c such that prime(n)^c - 2 is prime, where prime(n) is the n-th prime or -1 if no such c exists.

Original entry on oeis.org

2, 2, 1, 1, 4, 1, 6, 1, 24, 2, 1, 2, 4, 1, 2, 4, 4, 1, 3, 2, 1, 38, 4, 2, 747, 4, 1, 2, 1, 10, 2, 2, 10, 1, 50, 1, 22, 38, 12, 2, 40, 1, 2, 1, 164, 1, 2, 2, 12, 1, 2, 2, 1, 8, 2, 18, 22, 1, 3, 10, 1, 2, 102, 4, 1, 13896, 12, 2, 1122, 1
Offset: 1

Views

Author

Michel Marcus, Sep 11 2017

Keywords

Comments

a(71) > 38000 (if it exists). - Robert Price, Oct 23 2017

Examples

			a(1) = 2 because 2^2 - 2 = 2 is prime;
a(2) = 2 because 3^2 - 2 = 7 is prime;
a(3) = 1 because 5^1 - 2 = 3 is prime;
a(4) = 1 because 7^1 - 2 = 5 is prime.
And these are the least exponents to satisfy the requested property.
		

Crossrefs

Subsequence of A255707.

Programs

  • Mathematica
    Table[c = 1; While[! PrimeQ[Prime[n]^c - 2], c++]; c, {n, 24}] (* Michael De Vlieger, Sep 11 2017 *)
  • PARI
    a(n) = {my(c = 1, p = prime(n)); while(!isprime(p^c-2), c++); c;}

Extensions

a(66)-a(70) from Robert Price, Oct 23 2017

A332029 a(n) is the least number k > 0 such that n^k - (n mod 2) - 1 is prime, or 0 if no such number exists.

Original entry on oeis.org

0, 2, 2, 1, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 1, 0, 6, 1, 1, 1, 1, 0, 24, 1, 1, 0, 2, 0, 2, 1, 1, 1, 1, 0, 2, 0, 2, 1, 1, 0, 4, 1, 1, 1, 1, 0, 2, 1, 1, 0, 8, 0, 4, 1, 1, 0, 12, 0, 4, 1, 1, 1, 1, 0, 8, 0, 3, 1, 1, 0, 2, 1, 1, 1, 1, 0, 2, 0, 38, 1, 1, 0, 4, 1, 1, 0, 4
Offset: 1

Views

Author

Todor Szimeonov, Feb 05 2020

Keywords

Crossrefs

Formula

For k >= 1, a(2*k+2) = A101264(k), a(2*k-1) = A255707(k). - Jinyuan Wang, Feb 07 2020
a(n) = 0 for n in A238204. - Michel Marcus, Feb 08 2020 [Proof: a(n) = 1 iff n - 1 is a prime because n^k - 1 is divisible by n - 1, where k > 1 and n is an even number greater than 2. But if n is a term in A238204, n - m is prime only for some m >= 3. Therefore, a(n) = 0 for n in A238204. - Jinyuan Wang, Feb 08 2020]

Extensions

More terms from Jinyuan Wang, Feb 07 2020
Showing 1-4 of 4 results.