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 A007058 M3936 #28 Feb 19 2024 11:51:48 %S A007058 1,5,25,65,265,605,2125,4345,14665,27965,93025,171825,559645,1015565, %T A007058 3276725,5857865,18734665,33203045,105436225,185546785,585842065, %U A007058 1025381485,3222484125,5615234265,17577530845,30517575605,95213827825,164794865465,512692025285,885009765485,2746575977125 %N A007058 Let S denote the palindromes in the language {0,1,2,3,4}*; a(n) = number of words of length n in the language SS. %D A007058 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A007058 R. Kemp, <a href="http://dx.doi.org/10.1016/0012-365X(82)90123-6">On the number of words in the language {w in Sigma* | w = w^R }^2</a>, Discrete Math., 40 (1982), 225-234. %F A007058 a(n) = A187275(n) - Sum_{d|n,d<n} phi(n/d)*a(d). - _Sean A. Irvine_, Sep 27 2017 %p A007058 See A007055. %o A007058 (Python) %o A007058 from functools import lru_cache %o A007058 from sympy import totient, proper_divisors %o A007058 @lru_cache(maxsize=None) %o A007058 def A007058(n): return (n*5**(1+(n>>1)) if n&1 else 3*n*5**(n>>1))-sum(totient(n//d)*A007058(d) for d in proper_divisors(n,generator=True)) if n else 1 # _Chai Wah Wu_, Feb 19 2024 %Y A007058 Column 5 of A284873. %Y A007058 Cf. A007055, A007056, A007057. %K A007058 nonn %O A007058 0,2 %A A007058 _N. J. A. Sloane_, _Mira Bernstein_, R. Kemp %E A007058 Entry revised by _N. J. A. Sloane_, Mar 07 2011