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.

A093820 a(n) = Sum_{k=1..n-1} gcd(n, a(k)) for n > 1; a(1) = 1.

Original entry on oeis.org

1, 1, 2, 4, 4, 8, 6, 22, 10, 24, 20, 42, 12, 36, 32, 64, 16, 64, 18, 82, 50, 60, 22, 144, 60, 48, 64, 96, 28, 172, 30, 282, 78, 64, 70, 256, 36, 72, 106, 254, 80, 204, 84, 176, 166, 88, 92, 518, 78, 200, 136, 210, 104, 244, 134, 346, 96, 112, 58, 538, 120, 120, 216
Offset: 1

Views

Author

Reinhard Zumkeller, May 21 2004

Keywords

Comments

a(n) = n-1 iff n is prime.
a(n) >= n-1. All terms except a(1) = a(2) = 1 are even. - Ivan Neretin, Apr 06 2016

Crossrefs

Cf. A006579.
Cf. A056144.

Programs

  • Haskell
    a093820 n = a093820_list !! (n-1)
    a093820_list = 1 : f [2..] [1] where
       f (x:xs) ys = y : f xs (y:ys) where y = sum $ map (gcd x) ys
    -- Reinhard Zumkeller, Oct 10 2013
  • Mathematica
    Fold[Append[#1, Total@GCD[#1, #2]] &, {1}, Range[2, 64]] (* Ivan Neretin, Apr 06 2016 *)
  • PARI
    lista(nn) = {va = vector(nn); va[1] = 1; for (i = 2, nn, va[i] = sum(k=1, i-1, gcd(i, va[k]));); va;} \\ Michel Marcus, Oct 04 2013
    

Extensions

Definition corrected by Antti Karttunen, Jun 04 2004