login
A316942
a(n) = n - a(pi(n)) - a(n-pi(n)) with a(1) = a(2) = 1, where pi = A000720.
0
1, 1, 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 11, 12, 12, 13, 13, 13, 13, 13, 13, 14, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 22, 23, 23, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26, 26, 26, 26, 26, 27, 27, 28, 28, 29, 30, 30, 31, 32, 32, 32, 33, 34, 35, 35, 35, 36, 37
OFFSET
1,4
COMMENTS
This sequence hits every positive integer.
FORMULA
a(n) = n - a(A000720(n)) - a(A062298(n)) with a(1) = a(2) = 1.
a(n+1) - a(n) = 0 or 1 for all n >= 1.
Conjecture : lim_{n->infinity} a(n)/n = 1/2.
MATHEMATICA
Nest[Append[#2, #1 - #2[[PrimePi[#1] ]] - #2[[#1 - PrimePi[#1] ]] ] & @@ {Length@ # + 1, #} &, {1, 1}, 73] (* Michael De Vlieger, Jul 20 2018 *)
PROG
(PARI) q=vector(75); for(n=1, 2, q[n] = 1); for(n=3, #q, q[n] = n - q[primepi(n)] - q[n-primepi(n)]); q
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jul 17 2018
STATUS
approved