A180138 Table, t, read by antidiagonals: t(b,e) is the smallest k such that k*b^e is a sum of two successive primes.
5, 5, 4, 5, 4, 2, 5, 2, 2, 1, 5, 1, 7, 6, 7, 5, 2, 4, 2, 2, 4, 5, 6, 1, 10, 9, 10, 2, 5, 1, 18, 1, 2, 8, 20, 1, 5, 2, 2, 10, 4, 8, 2, 26, 9, 5, 3, 2, 15, 30, 12, 12, 25, 22, 15, 5, 18, 1, 20, 2, 18, 2, 12, 11, 10, 8, 5, 1, 6, 6, 22, 19, 4, 1, 36, 6, 16, 4, 5, 4, 1, 24, 6, 16, 6, 28, 4, 12, 10, 8, 2
Offset: 1
Examples
.\e..0...1...2...3...4...5...6...7...8...9..10..11..12..13..14..15..16..17..18..19..20..21..22..23..24..25 .b\ .2...5...4...2...1...7...4...2...1...9..15...8...4...2...1..25..19..11..12...6...3..10...5..35..33..52..26 .3...5...4...2...6...2..10..20..26..22..10..16...8...8..72..24...8..18...6...2...6...2..10..20..20..22..20 .4...5...2...7...2...9...8...2..25..11...6..10..35..52..13..14..15..19..47..13..84..21..35...9..23..49..52 .5...5...1...4..10...2...8..12..12..36..12..28..66..30...6..18.132..36.108..34..14..48..60..12..22.150..30 .6...5...2...1...1...4..12...2...1...4...3...5...8...7..34...8..11..33..26..13...9..13..90..15..40..30...5 .7...5...6..18..10..30..18...4..28...4..30..30..60.120..38..12...6..52.120..70..10.102..60..70..10.186.174 .8...5...1...2..15...2..19...6...5..52..28..15..45..13..42..35..46..49..26..24...3..18..15..21..62..32...4 .9...5...2...2..20..22..16...8..24..18...2...2..20..22..52.104..84..38.102.100..30.192..46..22..84.176..30 10...5...3...1...6...6...6..14...6...9..19..21..21..42..93..21...6..11...2..12.111..37..39..63..38..42..24 11...5..18...6..24...6..32..40..26..20..94..50..26..10.168..30..18.196.126..70.166..30..54.130..26..50..10 12...5...1...1...2..18...8..13...6...2..11..11..39..20..12...1...8...9..31.182..24...2.126.128..66...9..86 13...5...4..24...4...8..22..40...4..14..16..28..10.266..40..20..46.112.156..12..20.228..26...2.220..60.140 ...
Links
- Robert G. Wilson v, Table of n, a(n) for n = 1..10153
Programs
-
Mathematica
t[b_, e_] := Block[{k = 1, hnp = b^e/2}, While[ h = k*hnp; PrimeQ@h || NextPrime[h, -1] + NextPrime@h != 2 h, k++ ]; k]; Table[ t[b - e, e], {b, 2, 14}, {e, 0, b - 2}] // Flatten (* to find twins other than 2&3 *) gQ[b_, e_, k_] := Block[{h = k*b^e/2}, NextPrime@h - NextPrime[h, -1] < 3 ]; Do[ If[ gQ[b - e, e, k], Print[{b - e, e}]], {b, 2, 143}, {e, 0, b - 2}]
-
Python
from sympy import isprime, nextprime, prevprime def sum2succ(n): if n <= 5: return n == 5 return not isprime(n//2) and n == prevprime(n//2) + nextprime(n//2) def T(b, e): k, powb = 1, b**e while not sum2succ(k*powb): k += 1 return k def atodiag(maxd): # maxd antidiagonals return [T(b-e, e) for b in range(2, maxd+2) for e in range(b-1)] print(atodiag(13)) # Michael S. Branicky, May 05 2021
Comments