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.

A380340 a(n) = phi(1 + phi(2 + phi(3 + ... phi(n)))).

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 1

Views

Author

Michel Marcus, Jan 22 2025

Keywords

Crossrefs

Programs

  • Mathematica
    PadRight[{1, 1, 2, 2}, 100, 4] (* Paolo Xausa, Jan 22 2025 *)
  • PARI
    a(n) = my(x=0); forstep(k=n, 1, -1, x = eulerphi(x+k)); x;
    
  • Python
    from functools import reduce
    from sympy import totient
    def A380340(n): return reduce(lambda x,y:totient(x)+y,range(n,-1,-1)) # Chai Wah Wu, Jan 22 2025

Formula

a(n) = 4 for n >= 5 (see Vela and Wolird). - Paolo Xausa, Jan 22 2025
G.f.: x*(2*x^4+x^2+1)/(1-x). - Alois P. Heinz, Jan 22 2025