login
a(n) is the least prime that begins a sequence of at least n distinct primes under iteration of A061762.
1

%I #6 May 09 2021 15:34:03

%S 2,11,23,53,12451,36779999

%N a(n) is the least prime that begins a sequence of at least n distinct primes under iteration of A061762.

%e 12451 is prime and A061762(12451) = 1*2*4*5*1+1+2+4+5+1 = 53.

%e 53 is prime and A061762(53) = 5*3+5+3 = 23.

%e 23 is prime and A061762(23) = 2*3+2+3 = 11.

%e 11 is prime and A061762(11) = 1*1+1+1 = 3.

%e 3 is prime and A061762(3) = 3+3 = 6 is not prime.

%e Thus 12451 begins a sequence of 5 distinct primes under the iteration of A061762. Since 12451 is the least such prime, a(5) = 12451.

%p f:= proc(n) local L;

%p L:= convert(n,base,10);

%p convert(L,`+`)+convert(L,`*`)

%p end proc:

%p g:= proc(n) local S,v;

%p S:= {n}:

%p v:= n;

%p do

%p v:= f(v);

%p if member(v,S) or not isprime(v) then return nops(S) fi;

%p S:= S union {v}

%p od

%p end proc:

%p R:= NULL: p:= 1: m:= 0:

%p while m < 5 do

%p p:= nextprime(p);

%p v:= g(p);

%p if v > m then R:= R, p$(v-m); m:= v fi

%p od:

%p R;

%Y Cf. A061762, A214629.

%K nonn,base,more

%O 1,1

%A _J. M. Bergot_ and _Robert Israel_, May 07 2021