OFFSET
1,1
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
LINKS
Max Alekseyev, Table of n, a(n) for n = 1..12
PROG
(C)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#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<TOP; j+=i) c[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;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 25 2013
EXTENSIONS
Terms a(7)-a(12) from Max Alekseyev, Jan 30 2014
STATUS
approved