cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A282795 Start with n. If n is 1 or a prime, stop. Otherwise, add the prime factors of n (with repetition) to n, and repeat until reaching a prime, when we stop. If no prime is ever reached, a(n) = -1.

This page as a plain text file.
%I A282795 #27 Feb 23 2017 22:59:56
%S A282795 1,2,3,23,5,11,7,23,23,17,11,19,13,23,23,47,17,41,19,29,31,47,23,47,
%T A282795 47,41,71,71,29,71,31,83,47,53,47,71,37,59,71,71,41,83,43,59,167,71,
%U A282795 47,59,149,167,71,167,53,83,71,167,79,89,59,251,61
%N A282795 Start with n. If n is 1 or a prime, stop. Otherwise, add the prime factors of n (with repetition) to n, and repeat until reaching a prime, when we stop. If no prime is ever reached, a(n) = -1.
%C A282795 a(n) > 0 for every n up to at least 2000000. - _Ivan N. Ianakiev_, Feb 23 2017
%H A282795 R. J. Mathar, <a href="/A282795/b282795.txt">Table of n, a(n) for n = 1..100000</a>
%e A282795 4 -> 4+2+2 = 8 -> 8+2+2+2 = 14 -> 14+2+7 = 23, prime, so a(4) = 23.
%p A282795 A282795 := proc(n)
%p A282795     local nrec;
%p A282795     nrec := n ;
%p A282795     while not isprime(nrec) and nrec <> 1 do
%p A282795         nrec := A075254(nrec) ;
%p A282795     end do:
%p A282795     nrec ;
%p A282795 end proc:
%p A282795 seq(A282795(n),n=1..90) ; # _R. J. Mathar_, Feb 23 2017
%t A282795 f[n_]:=n+Total[Replace[{a_,b_}->a*b]/@FactorInteger[n]];
%t A282795 a[1]=1;a[n_]:=If[PrimeQ[n],n,Last[NestWhileList[f,n,!PrimeQ[#]&]]];
%t A282795 Array[a,2000000] (* _Ivan N. Ianakiev_, Feb 23 2017 *)
%Y A282795 Cf. A016837, A037274 (home primes), A075254, A195264.
%K A282795 nonn
%O A282795 1,2
%A A282795 _Peter Weiss_, Feb 21 2017