Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Revision History for A131840

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing all changes.
Additive persistence of Cullen numbers.
(history; published version)
#6 by Bruno Berselli at Thu Dec 21 04:38:10 EST 2017
STATUS

proposed

approved

#5 by Paolo P. Lava at Thu Dec 21 03:44:17 EST 2017
STATUS

editing

proposed

#4 by Paolo P. Lava at Tue Dec 19 07:49:34 EST 2017
DATA

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

MAPLE

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);

EXTENSIONS

Corrected entries and Maple code by Paolo P. Lava, Dec 19 2017

STATUS

approved

editing

#3 by Charles R Greathouse IV at Fri Aug 24 10:49:59 EDT 2012
AUTHOR

_Paolo P. Lava & _ and _Giorgio Balzarotti (paoloplava(AT)gmail.com), _, Jul 20 2007

Discussion
Fri Aug 24
10:49
OEIS Server: https://oeis.org/edit/global/1825
#2 by T. D. Noe at Wed Sep 28 20:49:19 EDT 2011
AUTHOR

Paolo P. Lava & Giorgio Balzarotti (pplpaoloplava(AT)splgmail.atcom), Jul 20 2007

Discussion
Wed Sep 28
20:49
OEIS Server: https://oeis.org/edit/global/96
#1 by N. J. A. Sloane at Sat Nov 10 03:00:00 EST 2007
NAME

Additive persistence of Cullen numbers.

DATA

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

OFFSET

1,4

EXAMPLE

Cullen number 385 --> 3+8+5=16 -->1+6=7 thus persistence is 2

MAPLE

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);

CROSSREFS
KEYWORD

easy,nonn,base

AUTHOR

Paolo P. Lava & Giorgio Balzarotti (ppl(AT)spl.at), Jul 20 2007

STATUS

approved