%I #21 Jan 10 2021 15:17:35
%S 2,3,41,5,11,7,41,23,17,11,43,13,23,23,3407,17,47,19,89,31,47,23,1279,
%T 47,41,223,151,29,167,31,431,47,53,47,367,37,59,71,521,41,263,43,359,
%U 131,71,47,683,223,107,71,433,53,191,71,11807,79,89,59,3023,61,167,223
%N 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 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 For n=4 we get the base-independent home prime 41 through this chain of calculations:
%e 4 = 2 * 2 -> 22_3 (base 3 because 3 = greatest prime factor (2) + 1)
%e 22_3 = 8_10 = 2 * 2 * 2 -> 222_3
%e 222_3 = 26_10 = 2 * 13 -> 2D_14
%e 2D_14 = 41_10, which is a prime. This gives us 41 as our home prime for n = 4, 8, 26 and 41.
%p b:= n-> (l-> (m-> add(l[-i]*m^(i-1), i=1..nops(l)))(1+
%p max(l)))(map(i-> i[1]$i[2], sort(ifactors(n)[2]))):
%p a:= n-> `if`(isprime(n), n, a(b(n))):
%p seq(a(n), n=2..77); # _Alois P. Heinz_, Jan 09 2021
%o (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 a(n) = my(p); while (! isprime(p = f(n)), n = p); p; \\ _Michel Marcus_, Jan 07 2021
%Y Cf. A037274 (home primes).
%Y Cf. A340393.
%K nonn,base
%O 2,1
%A _S. Brunner_, Jan 06 2021
|