|
|
A131813
|
|
a(n+1) = number of preceding terms that are contained in a(n) in binary; a(0)=0.
|
|
3
|
|
|
0, 1, 1, 2, 4, 5, 5, 6, 5, 7, 3, 3, 4, 6, 8, 7, 6, 9, 7, 7, 8, 8, 9, 8, 10, 8, 11, 10, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 9, 11, 13, 15, 10, 12, 14, 16, 12, 15, 11, 14, 17, 12, 16, 13, 16, 14, 18, 12, 17, 13, 17, 14, 19, 14, 20, 15, 12, 18, 13, 18, 14, 21, 13, 19, 15, 13
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
a(n+1) = #{k: a(k) substring of a(n) in binary representation, 0<=k<=n}.
This is an interesting sequence to listen to. - N. J. A. Sloane, Sep 28 2007
|
|
LINKS
|
|
|
EXAMPLE
|
a(8) = #{a(0), a(1), a(2), a(3), a(7)} = 5;
a(9) = #{a(0), a(1), a(2), a(3), a(5), a(6), a(8)} = 7;
a(10) = #{a(1), a(2), a(9)} = 3.
|
|
PROG
|
(Haskell)
import Data.List (isInfixOf)
a131813 n = a131813_list !! n
a131813_list = 0 : f [[0]] where
f xss = y : f (bin y : xss) where
y = sum $ map (fromEnum . (flip isInfixOf $ head xss)) xss
bin n = if n == 0 then [] else b : bin n' where (n', b) = divMod n 2
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|