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.

A256393 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).

Original entry on oeis.org

2, 4, 6, 9, 12, 15, 18, 21, 24, 27, 30, 35, 40, 45, 48, 51, 54, 57, 60, 65, 70, 77, 84, 91, 98, 105, 108, 111, 114, 133, 140, 147, 150, 155, 160, 165, 168, 175, 180, 185, 190, 209, 220, 231, 234, 247, 260, 273, 276, 299, 312, 325, 330, 341, 352, 363, 366, 427
Offset: 1

Views

Author

Jan Guichelaar, Mar 28 2015

Keywords

Comments

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.
See also sequence A076271 where a(n+1) = a(n) + lpf(a(n)).
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
From a(3) onward, the terms are alternately even and odd. - Jan Guichelaar, Apr 24 2015
a(2*n) = A070229(a(2*n-1)); a(2*n+1) = A061228(a(2*n)). - Reinhard Zumkeller, May 06 2015
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
In this picture, one could also include some [c] sequences, with composite c, see A276269. - Michel Marcus, Aug 26 2016

Crossrefs

Cf. A006530 (greatest prime factor), A020639 (least prime factor), A076271.
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).

Programs

  • Haskell
    a256393 n = a256393_list !! (n-1)
    a256393_list = 2 : zipWith ($) (cycle [a070229, a061228]) a256393_list
    -- Reinhard Zumkeller, May 06 2015
  • Maple
    a[1]:= 2;
    for n from 2 to 100 do
      if n::even then a[n]:= a[n-1] + max(numtheory:-factorset(a[n-1]))
      else a[n]:= a[n-1] + min(numtheory:-factorset(a[n-1]))
      fi
    od:
    seq(a[i],i=1..100); # Robert Israel, May 03 2015
  • Mathematica
    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 *)
    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 *)
  • 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
    
  • 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
    

Formula

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.

Extensions

More terms from Michel Marcus, Apr 02 2015
Replaced the name with more succinct description, moved old name to comments - Antti Karttunen, Apr 18-19 2015