|
|
A239968
|
|
a(n) = 0 unless n is a nonprime A018252(k) then a(n) = k.
|
|
11
|
|
|
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, 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, 39, 40, 41, 42, 0, 43, 0, 44, 45, 46, 47, 48, 0, 49, 50, 51, 0, 52
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Haskell)
import Data.List (unfoldr, genericIndex)
a239968 n = genericIndex a239968_list (n - 1)
a239968_list = unfoldr c (1, 1, a018252_list) where
c (i, z, xs'@(x:xs)) | i == x = Just (z, (i + 1, z + 1, xs))
| i /= x = Just (0, (i + 1, z, xs'))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,changed
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|