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

A246793
a(n) is the largest m such that A182134(n - k) = k for A246785(n) <= k <= m, or zero if there is no such m.
4
1, 1, 1, 1, 0, 2, 2, 2, 0, 2, 2, 2, 0, 3, 3, 2, 0, 3, 0, 4, 0, 4, 3, 2, 0, 0, 4, 0, 5, 2, 2, 0, 3, 0, 4, 4, 0, 4, 4, 4, 4, 0, 4, 0, 5, 4, 2, 0, 0, 4, 0, 5, 5, 4, 4, 0, 0, 5, 0, 6, 5, 3, 0, 0, 4, 4, 4, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 0, 5, 0, 6, 0, 0, 7
OFFSET
1,6
COMMENTS
Recall that A182134(k) is the number of primes p with prime(k) < p < prime(k)^(1+1/k). Obviously a(n) = 0 if and only if A246785(n) = 0.
LINKS
EXAMPLE
A182134(217 - k) = k for k = 3, 4, ..., 9 since A246785(217) = 3 and a(217) = 9.
MATHEMATICA
np[n_]:= If[n==0, 0, (i=Prime[n]+1; j=Prime[n]^(1+1/n); Length[Select[Range[i, j], PrimeQ]])]; a1[n_]:= (For[m=1, m<=n-1&& np[n-m] != m, m++]; m); a2[k_]:= If[c=a1[k]; c==k, 0, c]; a[n_]:= If[a2[n]==0, 0, For[r=a2[n], np[n-r]==r, r++]; r-1]; Table[a[k], {k, 2, 90}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Farideh Firoozbakht, Oct 24 2014
STATUS
approved