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

A119624 Least k>0 such that, for n>1, 2*n^k + 1 is prime; or 0 if no such prime possible as 2*n^k + 1 is 0 mod(3).

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 3, 0, 1, 1, 0, 47, 1, 0, 1, 1, 0, 1, 2, 0, 1, 2, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 2729, 1, 0, 1, 2, 0, 1, 2, 0, 175, 1, 0, 1, 1, 0, 1, 1, 0, 1, 3, 0, 3, 3, 0, 43, 1, 0, 1, 2, 0, 1, 1, 0, 3, 2, 0, 1, 1, 0, 3, 1, 0, 11, 1, 0, 1, 4, 0, 1, 2, 0, 1, 1, 0, 3, 2, 0, 1, 1, 0, 1, 1, 0
Offset: 1

Views

Author

Pierre CAMI, Jun 08 2006

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
    if n mod 3 = 1 then return 0 fi;
      if n mod 3 = 2 then r:= 2 else r:= 1 fi;
      for k from 1 by r do if isprime(2*n^k+1) then return k fi od
    end proc:
    f(1):= 1:
    map(f, [$1..100]); # Robert Israel, Apr 02 2018
  • Mathematica
    f[n_] := Block[{k = 0}, If[Mod[n, 3] != 1, k = 1; While[ ! PrimeQ[2*n^k + 1], k++ ]; ]; k ]; Table[f[n], {n, 2, 100}] (* Ray Chandler, Jun 08 2006 *)
    Table[If[n>1 && Mod[n,3]==1, 0, k=1; While[ !PrimeQ[2n^k+1], k++ ]; k], {n,100}] (* T. D. Noe, Jun 08 2006 *)
  • PARI
    a(n) = if(n%3==1, 0, for(k=1, 2^24, if(ispseudoprime(2*n^k+1),return(k)))) \\ Eric Chen, Mar 20 2015

Extensions

Extended by Ray Chandler and T. D. Noe, Jun 08 2006

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)).
Showing 1-2 of 2 results.