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.

A173444 Either (n-th prime-1)^2-+1, but not both, is prime.

Original entry on oeis.org

1, 3, 4, 5, 7, 12, 13, 19, 31, 32, 36, 37, 42, 47, 53, 54, 55, 58, 60, 63, 78, 79, 82, 83, 91, 94, 102, 105, 106, 118, 125, 126, 133, 135, 144, 155, 156, 159, 161, 163, 178, 184, 190, 206, 210, 214, 216, 219, 247, 248, 284, 286, 288, 307, 313, 315, 322, 336, 340, 344
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 18 2010, Mar 27 2010

Keywords

Comments

Numbers n such that either A005722(n)-+1 is prime.

Examples

			1 is in the sequence because (1st prime-1)^2-1=0 is nonprime and (1st prime-1)^2+1=2 is prime;
3 is in the sequence because (3rd prime-1)^2-1=15 is nonprime and (3rd prime-1)^2+1=17 is prime.
		

Crossrefs

Programs

  • Maple
    A005722 := proc(n) (ithprime(n)-1)^2 ; end proc: for n from 1 to 800 do a := A005722(n) ; if isprime(a-1) <> isprime(a+1) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Apr 24 2010
  • Mathematica
    ppQ[n_]:=Module[{c=(Prime[n]-1)^2},Sort[PrimeQ[{c+1,c-1}]]== {False, True}]; Select[Range[400],ppQ] (* Harvey P. Dale, Jun 24 2011 *)
    Select[Range[400],Total[Boole[PrimeQ[(Prime[#]-1)^2+{1,-1}]]]==1&] (* Harvey P. Dale, Feb 01 2023 *)

Extensions

More terms from R. J. Mathar, Apr 24 2010
Definition clarified by Harvey P. Dale, Jun 24 2011