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.

A226069 Primes p such that p-1 is a square and p-2 is a triangular number.

Original entry on oeis.org

2, 5, 17, 17957, 4726277, 23911673957
Offset: 1

Views

Author

Alex Ratushnyak, May 25 2013

Keywords

Comments

Roots of squares: a(n)-1 = b(n)*b(n), b(n) = A226070(n).
Roots of triangular numbers: a(n)-2 = c(n)*(c(n)+1)/2, c(n) = A226071(n).
Primes of the form A006452(k)^2+1. a(7) is too large to include here (see b-file). - Max Alekseyev, Jan 30 2014

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<34)
    int main() {
      unsigned long long i, j, k, r, n=1;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP*2; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          ++n;
          if (i<(1ULL<<32))
            for (j=i*i>>1; j>3] |= 1 << (j&7);
        }
      //printf("%llu\n", n);
      for (i=1, j=i*i+1; j < TOP*2; i++,j=i*i+1)
        if(j==2 || ((j&1) && (c[j>>4] & (1<<((j>>1) & 7)))==0)) {
          k = j-2;
          r = sqrt(k*2);
          if (r*r+r==k*2) printf("%9llu %9llu %9llu\n", r, i, j);
        }
      free(c);
      return 0;
    }

Extensions

Terms a(7)-a(12) from Max Alekseyev, Jan 30 2014