OFFSET
1,3
COMMENTS
This sequence hits every positive integer.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Altug Alkan, A plot of a(n)/n
Altug Alkan and Orhan Ozgur Aybar, On a Family of Sequences Related to Prime Counting Function, International Journal of Statistics and Probability Vol. 7, No. 6; 2018.
Rémy Sigrist, C++ program for A316434
FORMULA
MAPLE
f:= proc(n) option remember: local p;
p:= numtheory:-pi(n);
procname(p) + procname(n-p)
end proc:
f(1):= 1: f(2):= 1:
map(f, [$1..100]); # Robert Israel, Jul 03 2018
MATHEMATICA
a[1]=a[2]=1; a[n_] := a[n] = a[PrimePi[n]] + a[n - PrimePi[n]]; Array[a, 75] (* Giovanni Resta, Nov 02 2018 *)
PROG
(PARI) q=vector(75); for(n=1, 2, q[n] = 1); for(n=3, #q, q[n] = q[primepi(n)] + q[n-primepi(n)]); q
(C++) See Links section.
(Python)
from sympy import primepi
def A316434(n):
pp = primepi(n)
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jul 02 2018
STATUS
approved