login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Positions of primes (A000040) among nonsquares A000037.
2

%I #21 Oct 19 2018 17:00:52

%S 1,2,3,5,8,10,13,15,19,24,26,31,35,37,41,46,52,54,59,63,65,71,74,80,

%T 88,91,93,97,99,103,116,120,126,128,137,139,145,151,155,160,166,168,

%U 178,180,183,185,197,209,212,214,218,224,226,236,241,247,253,255,261

%N Positions of primes (A000040) among nonsquares A000037.

%C Also: Distance of prime(n) from the integer part of its square root. - _M. F. Hasler_, Oct 19 2018

%F a(n) = A028391(A000040(n)), where A028391(x) = x - floor(sqrt(x)).

%F a(n) ~ 6/Pi^2 * n log n. - _Charles R Greathouse IV_, May 29 2013

%t 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 *)

%o (PARI) apply( A112045=n->(n=prime(n))-sqrtint(n), [1..200]) \\ _M. F. Hasler_, Oct 19 2018

%Y Cf. A000037, A000040, A028391, A071403 (the original name describes this sequence).

%K nonn

%O 1,2

%A _Antti Karttunen_, Aug 27 2005

%E Erroneous name corrected by _Antti Karttunen_, Jun 03 2014