OFFSET
1,1
COMMENTS
Number of prime divisors (counted with multiplicity) of p+1 is 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 5, 3, 5, 3, 3, 3, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 3, 3, 3, 3, 3, 5, 3, 7, 3, 3, 5, 3, 3, 3, 5, 5, 3, 3, 3, 3, 3, ...
In this sequence, 20249 is the first p such that p+1 has even number of prime divisors (counted with multiplicity).
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) mod 8 = 1.
EXAMPLE
The prime 409 is a term because 409 = 3^2 + 20^2 and 410 = 7^2 + 19^2 = 11^2 + 17^2.
PROG
(PARI) is(n, k)=nb = 0; lim = sqrtint(n); for (x=1, lim, if ((n-x^2 >= x^2) && issquare(n-x^2), nb++); ); nb == k;
isok(n) = isprime(n) && is(n, 1) && is(n+1, 2);
(PARI) is(n)=if(n%8!=1 || !isprime(n), return(0)); my(f=factor((n+1)/2), t=1); for(i=1, #f~, if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); t==3 || t==4 \\ Charles R Greathouse IV, May 24 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, May 24 2016
STATUS
approved