A112045 Positions of primes (A000040) among nonsquares A000037.
1, 2, 3, 5, 8, 10, 13, 15, 19, 24, 26, 31, 35, 37, 41, 46, 52, 54, 59, 63, 65, 71, 74, 80, 88, 91, 93, 97, 99, 103, 116, 120, 126, 128, 137, 139, 145, 151, 155, 160, 166, 168, 178, 180, 183, 185, 197, 209, 212, 214, 218, 224, 226, 236, 241, 247, 253, 255, 261
Offset: 1
Keywords
Programs
-
Mathematica
f[n_]:=n-IntegerPart[Sqrt[n]]; lst={};Do[p=Prime[n];AppendTo[lst,f[p]],{n,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 24 2009 *)
-
PARI
apply( A112045=n->(n=prime(n))-sqrtint(n), [1..200]) \\ M. F. Hasler, Oct 19 2018
-
Python
from math import isqrt from sympy import prime def A112045(n): return (p:=prime(n))-isqrt(p) # Chai Wah Wu, Jun 05 2025
Formula
a(n) ~ 6/Pi^2 * n log n. - Charles R Greathouse IV, May 29 2013
Extensions
Erroneous name corrected by Antti Karttunen, Jun 03 2014
Comments