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.
%I A380341 #28 Jan 27 2025 06:22:35 %S A380341 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, %T A380341 22,16,16,16,22,22,22,22,22,22,16,16,22,16,22,16,16,16,16,16,16,22,16, %U A380341 16,16,16,16,22,16,16,16,16,16,22,16,16,16,16,16,16,16,16,16,22 %N A380341 a(n) = phi(1 + phi(4 + phi(9 + ... phi(n^2)))). %H A380341 Paolo Xausa, <a href="/A380341/b380341.txt">Table of n, a(n) for n = 1..1000</a> %H A380341 Luis Palacios Vela and Christian Wolird, <a href="https://arxiv.org/abs/2501.10616">The Forestry of Adversarial Totient Iterations</a>, arXiv:2501.10616 [math.NT], 2025. %H A380341 <a href="/index/Rec#order_01">Index entries for linear recurrences with constant coefficients</a>, signature (1). %F A380341 From _Paolo Xausa_, Jan 22 2025: (Start) %F A380341 a(n) = 1 for n = 1; %F A380341 a(n) = 2 for n = 2; %F A380341 a(n) = 4 for n = 3; %F A380341 a(n) = 6 for n = 4, 5, 6; %F A380341 a(n) = 22 for n = 9, 14, 15, 17, 24, 26, 30, 31, 32, 33, 34, 35, 38, 40, 47, 53, 59, 69; %F A380341 a(n) = 16 otherwise (see Vela and Wolird). (End) %F A380341 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 %t A380341 A380341[n_] := Fold[EulerPhi[#2 + #] &, 0, Range[n, 1, -1]^2]; Array[A380341, 100] (* or *) %t A380341 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 *) %o A380341 (PARI) a(n) = my(x=0); forstep(k=n, 1, -1, x = eulerphi(x+k^2)); x; %o A380341 (Python) %o A380341 from functools import reduce %o A380341 from sympy import totient %o A380341 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 %Y A380341 Cf. A000010, A380340, A380342, A380354, A380414, A380415. %K A380341 nonn,easy %O A380341 1,2 %A A380341 _Michel Marcus_, Jan 22 2025