A253138 Number of ways to represent the n-th prime as the arithmetic mean of two semiprimes.
0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 1, 3, 2, 4, 3, 4, 3, 3, 5, 7, 6, 5, 5, 8, 8, 7, 9, 7, 10, 10, 12, 11, 15, 12, 14, 14, 13, 11, 13, 15, 15, 14, 15, 20, 14, 15, 19, 20, 16, 17, 17, 17, 21, 24, 23, 24, 28, 23, 25, 24, 27, 25, 32, 29, 25, 21, 26, 31, 31, 29, 36, 32
Offset: 1
Keywords
Examples
a(12)=3 as prime(12) = 37 = (9+65)/2 = (25+49)/2 =(35+39)/2 where 9, 25, 35, 39, 49 and 65 are semiprime.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..1000
Programs
-
Haskell
a253138 n = sum $ map a064911 $ takeWhile (> 0) $ map (2 * p -) $ dropWhile (< p) a001358_list where p = a000040 n -- Reinhard Zumkeller, Mar 27 2015
-
Maple
with(numtheory):for n from 1 to 100 do:c:=0:p:=ithprime(n):for m from 1 to p-1 do:p1:=p-m:p2:=p+m:if bigomega(p1)=2 and bigomega(p2)=2 then c:=c+1:else fi:od:printf(`%d, `,c):od:
-
Mathematica
Reap[For[n=1, n <= 100, n++, c=0; p = Prime[n]; For[m=1, m <= p-1, m++, p1 = p-m; p2 = p+m; If[PrimeOmega[p1] == 2 && PrimeOmega[p2] == 2 , c = c+1]]; Print[c]; Sow[c]]][[2, 1]] (* Jean-François Alcover, Mar 23 2015, translated from Maple *)
Comments