login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A118664 a(n) is the least prime p such that n*(p#^2)-1 is prime or 0 if n > 1 is a square so no prime possible. 2
2, 2, 2, 0, 2, 2, 3, 2, 0, 3, 2, 2, 3, 3, 2, 0, 2, 2, 3, 2, 2, 269, 3, 3, 0, 2, 2, 7, 5, 29, 11, 2, 2, 3, 2, 0, 11, 2, 5, 3, 2, 2, 5, 3, 2, 5, 5, 2, 0, 2, 17, 3, 2, 11, 3, 2, 2, 3, 7, 2, 7, 5, 2, 0, 3, 2, 3, 2, 5, 7, 2, 3, 5, 3, 3, 5, 2, 2, 3, 3, 0, 41, 2, 3, 7, 7, 2, 3, 3, 2, 5, 2, 3, 53, 2, 2, 3, 3, 7, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
1*(2^2)-1 = 3 is prime, so a(1) = 2.
7*(2^2)-1 = 27 is composite, 7*((2*3)^2)-1 = 251 is prime, so a(7) = 3.
MATHEMATICA
a[n_] := If[n>1 && IntegerQ[Sqrt[n]], 0, Module[{p = pr = 2}, While[!PrimeQ[n * pr^2 - 1], p = NextPrime[p]; pr *= p]; p]]; Array[a, 100] (* Amiram Eldar, Sep 11 2021 *)
CROSSREFS
Sequence in context: A328995 A036476 A104994 * A223175 A322213 A118205
KEYWORD
nonn
AUTHOR
Pierre CAMI, May 19 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 03:08 EDT 2024. Contains 371918 sequences. (Running on oeis4.)