Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 May 06 2021 21:21:08
%S 5,4,24,4,8,22,40,4,14,16,28,10,266,40,20,46,112,156,12,20,228,26,2,
%T 220,60,140,92,42,316,132,84,70,68,50,280,164,112,146,148,30,36,126,
%U 390,30,30,38,462,114,14,86,56,168,1600,224,104,8,72,434,142,60,750,202,318
%N Smallest k such that k*13^n is a sum of two successive primes.
%C If a(n) == 0 (mod 13), then a(n+1) = a(n)/13.
%C Records: 5, 24, 40, 266, 316, 390, 462, 1600, 2616, 5834, ..., .
%C Corresponding primes are twin primes for n = 0, 2, ..., .
%H Robert G. Wilson v, <a href="/A180137/b180137.txt">Table of n, a(n) for n = 0..200</a>
%t f[n_] := Block[{k = 1, j = 13^n/2}, While[ h = k*j; PrimeQ@h || NextPrime[h, -1] + NextPrime@h != 2 h, k++ ]; k]; Array[f, 80, 0]
%o (Python)
%o from sympy import isprime, nextprime, prevprime
%o def ok(n):
%o if n <= 5: return n == 5
%o return not isprime(n//2) and n == prevprime(n//2) + nextprime(n//2)
%o def a(n):
%o k, pow13 = 1, 13**n
%o while not ok(k*pow13): k += 1
%o return k
%o print([a(n) for n in range(63)]) # _Michael S. Branicky_, May 04 2021
%Y Cf. A180130, A180131, A180132, A180133, A180134, A179975, A180135, A180136, A180138.
%K nonn
%O 0,1
%A _Zak Seidov_ & _Robert G. Wilson v_, Aug 15 2010