GEMINI NUMBERS
formula: a(n) such that if S(n) = sum_{k=1..n} prime(k), then both S(n)-1 and S(n)+1 are prime.
Let S(n) = sum of the first n primes. Then n is in the sequence if S(n)-1 and S(n)+1 are both prime. We call S(n) a "Gemini sum", and the pair (S(n)-1, S(n)+1) a "Gemini twin".
These indices start with: n = 57 → sum = 6870 → twins = (6869, 6871) n = 103 → sum = 25800 → twins = (25799, 25801) n = 123 → sum = 38238 → twins = (38237, 38239)
In the first 100,000 primes, there are 250 such indices. So, the number of Gemini twin primes observed this way is 500.
These indices must be odd, since the sum of an odd number of odd numbers (primes) is odd, and twin primes differ by 2.
GEMINI INDICES FOR FIRST 100,000 PRIMES 57 103 123 211 213 273 347 943 1073 1951 2185 2365 2375 2379 2501 2751 2761 2855 3095 3651 3731 3791 3799 4503 4529 4843 5199 5851 5927 5959 6163 7151 7305 7611 8101 8761 9045 9061 9429 9497 9741 9909 10071 10105 10401 10577 10825 12305 12323 13523 14081 14159 14215 14525 14663 15093 15303 15519 15585 15609 15633 15683 15691 15795 15841 16793 17225 17273 17491 17675 17747 17911 18033 18283 18827 19835 20139 20739 20901 21245 21253 21631 21909 21987 22059 22099 23017 23417 23779 23801 23819 23897 23937 24021 24127 24133 24209 25109 25289 26057 26449 26563 27727 27819 27931 28107 29677 29859 30075 31217 31359 31399 31617 31663 33295 33581 33951 35049 35511 35517 35767 35845 36143 36513 37057 37135 37641 38257 39503 39541 39733 40789 41123 41203 41431 41439 41849 42959 43107 43817 44069 44265 44429 45373 45835 48127 49289 49425 49539 50831 51577 51723 52167 52313 53399 54439 55499 57055 57543 57855 59305 59481 59675 59805 59831 59849 60331 60511 60745 60895 60991 63753 64081 64317 64475 64751 65533 65659 66203 66299 67643 68047 68999 69791 70003 70219 70309 72663 72827 73885 74581 74705 74745 75803 75837 76205 76207 76533 76793 78141 78365 78505 79359 80009 80259 80261 81051 81863 81901 82427 82449 82631 82709 82961 83087 83215 83495 83811 83977 85173 85281 86515 86849 87637 87971 87973 88101 88147 88215 88911 89795 89971 90473 90579 90621 90807 90965 90989 91029 91075 91357 92025 92027 94099 95011 95623 96815 97751 98403 99925
COMMONLISP PROGRAMMING CODE #| the function 'primes lists the first n primes. the function 'primep tests primality of a number. |#
(defun reduce-primes-by-addition (n) (reduce #'+ (primes n)))
(defun is-gemini-sum (index) (let ((sum (reduce-primes-by-addition index))) (let ((plus-one (1+ sum)) (minus-one (1- sum))) (when (and (primep plus-one) (primep minus-one)) index)))
(defun collect-gemini-indices () (loop for i from 1 to 100000 when (is-gemini-sum i) collect i))
RELATED SEQUENCES Cf. A007770 (twin primes), A000040 (primes), A013918 (sum of first n primes).