OFFSET
1,1
COMMENTS
List of x such as x^3 is a near square (see examples).
Note that z = 17 appears often (see A029728).
LINKS
Daniel Mondot, Table of n, a(n) for n = 1..10000
EXAMPLE
2^3 = 3^2 - 1;
3^3 = 5^2 + 2;
5^3 = 11^2 + 4;
13^3 = 47^2 - 12;
15^3 = 58^2 + 11;
17^3 = 70^2 + 13;
32^3 = 181^2 + 7;
35^3 = 207^2 + 26;
37^3 = 225^2 + 28;
40^3 = 253^2 - 9;
43^3 = 282^2 - 17;
46^3 = 312^2 - 8;
52^3 = 375^2 - 17;
56^3 = 419^2 + 55;
63^3 = 500^2 + 47;
65^3 = 524^2 + 49;
99^3 = 985^2 + 74.
PROG
(C)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define MAX2 10000
/* list number x and y such that x^3 = y^2 ± delta (0 < delta < x) */
long long unsigned b, c, d;
long long signed ds;
unsigned long long list2[MAX2];
unsigned long long list3[MAX2];
long double b1, cd, dd;
void main(unsigned argc, char *argv[])
{
unsigned a, i;
i=0;
// I never actually calculate b^3 or c^2, but only b^(3/2) = c + ds
// this allows me to indirectly check b^3 past 2^64
for (b=0; b<100000000; ++b) // could go up to b<4294967295u; max
{
b1 = sqrtl(b);
cd= b1 *(long double)b;
c=(long long unsigned)(cd+(double)0.5);
dd = 2 * c * (cd - c);
if (dd<0) ds = (dd - 0.5);
else ds = (dd + 0.5);
d = llabs(ds);
if (d<b) // d = abs(b^3 - c^2)
{
if (ds)
{
if (i<MAX2)
{
list2[i]= b;
list3[i++]= c;
}
}
}
}
// generate A268509 */
for (a=0; a<i; ++a) printf("%u %llu\n", a+1, list2[a]);
printf("\n\n");
// generate A268510 */
for (a=0; a<i; ++a) printf("%u %llu\n", a+1, list3[a]);
printf("\n\n");
}
(PARI) is(n)=my(t=abs(n^3-round(n^1.5)^2)); 0<t && t<n \\ Charles R Greathouse IV, Feb 09 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel Mondot, Feb 06 2016
STATUS
approved