%I #5 Oct 12 2013 15:24:51
%S -1,1,-1,1,1,-1,1,-1,1,1,-1,-1,1,1,-1,1,1,-1,1,1,-1,-1,1,1,1,-1,-1,-1,
%T 1,1,1,-1,1,1,-1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,1,-1,-1,-1,1,1,1,
%U -1,1,-1,1,-1,1,1,1,-1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,1,-1
%N Sign in term (2p +/- 1) for triangular numbers of the form p * (2p +/- 1), where the two factors are both primes.
%H Charles R Greathouse IV, <a href="/A119664/b119664.txt">Table of n, a(n) for n = 1..10000</a>
%e a(1) = -1 since 6 = 2*3 and 3 = 2*2 - 1.
%e a(4) = +1 since 21 = 3*7 and 7 = 2*3 + 1.
%o (PARI) list(x)=my(v=List());forprime(p=2,(sqrtint(x\1*8+1)+1)\4, if(isprime(2*p-1),listput(v,-1)); if(isprime(2*p+1), listput(v,1))); Vec(v) \\ _Charles R Greathouse IV_, Jun 13 2013
%Y Cf. A068443.
%K sign,easy
%O 1,1
%A _Greg Huber_, Jul 28 2006
%E Terms corrected by _Charles R Greathouse IV_, Jun 13 2013
|