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 A118310 #20 Mar 02 2023 16:52:45 %S A118310 1,2,3,4,1,2,1,2,3,2,1,4,1,2,3,1,1,9,1,10,1,11,1,1,1,2,3,4,1,2,1,2,3, %T A118310 1,5,3,1,2,1,8,1,2,1,2,9,2,1,6,1,1,1,4,1,3,1,7,3,2,1,2,1,1,1,1,1,6,1, %U A118310 4,3,2,1,24,1,1,25,2,1,3,1,4,1,1,1,6,5,2,3,2,1,30,1,2,3,2,5,6,1,1,1,4,1,2,1 %N A118310 a(n) = gcd(n,m(n)), where m(n) is the n-th nonprime positive integer (1 or composite). %C A118310 For n >= 1, a(n+1) = gcd(n+1,c(n)), where c(n) is the n-th composite. %C A118310 First occurrence of k: 1, 2, 3, 4, 35, 48, 56, 40, 18, 20, 22, 120, 130, 140, 375, ..., . - _Robert G. Wilson v_ %C A118310 Question: What is the reason for the conspicuous arc-like structures in the scatter plot? - _Antti Karttunen_, Mar 02 2023 %H A118310 Antti Karttunen, <a href="/A118310/b118310.txt">Table of n, a(n) for n = 1..20000</a> %t A118310 NonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n]; f[n_] := GCD[n, NonPrime@n]; Array[f, 103] (* _Robert G. Wilson v_ *) %o A118310 (PARI) A002808(maxn)= { local(a); a=[4]; for(n=5,maxn, if( !isprime(n), a=concat(a,n); ); ); return(a); } A118310(maxn)= { local(nonppo,a,newa,nonppol); a=[;]; nonppo=concat(1,A002808(maxn)); nonppol=matsize(nonppo); for(n=1,nonppol[2], newa= gcd(n, nonppo[n]); a=concat(a,newa); ); return(a); } print(A118310(180)); \\ _R. J. Mathar_ %o A118310 (PARI) A118310(n) = if(1==n, n, my(x=n-1); for(k=2, oo, if(!isprime(k), x--; if(!x, return(gcd(n,k)))))); \\ _Antti Karttunen_, Mar 02 2023 %Y A118310 Cf. A064814. %K A118310 nonn,look %O A118310 1,2 %A A118310 _Leroy Quet_, May 14 2006 %E A118310 More terms from _Robert G. Wilson v_ and _R. J. Mathar_, May 16 2006