login
A178698
Largest k<n such that 2*composite(n)=composite(n-k)+composite(n+k).
1
0, 1, 0, 3, 4, 5, 4, 6, 7, 4, 0, 2, 7, 0, 5, 13, 15, 16, 13, 9, 11, 15, 20, 21, 18, 19, 25, 17, 0, 2, 21, 0, 19, 23, 25, 29, 23, 27, 28, 29, 39, 23, 14, 16, 38, 39, 40, 37, 38, 39, 32, 0, 1, 29, 30, 31, 28, 29, 30, 23, 24, 25, 26, 35, 22, 23, 38, 39, 40, 50, 57, 43, 44, 54, 32
OFFSET
1,4
EXAMPLE
a(1)=0 because 2*composite(1)=composite(1-0)+composite(1+0)=4+4=8.
MATHEMATICA
Composite[n_Integer] := FixedPoint[n + PrimePi@# + 1 &, n + PrimePi@ n + 1]; f[n_] := Block[{k = n - 1, m = Composite@ n}, While[k > 0 && 2 m != Composite[n + k] + Composite[n - k], k--]; k]; Array[f, 75]
CROSSREFS
Cf. A002808 (composite numbers), A178609 (prime version).
Sequence in context: A309704 A232702 A325272 * A376244 A225072 A262906
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Dec 26 2010, Dec 31 2010
STATUS
approved