OFFSET
1,1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = c(n+2)-2*c(n+1)+c(n), where c(n)=A002808(n).
EXAMPLE
From Gus Wiseman, Oct 10 2024: (Start)
The composite numbers (A002808) are:
4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, ...
with first differences (A073783):
2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, ...
with first differences (A073445):
0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, ...
(End)
MATHEMATICA
c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] Table[(c[w+2]-2*c[w+1])+c[w]), {w, 1, 1000}]
(* second program *)
Differences[Select[Range[100], CompositeQ], 2] (* Gus Wiseman, Oct 08 2024 *)
PROG
(Haskell)
a073445 n = a073445_list !! (n-1)
a073445_list = zipWith (-) (tail a073783_list) a073783_list
-- Reinhard Zumkeller, Jan 10 2013
(Python)
from sympy import primepi
def A073445(n):
def iterfun(f, n=0):
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m
return (a:=iterfun(f:=lambda x:n+primepi(x)+1, n))-((b:=iterfun(lambda x:f(x)+1, a))<<1)+iterfun(lambda x:f(x)+2, b) # Chai Wah Wu, Oct 03 2024
CROSSREFS
Also first differences of A054546.
Positions of zeros are A376602.
Positions of nonzeros are A376603.
A002808 lists the composite numbers.
A064113 lists positions of adjacent equal prime gaps.
A333254 gives run-lengths of differences between consecutive primes.
KEYWORD
sign,easy
AUTHOR
Labos Elemer, Aug 01 2002
STATUS
approved