A175117 Numbers k such that Sum_(i=1..k) prime(i)*(-1)^(i+1) is a square.
3, 9, 55, 181, 215, 459, 1361, 1417, 1623, 2047, 2445, 4685, 6687, 7353, 7785, 7925, 8489, 10333, 10515, 11179, 14087, 15227, 15829
Offset: 1
Examples
2 - 3 + 5 = 4, thus a(1)=3; 2 - 3 + 5 - 7 + 11 - 13 + 17 - 19 + 23 = 16, thus a(2)=9.
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..300
Crossrefs
Cf. A000040.
Programs
-
Mathematica
Flatten[Position[Accumulate[Times@@@Partition[Riffle[Prime[Range[ 20000]], {1,-1},{2,-1,2}],2]],?(IntegerQ[Sqrt[#]]&)]] (* _Harvey P. Dale, Mar 19 2013 *)
Extensions
Six more terms from R. J. Mathar, Feb 21 2010
Comments