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.

Showing 1-4 of 4 results.

A234335 Numbers k such that distances from k to three nearest squares are three perfect squares.

Original entry on oeis.org

0, 5, 65, 160, 325, 1025, 2501, 5185, 5525, 7200, 9605, 16385, 26245, 40001, 40885, 58565, 82945, 93925, 97920, 114245, 153665, 160225, 187200, 202501, 204425, 219385, 262145, 334085, 419905, 430625, 521285, 640001, 707200, 777925, 781625, 869465, 937025, 972725
Offset: 1

Views

Author

Alex Ratushnyak, Dec 23 2013

Keywords

Comments

A subsequence of A234334.

Examples

			5 is in the sequence because the following three are perfect squares: 5-4=1, 5-1=4, 9-5=4.
65 is in the sequence because the following three are perfect squares: 65-64=1, 65-49=16, 81-65=16, where 49, 64, 81 are the three squares nearest to 65.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 isSquare(U64 a) {
      U64 r = sqrt(a);
      return r*r==a;
    }
    int main() {
      for (U64 n=0; ; ++n) {
        U64 r = sqrt(n);
        if (r*r==n && n)  --r;
        if (isSquare(n-r*r) && isSquare((r+1)*(r+1)-n)) {
          U64 rp = (r+2)*(r+2)-n;
          r = n-(r-1)*(r-1);
          if (n<=1 || rp
    				
  • Mathematica
    ps3Q[n_]:=AllTrue[Take[Sort[Abs[n-(Floor[Sqrt[n]]+{-2,-1,0,1,2})^2]],3],IntegerQ[Sqrt[#]]&]; Join[ {0},Select[Range[2,10^6],ps3Q]] (* Harvey P. Dale, Jul 03 2024 *)

A234348 Numbers k such that both distances from k to two nearest cubes are perfect cubes.

Original entry on oeis.org

0, 1, 152, 189, 513, 728, 5859, 6832, 64008, 68913, 150605, 155736, 345744, 355167, 1062936, 1090999, 1481571, 1520848, 6653933, 6742008, 7665056, 7742709, 9667693, 9796248, 15253056, 15438185, 16582104, 16592023, 16766568, 16776487, 26201448, 26460217, 28672299
Offset: 1

Views

Author

Alex Ratushnyak, Dec 24 2013

Keywords

Comments

Except a(1)=0, a(n) are numbers k such that both k-x and y-k are perfect cubes, where x and y are two nearest to k cubes: x < k <= y.

Examples

			152 is in the sequence because the following are cubes: 152-125=27 and 216-152=64, where 125 and 216 are the nearest to 152 cubes.
		

Crossrefs

Programs

  • C
    #include 
    #include    // gcc -O3 A234348.c -lgmp
    int main() {
      long long in=0;
      mpz_t n, r, i;
      mpz_init(r);
      mpz_init(i);
      mpz_init_set_ui(n, in);
      while (in < (1ULL<<32)) {
        if (mpz_root(r, n, 3) && in)  mpz_sub_ui(r, r, 1);
        mpz_mul(i, r, r);
        mpz_mul(i, i, r);
        mpz_sub(i, n, i);
        if (mpz_root(i, i, 3)) {
          mpz_add_ui(r, r, 1);
          mpz_mul(i, r, r);
          mpz_mul(i, i, r);
          mpz_sub(i, i, n);
          if (mpz_root(i, i, 3))  printf("%llu, ", in);
        }
        mpz_add_ui(n, n, 1);
        if ((++in&0xfffff)==0)  printf(".");
      }
      return 0;
    }

A234336 Triangular numbers t such that both distances from t to two nearest squares are perfect squares.

Original entry on oeis.org

0, 1, 45, 153, 325, 10440, 1385280, 2530125, 145462096, 253472356000, 896473314291600, 18598323060963360, 4923539323344237960, 27021247523935843321, 1779312917089890560241, 2355054824151326520405, 21328127890911040269960, 124797500891024855239125
Offset: 1

Views

Author

Alex Ratushnyak, Dec 23 2013

Keywords

Comments

Triangular numbers in A234334.
Except a(1)=0, a(n) are triangular numbers t such that both t-x and y-t are perfect squares, where x and y are two nearest to k squares: x < t <= y.
The sequence of k's such that triangular(k) is in A234334 begins: 0, 1, 9, 17, 25, 144, 1664, 2249, 17056, 712000, ...

Examples

			Triangular(9) = 45 is in the sequence because both 45-36=9 and 49-45=4 are perfect squares, where 36 and 49 are the two squares nearest to 45.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    typedef unsigned long long U64;
    U64 isSquare(U64 a) {
      U64 r = sqrt(a);
      return r*r==a;
    }
    int main() {
      for (U64 i=0; i<(1ULL<<32); ++i) {
        U64 n = i*(i+1)/2, r = sqrt(n);
        if (r*r==n && n)  --r;
        if (isSquare(n-r*r) && isSquare((r+1)*(r+1)-n))
          printf("%llu, ", n);
      }
      return 0;
    }

A280965 Nonsquares whose distances to the two nearest squares are squares.

Original entry on oeis.org

5, 8, 40, 45, 65, 80, 153, 160, 200, 221, 325, 360, 416, 425, 493, 520, 680, 725, 925, 936, 1025, 1040, 1073, 1088, 1305, 1360, 1768, 1800, 1813, 1845, 1961, 2000, 2320, 2385, 2501, 2600, 2925, 3016, 3185, 3200, 3400, 3445, 3848, 3869, 3944, 3965, 4640, 4745, 5185, 5248, 5265, 5328, 5525, 5576, 5785, 5920, 6120
Offset: 1

Views

Author

Emmanuel Vantieghem, Feb 27 2017

Keywords

Comments

The sequence is infinite because there are terms of it between n^2 and (n+1)^2 whenever 2n+1 is a sum of two squares.

Examples

			a(3) = 40 because the two nearest squares are 36 and 49 and 40 - 36 = 4, 49 - 40 = 9 are both squares.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[6120], IntegerQ[Sqrt[# - (Floor[Sqrt[#]])^2]] && IntegerQ[Sqrt[(Ceiling[Sqrt[#]])^2 - #]] &]
  • PARI
    is(n)=my(k=sqrtint(n)); issquare(n-k^2) && issquare((k+1)^2-n) && n>k^2 \\ Charles R Greathouse IV, Feb 27 2017
    
  • PARI
    list(lim)=my(v=List(),k2,K2,n); for(k=2,sqrtint(lim\1)-1, k2=k^2; K2=(k+1)^2; for(s=1,sqrtint(K2-k2-1), n=k2+s^2; if(issquare(K2-n), listput(v,n)))); k2=sqrtint(lim\1)^2; K2=(sqrtint(lim\1)+1)^2; for(n=k2+1,lim, if(issquare(n-k2) && issquare(K2-n), listput(v, n))); Vec(v) \\ Charles R Greathouse IV, Feb 27 2017
Showing 1-4 of 4 results.