login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A316434 a(n) = a(pi(n)) + a(n-pi(n)) with a(1) = a(2) = 1. 5
1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 9, 10, 10, 11, 11, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 19, 20, 21, 22, 22, 22, 23, 23, 24, 25, 25, 25, 26, 27, 28, 28, 29, 30, 31, 31, 32, 32, 33, 33, 34, 35, 35, 35, 36, 36, 37, 38, 39, 39, 39, 40, 41, 42, 42, 42, 43, 44, 44 (list; graph; refs; listen; history; text; internal format)
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

a(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.

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)

    return 1 if n == 1 or n == 2 else A316434(pp) + A316434(n-pp) # Chai Wah Wu, Nov 02 2018

CROSSREFS

Cf. A000720, A062298.

Sequence in context: A086841 A076502 A076897 * A066997 A006165 A078881

Adjacent sequences:  A316431 A316432 A316433 * A316435 A316436 A316437

KEYWORD

nonn

AUTHOR

Altug Alkan, Jul 02 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 21 14:54 EDT 2020. Contains 337272 sequences. (Running on oeis4.)