A277848 Index at which n occurs in A217727, or 0 if there is no such index.
1, 7, 2, 5, 18, 21, 11, 8, 28, 35, 46, 74, 54, 25, 3, 129, 32, 39, 78, 58, 133, 43, 62, 6, 95, 91, 152, 171, 87, 71, 190, 16, 148, 328, 19, 181, 167, 51, 227, 405, 618, 355, 344, 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
Offset: 2
Keywords
Programs
-
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.
-
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).
Comments