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 A340394 #21 Jan 10 2021 15:17:35 %S A340394 2,3,41,5,11,7,41,23,17,11,43,13,23,23,3407,17,47,19,89,31,47,23,1279, %T A340394 47,41,223,151,29,167,31,431,47,53,47,367,37,59,71,521,41,263,43,359, %U A340394 131,71,47,683,223,107,71,433,53,191,71,11807,79,89,59,3023,61,167,223 %N A340394 Base-independent home primes: the prime that is finally reached when you treat the prime factors of n in ascending order as digits of a number in base "greatest prime factor + 1" and repeat this until a prime is reached (a(n) = -1 if no prime is ever reached). %C A340394 After a prime is reached it repeats itself infinitely. That's why this prime is then called the "home prime": it is the end of the calculation chain for a specific number. %e A340394 For n=4 we get the base-independent home prime 41 through this chain of calculations: %e A340394 4 = 2 * 2 -> 22_3 (base 3 because 3 = greatest prime factor (2) + 1) %e A340394 22_3 = 8_10 = 2 * 2 * 2 -> 222_3 %e A340394 222_3 = 26_10 = 2 * 13 -> 2D_14 %e A340394 2D_14 = 41_10, which is a prime. This gives us 41 as our home prime for n = 4, 8, 26 and 41. %p A340394 b:= n-> (l-> (m-> add(l[-i]*m^(i-1), i=1..nops(l)))(1+ %p A340394 max(l)))(map(i-> i[1]$i[2], sort(ifactors(n)[2]))): %p A340394 a:= n-> `if`(isprime(n), n, a(b(n))): %p A340394 seq(a(n), n=2..77); # _Alois P. Heinz_, Jan 09 2021 %o A340394 (PARI) f(n) = my(f=factor(n), list=List()); for (k=1, #f~, for (j=1, f[k, 2], listput(list, f[k, 1]))); fromdigits(Vec(list), vecmax(f[, 1])+1); \\ A340393 %o A340394 a(n) = my(p); while (! isprime(p = f(n)), n = p); p; \\ _Michel Marcus_, Jan 07 2021 %Y A340394 Cf. A037274 (home primes). %Y A340394 Cf. A340393. %K A340394 nonn,base %O A340394 2,1 %A A340394 _S. Brunner_, Jan 06 2021