login
Let S = A089237\{0} = union of primes and nonzero squares; sequence gives indices of squares.
3

%I #20 Oct 13 2024 02:59:40

%S 1,4,7,10,14,17,22,26,31,35,41,46,52,58,63,70,78,84,91,98,106,114,122,

%T 129,139,148,156,165,175,184,193,204,214,225,235,246,256,266,279,291,

%U 304,316,326,339,351,365,376,390,406,417,429,445,462,475,489,501,514

%N Let S = A089237\{0} = union of primes and nonzero squares; sequence gives indices of squares.

%H Reinhard Zumkeller, <a href="/A161187/b161187.txt">Table of n, a(n) for n = 1..1000</a>

%F A089237(a(n)+1) = A000290(n). - _Reinhard Zumkeller_, Dec 18 2012

%t Table[PrimePi[n^2 - 1] + n, {n, 60}] (* _Vincenzo Librandi_, Feb 18 2016 *)

%o (Haskell)

%o a161187 n = a161187_list !! (n-1)

%o a161187_list = tail $ findIndices ((== 1) . a010052) a089237_list

%o -- _Reinhard Zumkeller_, Dec 18 2012

%o (Magma) [1] cat [#PrimesUpTo(n^2-1)+n: n in [2..100]]; // _Vincenzo Librandi_, Feb 18 2016

%o (Python)

%o from sympy import primepi

%o def A161187(n): return n+primepi(n**2) # _Chai Wah Wu_, Oct 12 2024

%Y Cf. A089237. Complement of A161188.

%Y Cf. A050052.

%K easy,nonn

%O 1,2

%A _Daniel Tisdale_, Jun 06 2009

%E Edited by _N. J. A. Sloane_, Jun 07 2009

%E Extended by _Ray Chandler_, May 06 2010