OFFSET
0,1
COMMENTS
If a(n) == 0 (mod 6), then a(n+1) = a(n)/6.
Records: 5, 12, 34, 90, 92, 124, 215, 249, 592, 601, 1099, 1282, 1406, 1589, 1700, 2688, ..., .
Corresponding primes are twin primes for n = 0, 1, 2, 3, 4, 7, 13, 15, 28, 69, 120, 162, 251, 257, 279 ..., .
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..500
MATHEMATICA
f[n_] := Block[{k = 1, j = 6^n/2}, While[ h = k*j; PrimeQ@h || NextPrime[h, -1] + NextPrime@h != 2 h, k++ ]; k]; Array[f, 80, 0]
PROG
(Python)
from sympy import nextprime, prevprime
def sum2succ(n): return n == prevprime(n//2) + nextprime(n//2)
def a(n):
if n == 0: return 5
k, pow6 = 1, 6**n
while not sum2succ(k*pow6): k += 1
return k
print([a(n) for n in range(77)]) # Michael S. Branicky, May 02 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov & Robert G. Wilson v, Aug 15 2010
STATUS
approved