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.

A380341 a(n) = phi(1 + phi(4 + phi(9 + ... phi(n^2)))).

Original entry on oeis.org

1, 2, 4, 6, 6, 6, 16, 16, 22, 16, 16, 16, 16, 22, 22, 16, 22, 16, 16, 16, 16, 16, 16, 22, 16, 22, 16, 16, 16, 22, 22, 22, 22, 22, 22, 16, 16, 22, 16, 22, 16, 16, 16, 16, 16, 16, 22, 16, 16, 16, 16, 16, 22, 16, 16, 16, 16, 16, 22, 16, 16, 16, 16, 16, 16, 16, 16, 16, 22
Offset: 1

Views

Author

Michel Marcus, Jan 22 2025

Keywords

Crossrefs

Programs

  • Mathematica
    A380341[n_] := Fold[EulerPhi[#2 + #] &, 0, Range[n, 1, -1]^2]; Array[A380341, 100] (* or *)
    A380341[n_] := Which[n <= 2, n, n == 3, 4, 4 <= n <= 6, 6, MemberQ[{9, 14, 15, 17, 24, 26, 30, 31, 32, 33, 34, 35, 38, 40, 47, 53, 59, 69}, n], 22, True, 16]; Array[A380341, 100] (* Paolo Xausa, Jan 22 2025 *)
  • PARI
    a(n) = my(x=0); forstep(k=n, 1, -1, x = eulerphi(x+k^2)); x;
    
  • Python
    from functools import reduce
    from sympy import totient
    def A380341(n): return reduce(lambda x,y:totient(x)+y,(m**2 for m in range(n,-1,-1))) # Chai Wah Wu, Jan 22 2025

Formula

From Paolo Xausa, Jan 22 2025: (Start)
a(n) = 1 for n = 1;
a(n) = 2 for n = 2;
a(n) = 4 for n = 3;
a(n) = 6 for n = 4, 5, 6;
a(n) = 22 for n = 9, 14, 15, 17, 24, 26, 30, 31, 32, 33, 34, 35, 38, 40, 47, 53, 59, 69;
a(n) = 16 otherwise (see Vela and Wolird). (End)
G.f.: x*(6*x^69 - 6*x^68 + 6*x^59 - 6*x^58 + 6*x^53 - 6*x^52 + 6*x^47 - 6*x^46 + 6*x^40 - 6*x^39 + 6*x^38 - 6*x^37 + 6*x^35 - 6*x^29 + 6*x^26 - 6*x^25 + 6*x^24 - 6*x^23 + 6*x^17 - 6*x^16 + 6*x^15 - 6*x^13 + 6*x^9 - 6*x^8 - 10*x^6 - 2*x^3 - 2*x^2 - x - 1)/(x - 1). - Chai Wah Wu, Jan 22 2025