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 A249140 #15 Nov 14 2020 01:28:09 %S A249140 1,2,1,4,4,2,6,8,1,4,4,12,10,2,16,12,8,6,8,1,20,16,24,4,18,24,4,12,10, %T A249140 16,22,2,36,16,32,12,8,40,6,36,28,8,30,24,1,48,20,16,44,24,4,36,32,18, %U A249140 60,24,4,16,40,12,64,42,56,10,16,72,22,60,46,72,2 %N A249140 To obtain a(n), write the n-th composite number as a product of primes, subtract 1 from each prime and multiply. %H A249140 Alois P. Heinz, <a href="/A249140/b249140.txt">Table of n, a(n) for n = 1..10000</a> %F A249140 a(n) = A003958(A002808(n)). - _Michel Marcus_, Oct 22 2014 %e A249140 a(1)=1 because the 1st composite number is 4, and the prime factors of 4 are (2,2): (2-1)*(2-1)=1. %e A249140 a(4)=4 because the 4th composite number is 9, and the prime factors of 9 are (3,3): (3-1)*(3-1)=4. %e A249140 a(19)=8 because the 19th composite number is 30, and the prime factors of 30 are (2,3,5): (2-1)*(3-1)*(5-1)=8. %p A249140 b:= proc(n) option remember; local k; %p A249140 for k from 1+`if`(n=1, 3, b(n-1)) %p A249140 while isprime(k) do od; k %p A249140 end: %p A249140 a:= n-> mul((i[1]-1)^i[2], i=ifactors(b(n))[2]): %p A249140 seq(a(n), n=1..100); # _Alois P. Heinz_, Oct 23 2014 %t A249140 b[n_] := Product[{p, e} = pe; (p-1)^e, {pe, FactorInteger[n]}]; %t A249140 b /@ Select[Range[100], CompositeQ] (* _Jean-François Alcover_, Nov 13 2020 *) %o A249140 (PARI) b(n) = my(f=factor(n)); f[,1] = apply(x->(x-1), f[,1]); factorback(f); \\ A003958 %o A249140 lista(nn) = apply(b, select(x->((x != 1) && !isprime(x)), [1..nn])); \\ _Michel Marcus_, Nov 13 2020 %Y A249140 Cf. A002808, A003958, A114434. %K A249140 nonn,easy %O A249140 1,2 %A A249140 _Gil Broussard_, Oct 22 2014