login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A104148 Difference between n^3 and largest m less than n^3, where m > 0 is either a prime or a square. 1
1, 2, 3, 4, 5, 6, 3, 2, 3, 4, 5, 18, 3, 2, 3, 4, 5, 2, 7, 4, 9, 4, 17, 6, 3, 2, 9, 10, 7, 2, 7, 4, 3, 12, 7, 2, 3, 38, 3, 4, 11, 14, 25, 4, 9, 10, 5, 6, 9, 4, 5, 4, 7, 12, 15, 4, 9, 22, 17, 38, 7, 4, 5, 16, 5, 2, 9, 28, 11, 28, 17, 14, 3, 28, 9, 4, 5, 12, 3, 58, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,2
LINKS
FORMULA
a(n) < 2n^(3/2) - 1. Conjecturally a(n) << log^2 n. - Charles R Greathouse IV, Jun 03 2013
EXAMPLE
a(5) = 4 because largest square less than 5^3 is 121 and 125 - 121 = 4.
MATHEMATICA
lst = {}; Do[k = n^3; a = NextPrime[k, -1]; b = Floor@Sqrt[k - 1]^2; AppendTo[lst, k - Max[a, b]], {n, 2, 82}]; lst (* Arkadiusz Wesolowski, Jun 03 2013 *)
PROG
(Magma) [n^3-Maximum(Isqrt(n^3-1)^2, PreviousPrime(n^3)): n in [2..100]]; // Bruno Berselli, Jun 03 2013
(PARI) a(n)=n^3-max(sqrtint(n^3-1)^2, precprime(n^3)) \\ Charles R Greathouse IV, Jun 03 2013
CROSSREFS
Sequence in context: A043266 A082120 A352425 * A286450 A245344 A323074
KEYWORD
nonn,easy
AUTHOR
Giovanni Teofilatto, Mar 08 2005
EXTENSIONS
Offset corrected by Michel Marcus, Jun 03 2013
Edited, corrected and extended by Arkadiusz Wesolowski, Jun 03 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)