login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A087875
a[n] = pi[n-pi[n-1]] + a[n - a[n-2]], where pi(x) = number of primes <= x.
1
1, 1, 2, 3, 4, 4, 4, 5, 7, 7, 7, 8, 8, 8, 8, 9, 12, 12, 9, 10, 14, 14, 13, 13, 14, 15, 15, 16, 16, 16, 16, 17, 20, 21, 17, 17, 19, 23, 19, 21, 24, 24, 19, 20, 26, 26, 25, 25, 24, 25, 26, 27, 27, 27, 28, 28, 29, 29, 30, 30, 30, 31, 34, 34, 31, 32, 32, 32, 34, 38, 34, 36, 35, 39, 37
OFFSET
1,3
COMMENTS
A reinversion-type sequence using pi as the inverse and the Hofstadter Q-numbers A005185 as the pattern sequence.
LINKS
MATHEMATICA
hrid[n] =PrimePi[n-PrimePi[n-1]] + hrid[n - hrid[n-2]] digits=256 a=Table[hrid[n], {n, 1, digits}]
PROG
(Haskell)
import Data.List (genericIndex)
a087875 n = genericIndex a087875_list (n-1)
a087875_list = 1 : 1 : zipWith (+)
(map a087875 $ zipWith (-) [3..] a087875_list)
(map a000720 $ zipWith (-) [3..] $ tail a000720_list)
-- Reinhard Zumkeller, Sep 21 2014
CROSSREFS
Cf. A005185.
Cf. A000720.
Sequence in context: A120508 A199332 A029085 * A195848 A342731 A099777
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Oct 11 2003
STATUS
approved