|
|
A064722
|
|
a(1) = 0; for n >= 2, a(n) = n - (largest prime <= n).
|
|
17
|
|
|
0, 0, 0, 1, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,9
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 0 iff n is 1 or a prime.
|
|
EXAMPLE
|
a(26) = 26 - 23 = 3, a(37) = 37 - 37 = 0.
|
|
MAPLE
|
0, seq(n - prevprime(n+1), n=2..100); # Robert Israel, Aug 25 2014
|
|
MATHEMATICA
|
Join[{0}, Table[n-NextPrime[n+1, -1], {n, 2, 110}]] (* Harvey P. Dale, Aug 23 2011 *)
|
|
PROG
|
(PARI) { for (n = 1, 1000, if (n>1, a=n - precprime(n), a=0); write("b064722.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 23 2009
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,changed
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|