login
Index at which n occurs in A217727, or 0 if there is no such index.
2

%I #7 Nov 22 2016 21:54:26

%S 1,7,2,5,18,21,11,8,28,35,46,74,54,25,3,129,32,39,78,58,133,43,62,6,

%T 95,91,152,171,87,71,190,16,148,328,19,181,167,51,227,405,618,355,344,

%U 254,440,83,926,22,67,277,100,157,1400,195,333,186,1144,232,259,445,282,105,12,237,110,115,388,211,468,383,492,144,594,307,366,206,126,533,324,9,463,642

%N Index at which n occurs in A217727, or 0 if there is no such index.

%C It is conjectured that all integers >= 2 appear in A217727.

%o (PARI) A277848(n,a=2,u=[])={for(i=1,9e9,a==n&&return(i);u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1, u=u[^1]); my(t=log(a)\1); a=if(t>u[1]&&!setsearch(u, t), t, a^2))} \\ This code computes ("for each n") the sequence A217727 up to the index where n occurs.

%o (PARI) A277848_vec(N,a=2,u=[],v=vector(N))={my(i=1,t); until(u[1]>N,a<=N&&v[a]=i; u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1, u=u[^1]);i++; a=if((t=log(a)\1)>u[1]&&!setsearch(u, t), t, a^2));v[^1]} \\ This is more efficient to compute a whole range a(1..N).

%Y Cf. A217727, A114183.

%K nonn

%O 2,2

%A _M. F. Hasler_, Nov 20 2016