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.

A167170 a(6) = 14, for n >= 7, a(n) = a(n-1) + gcd(n, a(n-1)).

Original entry on oeis.org

14, 21, 22, 23, 24, 25, 26, 39, 40, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 177, 180, 181, 182, 189, 190, 195
Offset: 6

Views

Author

Vladimir Shevelev, Oct 29 2009, Nov 06 2009

Keywords

Comments

For every n >= 7, a(n) - a(n-1) is 1 or prime. This Rowland-like "generator of primes" is different from A106108 (see comment to A167168).

Crossrefs

Programs

  • Maple
    A167170 := proc(n) option remember; if n = 6 then 14; else procname(n-1)+igcd(n,procname(n-1)) ; end if; end proc: seq(A167170(i),i=6..80) ; # R. J. Mathar, Oct 30 2010
  • Mathematica
    RecurrenceTable[{a[n] == a[n - 1] + GCD[n, a[n - 1]], a[6] == 14}, a, {n, 6, 100}] (* G. C. Greubel, Jun 04 2016 *)
    nxt[{n_,a_}]:={n+1,a+GCD[a,n+1]}; NestList[nxt,{6,14},60][[All,2]] (* Harvey P. Dale, Nov 03 2019 *)
  • PARI
    first(n)=my(v=vector(n-5)); v[1]=14; for(k=7,n, v[k-5]=v[k-6]+gcd(k,v[k-6])); v \\ Charles R Greathouse IV, Aug 22 2017

Extensions

Terms > 91 from R. J. Mathar, Oct 30 2010