login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A108154 a(n) = n^2 - n + 1 if prime else 0. 0
0, 3, 7, 13, 0, 31, 43, 0, 73, 0, 0, 0, 157, 0, 211, 241, 0, 307, 0, 0, 421, 463, 0, 0, 601, 0, 0, 757, 0, 0, 0, 0, 0, 1123, 0, 0, 0, 0, 1483, 0, 0, 1723, 0, 0, 0, 0, 0, 0, 0, 0, 2551, 0, 0, 0, 2971, 0, 0, 3307, 0, 3541, 0, 0, 3907, 0, 0, 0, 4423, 0, 0, 4831, 0, 5113, 0, 0, 0, 5701, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..77.

EXAMPLE

1^2 - 1 + 1 = 1, which is not prime, so a(1)=0;

2^2 - 2 + 1 = 3, which is prime, so a(2)=3;

3^3 - 3 + 1 = 7, which is prime, so a(3)=7.

MATHEMATICA

f[n_] := Block[{p = n^2 - n + 1}, If[ PrimeQ[p], p, 0]]; Table[ f[n], {n, 77}] (* Robert G. Wilson v, Jun 07 2005 *)

PROG

(PARI) vector(80, n, if (isprime(p=n^2-n+1), p, 0)) \\ Michel Marcus, Jul 31 2015

CROSSREFS

Cf. A002061, A002383, A002384.

Sequence in context: A167490 A081533 A096856 * A010260 A258136 A209387

Adjacent sequences:  A108151 A108152 A108153 * A108155 A108156 A108157

KEYWORD

easy,nonn

AUTHOR

Pierre CAMI, Jun 06 2005

EXTENSIONS

More terms from Robert G. Wilson v, Jun 07 2005

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 25 22:37 EST 2021. Contains 341618 sequences. (Running on oeis4.)