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-2 of 2 results.

A226231 Nontrivial prime powers (A025475) which are a sum of a smaller nontrivial prime power and a perfect square in more than 1 way.

Original entry on oeis.org

25, 125, 512, 3125, 4913, 50653, 78125, 7645373, 48828125, 69343957, 310288733, 410338673, 1220703125, 4103684801, 24820429213, 164296466333, 296709280757, 762939453125, 1772000266301, 10368641602001, 11392143817501, 19073486328125, 29724740184833, 72079590632113
Offset: 1

Views

Author

Alex Ratushnyak, May 31 2013

Keywords

Comments

Subsequence of A226230.

Examples

			125 = 4 + 11^2 = 25 + 10^2 = 121 + 4^2. Because there are three representations, 125 is in the sequence. Note that 100 + 5^2 is not listed, because 100 is not a prime power.
		

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<32)
    typedef unsigned long long U64;
    int compare64(const void *p1, const void *p2) {
      if (*(U64*)p1== *(U64*)p2) return 0;
      return (*(U64*)p1 < *(U64*)p2) ? -1 : 1;
    }
    int main() {
      U64 i, j, k, p, t, r, n=0, *pp = (U64*)malloc(TOP/2);
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (pp[n++] = i = 1; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          for (p=i+(i==1), j = p*p; ; j*=p) {
            pp[n++] = j;
            double k = ((double)j) * ((double)p);
            if (k >= ((double)(1ULL<<62)*4.0)) break;
          }
          if(i>1) for (j=i*i>>1; j>3]|= 1<<(j&7);
        }
      qsort(pp, n, 8, compare64);
      for (i = 0; i < n; i++)
        for (p=pp[i], j = k = 0; j < i; j++) {
          t = p - pp[j];
          r = sqrt(t);
          if (r*r==t && ++k==2) { printf("%llu, ", p); break; }
        }
      return 0;
    }

A226232 Nontrivial prime powers (A025475) which are a sum of a smaller nontrivial prime power and a perfect cube.

Original entry on oeis.org

9, 16, 128, 243, 512, 841, 1024, 1849, 5041, 6561, 8192, 32041, 65536, 76729, 157609, 177147, 187489, 310249, 524288, 734449, 1104601, 4108729, 4194304, 4782969, 5067001, 7778521, 11498881, 12823561, 31956409, 33554432, 38651089, 65302561, 78552769, 90459121, 129140163
Offset: 1

Views

Author

Alex Ratushnyak, May 31 2013

Keywords

Crossrefs

Programs

  • Maple
    for n from 1 do
        if isA025475(n) then
            for j from 1 do
                pj := n-j^3 ;
                if pj < 0 then
                    break;
                elif isA025475(pj) then
                    printf("%d,\n",n);
                    break ;
                end if;
            end do:
        end if:
    end do: # R. J. Mathar, Jun 06 2013
Showing 1-2 of 2 results.