login
A362721
Number of numbers k, 1 <= k <= n, such that pi(k) = pi(n-k+1).
1
1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, 1, 2, 3
OFFSET
1,6
FORMULA
a(n) = Sum_{k=1..n} [pi(k) = pi(n-k+1)], where pi is the prime counting function (A000720) and [ ] is the Iverson bracket.
EXAMPLE
There are two cases for a(6) due to symmetry, namely k=3: pi(3) = 2 = pi(6-3+1) and k=4: pi(4) = 2 = pi(6-4+1).
MATHEMATICA
Table[Sum[KroneckerDelta[PrimePi[n - k + 1], PrimePi[k]], {k, n}], {n, 100}]
PROG
(PARI) a(n) = sum(k=1, n, primepi(k) == primepi(n-k+1)); \\ Michel Marcus, May 01 2023
CROSSREFS
Cf. A000720.
Sequence in context: A065368 A010751 A194523 * A180714 A170959 A170960
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 30 2023
STATUS
approved