|
|
A348677
|
|
a(n) is the difference between A262275(n) and the next lower prime.
|
|
3
|
|
|
1, 4, 4, 4, 6, 4, 2, 14, 6, 10, 12, 2, 6, 2, 4, 8, 4, 4, 6, 6, 6, 10, 4, 6, 4, 10, 2, 14, 14, 8, 10, 2, 18, 8, 8, 4, 10, 4, 8, 12, 6, 14, 2, 2, 2, 8, 12, 6, 10, 10, 12, 10, 8, 2, 2, 4, 6, 6, 16, 14, 6, 6, 2, 10, 6, 2, 8, 6, 20, 2, 8, 28, 6, 16, 2, 6, 2, 10, 6, 22, 4, 6, 4, 14, 6, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
This sequence can be used as an alternate method of approximating the prime-counting function pi(n).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = p_p'(n) - p_(p'(n) - 1), where p' is a prime number in the sequence A333242, p_p' is a prime number with index in A333242 (forms the prime number sequence A262275), and p_(p'(n)-1) is a prime number which is the next lower prime than those in A262275.
|
|
EXAMPLE
|
For n = 3, a(3) = 17 - 13 = 4.
|
|
MAPLE
|
b:= proc(n) option remember;
`if`(isprime(n), 1+b(numtheory[pi](n)), 0)
end:
g:= proc(n) option remember; local p; p:= g(n-1);
do p:= nextprime(p);
if b(p)::even then break fi
od; p
end: g(1):=3:
a:= n-> (t-> t-prevprime(t))(g(n)):
|
|
MATHEMATICA
|
fQ[n_]:=If[!PrimeQ[n]||(PrimeQ[n]&&FreeQ[lst, PrimePi[n]]), AppendTo[lst, n]]; k=2; lst={1}; While[k<10000000, fQ@k; k++]; tab1=Select[lst, PrimeQ]
lowerP[n_]:=Module[{m}, m=n; While[!PrimeQ[m-1], m--]; m-1]
tab2=lowerP/@tab1
tab3=tab1-tab2
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|