login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A194627 a(1)=1, a(n+1) = p(n)^2 + q(n)^2 + 1, where p(n) and q(n) are the number of prime and non-prime numbers respectively in the sequence so far. 0
1, 2, 3, 6, 9, 14, 21, 30, 41, 46, 59, 66, 81, 98, 117, 138, 161, 186, 213, 242, 273, 306, 341, 378, 417, 458, 501, 546, 593, 602, 651, 702, 755, 810, 867, 926, 987, 1050, 1115, 1182, 1251, 1322, 1395, 1470, 1547, 1626, 1707, 1790, 1875, 1962, 2051, 2142 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

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

EXAMPLE

For n=1, we have no primes and one non-prime (a(1)=1), so a(2)=0^2+1^2+1=2. Now we have one prime (a(2)=2) and one non-prime, so a(3)=1^2+1^2+1=3.

MATHEMATICA

t = {1}; Do[ps = Count[t, _?(PrimeQ[#] &)]; AppendTo[t, ps^2 + (n - ps - 1)^2 + 1], {n, 2, 100}]; t (* T. D. Noe, Sep 15 2011 *)

PROG

(PARI) p=q=0; for(n=1, 50, print1(k=p^2+q^2+1", "); if(isprime(k), p++, q++)) \\ Charles R Greathouse IV, Sep 16 2011

CROSSREFS

Cf. A079545.

Sequence in context: A002096 A094055 A094056 * A173303 A058609 A128518

Adjacent sequences:  A194624 A194625 A194626 * A194628 A194629 A194630

KEYWORD

nonn,easy,changed

AUTHOR

Greg Knowles, Sep 15 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 23 21:22 EDT 2013. Contains 225611 sequences.