A185718 For positive n with prime decomposition n = Product_{j=1..m} (p_j^k_j) define A_n = Sum_{j=1..m} (p_j*k_j) and B_n = Sum_{j=1..m} (p_j^k_j). This sequence gives those n for which A_n and B_n are both prime and B_n = A_n + 2 (i.e., form a twin prime pair).
40, 88, 184, 424, 808, 1048, 1384, 1528, 1864, 2104, 2184, 3080, 4504, 4744, 5224, 5928, 6440, 6568, 7224, 8104, 8360, 8840, 9784, 10264, 10472, 11480, 11544, 11848, 12808, 12904, 14136, 14840, 14968, 16280, 16648, 18664, 19608, 20344, 21080, 22040, 23240, 23704, 24440, 24648, 24920, 26008, 26584, 27384, 27608, 27688, 28264, 28952, 29240
Offset: 1
Keywords
Examples
a(1) = 40 = 2^3*5^1, with a = 11 and b = 13. a(2) = 88 = 2^3*11^1 with a = 17 and b = 19. a(3) = 184 = 2^3*23^1 with a = 29 and b = 31.
Links
- T. D. Noe, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
okQ[n_] := Module[{p, e, a, b}, {p, e} = Transpose[FactorInteger[n]]; a = Plus @@ (p*e); b = Plus @@ (p^e); b == a + 2 && PrimeQ[a] && PrimeQ[b]]; Select[Range[30000], okQ]
-
PARI
sopfr(n)=my(f=factor(n));sum(i=1,#f[,1],f[i,1]*f[i,2]); forstep(n=8,1e5,16,if(issquarefree(n/8)&&isprime(k=sopfr(n))&isprime(k+2), print1(n", ")))
Comments