Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #83 Oct 06 2016 05:15:17
%S 2,4,6,9,12,15,18,21,24,27,30,35,40,45,48,51,54,57,60,65,70,77,84,91,
%T 98,105,108,111,114,133,140,147,150,155,160,165,168,175,180,185,190,
%U 209,220,231,234,247,260,273,276,299,312,325,330,341,352,363,366,427
%N Start from a(1) = 2, then alternately add either the largest (if n is even), or the smallest (if n is odd) prime factor of the preceding term a(n-1) to get a(n).
%C After the initial term, each even-indexed term equals the preceding term plus its largest prime factor, and each odd-indexed term equals the preceding term plus its smallest prime factor.
%C See also sequence A076271 where a(n+1) = a(n) + lpf(a(n)).
%C Each term shares exactly one prime factor with the immediately preceding term, and because the sequence is strictly increasing, all the terms after 2 are composite. - _Antti Karttunen_, Apr 19 2015
%C From a(3) onward, the terms are alternately even and odd. - _Jan Guichelaar_, Apr 24 2015
%C a(2*n) = A070229(a(2*n-1)); a(2*n+1) = A061228(a(2*n)). - _Reinhard Zumkeller_, May 06 2015
%C For prime p let [p] denote the sequence with a(1)=p, and generated as for the terms of the current sequence (which according to this notation is then the same as [2]. It so happens that the sequence [p] (for any p?) merges with [2] sooner or later, taking the form of a "tree" as shown in the attached image (Including prime starts up to p=67). Is this pattern of merging bounded or not? Is there just one tree or are there many? Interesting to speculate. The numbers corresponding to the arrival points in [2] of [p] is the sequence 2,6,15,21,51,57,77,84.... The sequence of ("excluded")numbers which do not arise in [p] for any prime p starts as 8,16,20,25,28,32,36,44... Other sequences may refer to the number of iterations required to merge [p] into [2]. See tree picture. - _David James Sycamore_, Aug 25 2016
%C In this picture, one could also include some [c] sequences, with composite c, see A276269. - _Michel Marcus_, Aug 26 2016
%H Antti Karttunen, <a href="/A256393/b256393.txt">Table of n, a(n) for n = 1..4096</a>
%H David Sycamore, <a href="/A256393/a256393_1.jpg">Tree showing what happens if the initial 2 is replaced by a different prime</a> (Corrected Aug 29 2016)
%F a(1) = 2; a(2n) = a(2n-1) + gpf(a(2n-1)), a(2n+1) = a(2n) + lpf(a(2n)), where gpf = greatest prime factor = A006530, lpf = least prime factor = A020639.
%p a[1]:= 2;
%p for n from 2 to 100 do
%p if n::even then a[n]:= a[n-1] + max(numtheory:-factorset(a[n-1]))
%p else a[n]:= a[n-1] + min(numtheory:-factorset(a[n-1]))
%p fi
%p od:
%p seq(a[i],i=1..100); # _Robert Israel_, May 03 2015
%t f[n_] := Block[{pf = First /@ FactorInteger@ n}, If[EvenQ@ n, Max@ pf, Min@ pf]]; s = {2}; lmt = 58; For[k = 2, k <= lmt, k++, AppendTo[s, s[[k - 1]] + f@ s[[k - 1]]]]; s (* _Michael De Vlieger_, Apr 19 2015 *)
%t FoldList[Function[f, If[EvenQ@ #2, #1 + First@ f, #1 + Last@ f]][FactorInteger[#1][[All, 1]]] &, Range[2, 59]] (* _Michael De Vlieger_, Aug 26 2016 *)
%o (PARI) lista(nn) = {print1(a = 2, ", "); for (n=2, nn, f = factor(a); if (n % 2, a += f[1, 1], a += f[#f~, 1]); print1(a, ", "););} \\ _Michel Marcus_, Apr 02 2015
%o (Scheme, with memoization-macro definec) (definec (A256393 n) (cond ((= 1 n) 2) ((even? n) (+ (A256393 (- n 1)) (A006530 (A256393 (- n 1))))) (else (+ (A256393 (- n 1)) (A020639 (A256393 (- n 1))))))) ;; _Antti Karttunen_, Apr 18 2015
%o (Haskell)
%o a256393 n = a256393_list !! (n-1)
%o a256393_list = 2 : zipWith ($) (cycle [a070229, a061228]) a256393_list
%o -- _Reinhard Zumkeller_, May 06 2015
%Y Cf. A006530 (greatest prime factor), A020639 (least prime factor), A076271.
%Y Cf. A257244 (the first differences; the unique prime factors shared by each pair of successive terms), A257245, A257246 (their bisections), A257247 (numbers n such that GCD(a(2n-1),a(2n)) = GCD(a(2n),a(2n+1)), which is prime).
%Y Cf. A061228, A070229.
%K nonn
%O 1,1
%A _Jan Guichelaar_, Mar 28 2015
%E More terms from _Michel Marcus_, Apr 02 2015
%E Replaced the name with more succinct description, moved old name to comments - _Antti Karttunen_, Apr 18-19 2015