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.

A268509 Numbers x such that x^3 = y^2 + z for some y and some nonzero z with -x < z < x.

This page as a plain text file.
%I A268509 #29 Mar 21 2016 21:22:46
%S A268509 2,3,5,13,15,17,32,35,37,40,43,46,52,56,63,65,99,101,109,136,143,145,
%T A268509 152,158,175,190,195,197,243,255,257,312,317,323,325,331,336,351,356,
%U A268509 366,377,399,401,422,483,485,560,568,575,577,584,592,654,675,677,717,741,783,785,799,810,891,899,901,909,937,944,978
%N A268509 Numbers x such that x^3 = y^2 + z for some y and some nonzero z with -x < z < x.
%C A268509 List of x such as x^3 is a near square (see examples).
%C A268509 Note that z = 17 appears often (see A029728).
%H A268509 Daniel Mondot, <a href="/A268509/b268509.txt">Table of n, a(n) for n = 1..10000</a>
%e A268509 2^3 = 3^2 - 1;
%e A268509 3^3 = 5^2 + 2;
%e A268509 5^3 = 11^2 + 4;
%e A268509 13^3 = 47^2 - 12;
%e A268509 15^3 = 58^2 + 11;
%e A268509 17^3 = 70^2 + 13;
%e A268509 32^3 = 181^2 + 7;
%e A268509 35^3 = 207^2 + 26;
%e A268509 37^3 = 225^2 + 28;
%e A268509 40^3 = 253^2 - 9;
%e A268509 43^3 = 282^2 - 17;
%e A268509 46^3 = 312^2 - 8;
%e A268509 52^3 = 375^2 - 17;
%e A268509 56^3 = 419^2 + 55;
%e A268509 63^3 = 500^2 + 47;
%e A268509 65^3 = 524^2 + 49;
%e A268509 99^3 = 985^2 + 74.
%o A268509 (C)
%o A268509 #include <stdio.h>
%o A268509 #include <stdlib.h>
%o A268509 #include <math.h>
%o A268509 #define MAX2 10000
%o A268509 /* list number x and y such that x^3 = y^2 ± delta (0 < delta < x) */
%o A268509 /* this generates A268509 and A268510 */
%o A268509 long long unsigned b,c,d;
%o A268509 long long signed ds;
%o A268509 unsigned long long list2[MAX2];
%o A268509 unsigned long long list3[MAX2];
%o A268509 long double b1, cd, dd;
%o A268509 void main(unsigned argc, char *argv[])
%o A268509 {
%o A268509 unsigned a, i;
%o A268509   i=0;
%o A268509   // I never actually calculate b^3 or c^2, but only b^(3/2) = c + ds
%o A268509   // this allows me to indirectly check b^3 past 2^64
%o A268509   for (b=0; b<100000000; ++b) // could go up to b<4294967295u; max
%o A268509   {
%o A268509     b1 = sqrtl(b);
%o A268509     cd= b1 *(long double)b;
%o A268509     c=(long long unsigned)(cd+(double)0.5);
%o A268509     dd = 2 * c * (cd - c);
%o A268509     if (dd<0) ds = (dd - 0.5);
%o A268509     else ds = (dd + 0.5);
%o A268509     d = llabs(ds);
%o A268509     if (d<b) // d = abs(b^3 - c^2)
%o A268509     {
%o A268509       if (ds)
%o A268509       {
%o A268509         if (i<MAX2)
%o A268509         {
%o A268509           list2[i]= b;
%o A268509           list3[i++]= c;
%o A268509         }
%o A268509       }
%o A268509     }
%o A268509   }
%o A268509   // generate A268509 */
%o A268509   for (a=0; a<i; ++a) printf("%u %llu\n", a+1, list2[a]);
%o A268509   printf("\n\n");
%o A268509   // generate A268510 */
%o A268509   for (a=0; a<i; ++a) printf("%u %llu\n", a+1, list3[a]);
%o A268509   printf("\n\n");
%o A268509 }
%o A268509 (PARI) is(n)=my(t=abs(n^3-round(n^1.5)^2)); 0<t && t<n \\ _Charles R Greathouse IV_, Feb 09 2016
%Y A268509 Cf. A029728, A253181, A268510.
%K A268509 nonn
%O A268509 1,1
%A A268509 _Daniel Mondot_, Feb 06 2016