login

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”).

A316776
a(n) is the number of integers 0 < k < n such that n^2 - k^2 is a semiprime.
0
0, 0, 0, 1, 2, 1, 1, 3, 2, 2, 3, 3, 3, 2, 3, 2, 4, 5, 1, 4, 4, 3, 3, 5, 5, 4, 5, 4, 4, 6, 2, 5, 7, 2, 6, 6, 4, 5, 8, 4, 4, 8, 5, 5, 9, 5, 5, 8, 3, 6, 8, 5, 5, 8, 6, 8, 10, 7, 5, 13, 4, 6, 10, 3, 8, 9, 6, 5, 8, 7, 8, 12, 6, 5, 12, 4, 8, 12, 4, 9, 11, 5, 5, 13, 10, 6, 11, 7, 7, 14, 6, 9, 14, 6, 8, 11
OFFSET
1,5
EXAMPLE
a(11) = 3 because 11^2 - 6^2 = 85, 11^2 - 8^2 = 57 and 11^2 - 10^2 = 21 are the only three semiprimes of the form 11^2 - k^2 with 0 < k < 11.
MATHEMATICA
a[n_] := Sum[Boole[ PrimeOmega[n^2 - k^2] == 2], {k, n-1}]; Array[a, 96] (* Giovanni Resta, Jul 13 2018 *)
PROG
(PARI) a(n) = sum(k=1, n-1, bigomega(n^2-k^2)==2); \\ Michel Marcus, Jul 12 2018
CROSSREFS
Cf. A001358.
Sequence in context: A219032 A234567 A241950 * A029308 A218879 A340381
KEYWORD
nonn
AUTHOR
Arnauld Chevallier, Jul 12 2018
STATUS
approved