proposed
approved
proposed
approved
editing
proposed
0, 0, 1, 2, 1, 2, 2, 2, 3, 1, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 3, 4, 3, 3, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2
P:=proc(n) local i, k, w, ok, cont; for i from 1 by 1 to n do w:=0; k:=i*2^i+1; ok:=1; if k<10 then print(0); else cont:=1; while ok=1 do while k>0 do w:=w+(k-(trunc(k/10)*10)); k:=trunc(k/10); od; if w<10 then ok:=0; print(cont); else cont:=cont+1; k:=w; w:=1; fi; od; fi; od; end: P(120);
with(numtheory): with(combinat): P:=proc(n) local a, t; t:=0; a:=n*2^n+1; while a>9 do t:=t+1; a:=convert(convert(a, base, 10), `+`); od; t;
end: seq(P(i), i=1..10^2);
Corrected entries and Maple code by Paolo P. Lava, Dec 19 2017
approved
editing
_Paolo P. Lava & _ and _Giorgio Balzarotti (paoloplava(AT)gmail.com), _, Jul 20 2007
Paolo P. Lava & Giorgio Balzarotti (pplpaoloplava(AT)splgmail.atcom), Jul 20 2007
Additive persistence of Cullen numbers.
0, 0, 1, 2, 1, 2, 2, 2, 3, 1, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 2, 3, 2, 2, 2, 2, 3, 2, 3, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 2, 3, 2, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3
1,4
Cullen number 385 --> 3+8+5=16 -->1+6=7 thus persistence is 2
P:=proc(n) local i, k, w, ok, cont; for i from 1 by 1 to n do w:=0; k:=i*2^i+1; ok:=1; if k<10 then print(0); else cont:=1; while ok=1 do while k>0 do w:=w+(k-(trunc(k/10)*10)); k:=trunc(k/10); od; if w<10 then ok:=0; print(cont); else cont:=cont+1; k:=w; w:=1; fi; od; fi; od; end: P(120);
easy,nonn,base
Paolo P. Lava & Giorgio Balzarotti (ppl(AT)spl.at), Jul 20 2007
approved