%I #21 Aug 21 2024 11:16:49
%S 1,0,0,2,0,3,0,4,5,6,0,7,0,8,9,10,0,11,0,12,13,14,0,15,16,17,18,19,0,
%T 20,0,21,22,23,24,25,0,26,27,28,0,29,0,30,31,32,0,33,34,35,36,37,0,38,
%U 39,40,41,42,0,43,0,44,45,46,47,48,0,49,50,51,0,52
%N a(n) = 0 unless n is a nonprime A018252(k) then a(n) = k.
%H Reinhard Zumkeller, <a href="/A239968/b239968.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A066246(n) - A010051(n) + 1.
%F a(n) = A026233(n) - A049084(n);
%F A057427(a(n)) = A005171(n).
%o (Haskell)
%o import Data.List (unfoldr, genericIndex)
%o a239968 n = genericIndex a239968_list (n - 1)
%o a239968_list = unfoldr c (1, 1, a018252_list) where
%o c (i, z, xs'@(x:xs)) | i == x = Just (z, (i + 1, z + 1, xs))
%o | i /= x = Just (0, (i + 1, z, xs'))
%Y Cf. A005171, A010051, A018252, A057427, A066246, A049084, A026233.
%K nonn
%O 1,4
%A _Reinhard Zumkeller_, Mar 30 2014