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.

A112045 Positions of primes (A000040) among nonsquares A000037.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

Also: Distance of prime(n) from the integer part of its square root. - M. F. Hasler, Oct 19 2018

Crossrefs

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

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) = A028391(A000040(n)), where A028391(x) = x - floor(sqrt(x)).
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