A101328 Recurring numbers in the count of consecutive composite numbers between balanced primes and their lower or upper prime neighbors.
1, 5, 11, 17, 23, 29, 35, 41, 47, 53, 59, 65, 71, 77, 83, 89, 95, 101, 107, 113, 119, 125, 131, 137, 143, 149, 155, 161, 167, 173, 179, 185, 191, 197, 203, 209, 215, 221, 227, 233, 239, 245, 251, 257, 263, 269, 275, 281, 287, 293, 299, 305, 311, 317, 323, 329
Offset: 2
Keywords
Programs
-
Mathematica
balancedPrimes = {};compositeGaps = {}; Do[pPrev = Prime[i];p = Prime[i + 1]; pNext = Prime[i + 2]; If[p == (pPrev + pNext)/2, AppendTo[balancedPrimes, p]; gap1 = p - pPrev - 1; gap2 = pNext - p - 1; AppendTo[compositeGaps, gap1]; AppendTo[compositeGaps, gap2];], {i, 1, 50000}];recurringCounts = Select[Tally[compositeGaps], #[[2]] > 1 &][[All, 1]]; Sort[recurringCounts](* Hilko Koning, Apr 15 2025 *) (* or with balanced primes *) targetGaps = {1, 5, 11, 17, 23, 29, 35, 41, 47}; gapToBalancedPrimes = Association @@ (Rule[#, {}] & /@ targetGaps); Do[pPrev = Prime[i]; p = Prime[i + 1]; pNext = Prime[i + 2]; If[p == (pPrev + pNext)/2, gap1 = p - pPrev - 1; gap2 = pNext - p -1;uniqueGaps = DeleteDuplicates[{gap1, gap2}]; Do[If[KeyExistsQ[gapToBalancedPrimes, gap], gapToBalancedPrimes[gap] = Append[gapToBalancedPrimes[gap], p]], {gap,uniqueGaps}];], {i, 1, 50000}]; gapToBalancedPrimes (* Hilko Koning, Apr 15 2025 *)
Formula
If the numbers continue to differ by 6, then this is the sum of paired terms of 3n+1: (1, 4, 7, 10, 13, ...); and binomial transform of [1, 4, 2, -2, 2, -2, 2, ...]. - Gary W. Adamson, Sep 13 2007
Extensions
More terms from David Wasserman, Mar 26 2008
Comments