[go: up one dir, main page]

login
Search: a212412 -id:a212412
     Sort: relevance | references | number | modified | created      Format: long | short | data
Curling number of binary expansion of n.
+10
8
1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 2, 2, 2, 1, 1, 4, 4, 1, 1, 2, 2, 2, 1, 3, 3, 1, 2, 2, 2, 1, 1, 5, 5, 1, 1, 2, 2, 2, 1, 3, 3, 1, 3, 2, 2, 2, 1, 4, 4, 1, 1, 2, 2, 2, 2, 3, 3, 1, 2, 2, 2, 1, 1, 6, 6, 1, 1, 2, 2, 2, 1, 3, 3, 2, 2, 2, 2, 1, 1, 4, 4, 1, 2, 2, 2, 3
OFFSET
0,4
COMMENTS
Given a string S, write it as S = XYY...Y = XY^k, where X may be empty, and k is as large as possible; then k is the curling number of S.
A212439(n) = 2 * n + a(n) mod 2. - Reinhard Zumkeller, May 17 2012
LINKS
Benjamin Chaffin and N. J. A. Sloane, The Curling Number Conjecture, preprint.
EXAMPLE
731 = 1011011011 in binary, which we could write as XY^2 with X = 10110110 and Y = 1, or as XY^3 with X = 1 and Y = 011. The latter is better, giving k = 3, so a(713) = 3.
PROG
(Haskell)
import Data.List (unfoldr, inits, tails, stripPrefix)
import Data.Maybe (fromJust)
a181935 0 = 1
a181935 n = curling $ unfoldr
(\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2) n where
curling zs = maximum $ zipWith (\xs ys -> strip 1 xs ys)
(tail $ inits zs) (tail $ tails zs) where
strip i us vs | vs' == Nothing = i
| otherwise = strip (i + 1) us $ fromJust vs'
where vs' = stripPrefix us vs
-- Reinhard Zumkeller, May 16 2012
CROSSREFS
Cf. A212412 (parity), A212440, A212441, A007088, A090822, A224764/A224765 (fractional curling number).
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Apr 02 2012
STATUS
approved
a(n) = 2*n + A181935(n) mod 2.
+10
4
1, 3, 5, 6, 8, 11, 13, 15, 17, 19, 20, 22, 24, 27, 29, 30, 32, 35, 37, 38, 40, 42, 45, 47, 49, 51, 52, 54, 56, 59, 61, 63, 65, 67, 69, 70, 72, 74, 77, 79, 81, 83, 85, 86, 88, 90, 93, 94, 96, 99, 101, 102, 104, 106, 108, 111, 113, 115, 116, 118, 120, 123, 125
OFFSET
0,2
COMMENTS
a(n) = 2*n + A212412(n): concatenation of binary representation of n and the parity of its curling number;
A212444 gives iterations starting from 0.
PROG
(Haskell)
a212439 n = 2 * n + a212412 n
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 17 2012
STATUS
approved
Numbers with even curling numbers of their binary representations, cf. A181935.
+10
4
3, 4, 10, 11, 12, 15, 16, 19, 20, 21, 26, 27, 28, 35, 36, 37, 43, 44, 45, 47, 48, 51, 52, 53, 54, 58, 59, 60, 63, 64, 67, 68, 69, 73, 74, 75, 76, 79, 80, 82, 83, 84, 90, 91, 92, 99, 100, 101, 107, 108, 109, 111, 112, 115, 116, 117, 118, 122, 123, 124, 131
OFFSET
1,1
COMMENTS
A212412(a(n)) = 0; complement of A212441.
LINKS
PROG
(Haskell)
a212440 n = a212440_list !! (n-1)
a212440_list = filter (even . a181935) [0..]
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 17 2012
STATUS
approved
Numbers with odd curling numbers of their binary representations, cf. A181935.
+10
4
0, 1, 2, 5, 6, 7, 8, 9, 13, 14, 17, 18, 22, 23, 24, 25, 29, 30, 31, 32, 33, 34, 38, 39, 40, 41, 42, 46, 49, 50, 55, 56, 57, 61, 62, 65, 66, 70, 71, 72, 77, 78, 81, 85, 86, 87, 88, 89, 93, 94, 95, 96, 97, 98, 102, 103, 104, 105, 106, 110, 113, 114, 119, 120
OFFSET
1,3
COMMENTS
A212412(a(n)) = 1; complement of A212440.
LINKS
PROG
(Haskell)
a212441 n = a212441_list !! (n-1)
a212441_list = filter (odd . a181935) [0..]
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, May 17 2012
STATUS
approved

Search completed in 0.006 seconds