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 A270562 #37 Dec 01 2023 03:25:39 %S A270562 2,24,0,240,0,504,0,480,0,264,0,65520,0,0,0,16320,0,28728,0,13200,0, %T A270562 552,0,131040,0,0,0,6960,0,171864,0,32640,0,0,0,138181680,0,0,0, %U A270562 1082400,0,151704,0,5520,0,1128,0,4455360,0,0,0,12720,0,86184,0,13920,0,1416,0,6814407600,0,0,0,65280 %N A270562 a(n) is the largest number m satisfying lambda(m)=n, or zero if there is no solution, where lambda(m) is Carmichael's lambda function A002322(m). %C A270562 a(n) is the largest modulus m such that the largest order of any element in the multiplicative group modulo m is n; a(n) is zero if there is no such group with largest order n. %C A270562 Omitting the zeros gives A143407. %C A270562 a(n) = 0 if n is not a term of A002174. %H A270562 Gheorghe Coserea, <a href="/A270562/b270562.txt">Table of n, a(n) for n = 1..50005</a> %H A270562 R. D. Carmichael, <a href="https://doi.org/10.1090/S0002-9904-1910-01892-9">Note on a new number theory function</a>, Bull. Amer. Math. Soc. 16 (1910), 232-238. %t A270562 a[n_] := Module[{f, fsz, g = 1, h = 1, p, e}, Which[n <= 0, Return[0], n == 1, Return[2], OddQ[n], Return[0]]; f = FactorInteger[n][[All, 1]]; fsz = Length[f]; For[k = 1, k <= fsz, k++, p = f[[k]]; e = 1; While[Mod[n, CarmichaelLambda[p^e]] == 0, e++]; g *= p^(e-1)]; Do[If[PrimeQ[d+1] && Mod[g, d+1] != 0, h *= (d+1)], {d, Divisors[n]}]; g *= h; If[CarmichaelLambda[g] != n, 0, g]]; %t A270562 a /@ Range[100] (* _Jean-François Alcover_, Oct 18 2019, after _Gheorghe Coserea_ *) %o A270562 (PARI) %o A270562 lambda(n) = { \\ A002322 %o A270562 my(f=factor(n), fsz=matsize(f)[1]); %o A270562 lcm(vector(fsz, k, my(p=f[k,1], e=f[k,2]); %o A270562 if (p != 2, p^(e-1)*(p-1), e > 2, 2^(e-2), 2^(e-1)))); %o A270562 }; %o A270562 a(n) = { %o A270562 if (n <= 0, return(0), n==1, return(2), n%2, return(0)); %o A270562 my(f=factor(n), fsz=matsize(f)[1], g=1, h=1); %o A270562 for (k=1, fsz, my(p=f[k,1], e=1); %o A270562 while (n % lambda(p^e) == 0, e++); g *= p^(e-1)); %o A270562 fordiv(n, d, if (isprime(d+1) && g % (d+1) != 0, h *= (d+1))); %o A270562 g *= h; if (lambda(g) != n, 0, g); %o A270562 }; %o A270562 vector(64, n, a(n)) \\ _Gheorghe Coserea_, Feb 21 2019 %Y A270562 Cf. A002322, A002174, A051222, A143407, A270564, A111725. %Y A270562 See also A321713 (number of solutions). %K A270562 nonn %O A270562 1,1 %A A270562 _Joerg Arndt_, Mar 19 2016 %E A270562 Corrected and extended by _Gheorghe Coserea_, Feb 21 2019 %E A270562 Entry revised by _N. J. A. Sloane_, May 03 2019