login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A038558
Smallest number with derivative n.
2
0, 2, 4, 5, 8, 9, 11, 10, 16, 17, 19, 18, 23, 22, 20, 21, 32, 33, 35, 34, 39, 38, 36, 37, 47, 46, 44, 45, 40, 41, 43, 42, 64, 65, 67, 66, 71, 70, 68, 69, 79, 78, 76, 77, 72, 73, 75, 74, 95, 94, 92, 93, 88, 89, 91, 90, 80, 81, 83, 82, 87, 86, 84, 85, 128, 129, 131, 130, 135, 134
OFFSET
0,2
LINKS
MATHEMATICA
dtn[ L_ ] := Fold[ 2#1+#2&, 0, L ]; h[ n_ ] := dtn[ {1}~Join~Table[ Mod[ 1+Apply[ Plus, Take[ IntegerDigits[ n, 2 ], k ] ], 2 ], {k, 1, Length[ IntegerDigits[ n, 2 ] ]} ] ]; Table[ h[ n ], {n, 100} ]
PROG
(Haskell)
import Data.List (elemIndex)
import Data.Maybe (fromJust)
a038558 = fromJust . (`elemIndex` a038554_list)
-- Reinhard Zumkeller, Mar 06 2013
CROSSREFS
KEYWORD
nonn,nice,easy
EXTENSIONS
More terms from Erich Friedman
a(0)=0 added and offset adjusted by Reinhard Zumkeller, Mar 06 2013
STATUS
approved