A338906 Semiprimes whose prime indices sum to an even number.
4, 9, 10, 21, 22, 25, 34, 39, 46, 49, 55, 57, 62, 82, 85, 87, 91, 94, 111, 115, 118, 121, 129, 133, 134, 146, 155, 159, 166, 169, 183, 187, 194, 203, 205, 206, 213, 218, 235, 237, 247, 253, 254, 259, 267, 274, 289, 295, 298, 301, 303, 314, 321, 334, 335, 339
Offset: 1
Keywords
Examples
The sequence of terms together with their prime indices begins: 4: {1,1} 87: {2,10} 183: {2,18} 274: {1,33} 9: {2,2} 91: {4,6} 187: {5,7} 289: {7,7} 10: {1,3} 94: {1,15} 194: {1,25} 295: {3,17} 21: {2,4} 111: {2,12} 203: {4,10} 298: {1,35} 22: {1,5} 115: {3,9} 205: {3,13} 301: {4,14} 25: {3,3} 118: {1,17} 206: {1,27} 303: {2,26} 34: {1,7} 121: {5,5} 213: {2,20} 314: {1,37} 39: {2,6} 129: {2,14} 218: {1,29} 321: {2,28} 46: {1,9} 133: {4,8} 235: {3,15} 334: {1,39} 49: {4,4} 134: {1,19} 237: {2,22} 335: {3,19} 55: {3,5} 146: {1,21} 247: {6,8} 339: {2,30} 57: {2,8} 155: {3,11} 253: {5,9} 341: {5,11} 62: {1,11} 159: {2,16} 254: {1,31} 358: {1,41} 82: {1,13} 166: {1,23} 259: {4,12} 361: {8,8} 85: {3,7} 169: {6,6} 267: {2,24} 365: {3,21}
Crossrefs
A031215 looks at primes instead of semiprimes.
A098350 has this as union of even-indexed antidiagonals.
A300061 looks at all numbers (not just semiprimes).
A338904 has this as union of even-indexed rows.
A338907 is the odd version.
A338908 is the squarefree case.
A056239 gives the sum of prime indices (Heinz weight).
A087112 groups semiprimes by greater factor.
A338898, A338912, and A338913 give the prime indices of semiprimes, with product A087794, sum A176504, and difference A176506.
A338899, A270650, and A270652 give the prime indices of squarefree semiprimes, with difference A338900.
A338911 lists products of pairs of primes both of even index.
Programs
-
Mathematica
primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; Select[Range[100],PrimeOmega[#]==2&&EvenQ[Total[primeMS[#]]]&]
-
Python
from math import isqrt from sympy import primepi, primerange def A338906(n): def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 kmin = kmax >> 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def f(x): return n+x-sum((primepi(x//p)-a>>1) for a,p in enumerate(primerange(isqrt(x)+1),-1)) return bisection(f,n,n) # Chai Wah Wu, Apr 03 2025
Comments