OFFSET
1,2
COMMENTS
The count includes these two odd numbers themselves and is conducted in both directions with a positive result independent of which of the two limits is larger.
FORMULA
EXAMPLE
a(2)=4 counts the 4 numbers 3, 5, 7, and 9;
a(3)=6 counts the 6 numbers 5, 7, 9, 11, 13, and 15.
MAPLE
A014076 := proc(n) if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then RETURN(a) ; fi; od: fi; end:
A163639 := proc(n) if n = 1 then 1; else onpr := A014076(n) ; pr := ithprime(n) ; 1+(max(onpr, pr)-min(onpr, pr))/2 fi; end:
seq(A163639(n), n=1..100) ; # R. J. Mathar, Aug 06 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Aug 02 2009
EXTENSIONS
Edited and corrected R. J. Mathar, Aug 06 2009
STATUS
approved