[go: up one dir, main page]

login
A373891
Number of primes less than prime(n) having the same difference between consecutive primes as prime(n).
0
0, 0, 1, 0, 2, 1, 3, 2, 0, 4, 1, 3, 5, 4, 2, 3, 6, 4, 5, 7, 5, 6, 6, 0, 7, 8, 8, 9, 9, 0, 10, 7, 10, 0, 11, 8, 9, 11, 10, 11, 12, 1, 13, 12, 14, 0, 1, 13, 15, 14, 12, 16, 2, 13, 14, 15, 17, 16, 15, 18, 3, 1, 16, 19, 17, 2, 17, 4, 20, 18, 18, 1, 19, 20, 19, 21, 2, 20, 3, 5
OFFSET
1,5
FORMULA
a(n) = |{j < n : A001223(j) = A001223(n)}|.
a(n) = A274121(n) - 1.
EXAMPLE
a(7) = 3 because A001223(7) = 2 and also A001223(2) = A001223(3) = A001223(5) = 2.
MATHEMATICA
Table[Length[Select[Range[n - 1], Prime[# + 1] - Prime[#] == Prime[n + 1] - Prime[n] &]], {n, 80}]
PROG
(PARI) a(n) = my(vp = primes(n+1), dvp = vector(#vp-1, k, vp[k+1]-vp[k])); sum(i=1, #dvp-1, dvp[i] == dvp[#dvp]); \\ Michel Marcus, Jun 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jun 21 2024
STATUS
approved