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.

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

Original entry on oeis.org

7, 14, 16, 17, 18, 19, 20, 21, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 52, 53, 54, 55, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 116, 117, 120, 121, 122, 123, 124, 125, 126, 127, 128
Offset: 6

Views

Author

Vladimir Shevelev, Oct 30 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) and from A167170. Note that, lim sup a(n) / n = 2, while lim sup A106108(n) / n = lim sup A167170(n) / n = 3.
Going up to a million, differences of two consecutive terms of this sequence gives primes about 0.009% of the time. The rest are 1's. [Alonso del Arte, Nov 30 2009]

Crossrefs

Programs

  • Maple
    A[6]:= 7:
    for n from 7 to 100 do A[n]:= A[n-1] + igcd(n,A[n-1]) od:
    seq(A[i],i=6..100); # Robert Israel, Jun 05 2016
  • Mathematica
    a[6] = 7; a[n_ /; n > 6] := a[n] = a[n - 1] + GCD[n, a[n - 1]]; Table[a[n], {n, 6, 58}]
  • Python
    from math import gcd
    def aupton(nn):
        alst = [7]
        for n in range(7, nn+1): alst.append(alst[-1] + gcd(n, alst[-1]))
        return alst
    print(aupton(68)) # Michael S. Branicky, Jul 14 2021

Extensions

Verified and edited by Alonso del Arte, Nov 30 2009