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.

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 nonprime numbers respectively in the sequence so far.

Original entry on oeis.org

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
Offset: 1

Views

Author

Greg Knowles, Sep 15 2011

Keywords

Examples

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

Crossrefs

Programs

A377791 Primes in A194627.

Original entry on oeis.org

2, 3, 41, 59, 593, 4787, 4937, 8699, 9281, 9491, 44201, 45491, 49429, 59219, 90197, 93251, 93893, 115211, 118661, 136523, 152501, 156467, 166949, 184571, 185477, 189851, 225353, 232091, 236981, 239963, 277577, 364571, 375569, 386731, 428873, 577307, 581941, 662339, 717161, 718931, 758501, 763811
Offset: 1

Views

Author

Robert Israel, Nov 10 2024

Keywords

Examples

			a(3) = 41 because the third prime in A194627 is A194627(9) = 41.
		

Crossrefs

Programs

  • Maple
    v:= 1: p:= 0: q:= 0: np:= 0: R:= NULL:
    for i from 1 while np < 100 do
      if isprime(v) then p:= p+1; R:= R, v; np:= np+1 else q:= q+1 fi;
      v:= p^2 + q^2 + 1;
    od:
    R;

Formula

a(n) = A194627(A377882(n)).
a(n) = (n-1)^2 + (A377882(n)-n)^2 + 1.
Showing 1-2 of 2 results.