login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A018845 Number of iterations required for the sum of n and its prime divisors = t to reach a prime (where t replaces n in each iteration) in A016837. 2
4, 2, 3, 2, 1, 2, 2, 2, 1, 3, 1, 2, 1, 1, 3, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 3, 3, 2, 3, 5, 4, 1, 1, 1, 2, 2, 1, 2, 2, 10, 3, 2, 1, 6, 1, 3, 1, 5, 5, 1, 5, 3, 2, 1, 5, 1, 1, 2, 7, 3, 4, 4, 4, 1, 10, 3, 1, 4, 6, 3, 6, 3, 1, 6, 3, 4, 2, 2, 2, 2, 9, 2, 5, 1, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

LINKS

Robert Israel, Table of n, a(n) for n = 2..10000

FORMULA

Factor n, add n and its prime divisors. Sum = t, t replaces n, repeat until a prime is produced in k iterations.

For x in A050703, a(x) = 1. - Michel Marcus, Jul 24 2015

Number of iterations x->A075254(x) to reach a prime, starting at x=n. - R. J. Mathar, Jul 27 2015

EXAMPLE

Starting with 4, 4=2*2, so 4+2+2=8. 8=2*2*2 so 8+2+2+2=14. 14=2*7 so 14+2+7=23, prime in 3 iterations, so a(4)=3.

MAPLE

f:= proc(n) option remember; local t;

   t:= n + convert(map(convert, ifactors(n)[2], `*`), `+`);

   if isprime(t) then 1 else 1+procname(t) fi

end proc:

map(f, [$2..100]); # Robert Israel, Jul 26 2015

PROG

(PARI) sfpn(n) = {my(f = factor(n)); n + sum(k=1, #f~, f[k, 1]*f[k, 2]); }

a(n) = {nb = 1; while (! isprime(t=sfpn(n)), n=t; nb++); nb; }

CROSSREFS

Cf. A016837, A050703, A075254.

Sequence in context: A016513 A063447 A304786 * A028947 A068152 A278970

Adjacent sequences:  A018842 A018843 A018844 * A018846 A018847 A018848

KEYWORD

easy,nonn

AUTHOR

Enoch Haga, Carlos Rivera, Patrick De Geest

EXTENSIONS

Corrected by Michel Marcus, Jul 24 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 18 05:17 EDT 2018. Contains 316304 sequences. (Running on oeis4.)