OFFSET
1,2
COMMENTS
For n >= 1, a(n+1) = gcd(n+1,c(n)), where c(n) is the n-th composite.
First occurrence of k: 1, 2, 3, 4, 35, 48, 56, 40, 18, 20, 22, 120, 130, 140, 375, ..., . - Robert G. Wilson v
Question: What is the reason for the conspicuous arc-like structures in the scatter plot? - Antti Karttunen, Mar 02 2023
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
MATHEMATICA
NonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n]; f[n_] := GCD[n, NonPrime@n]; Array[f, 103] (* Robert G. Wilson v *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Leroy Quet, May 14 2006
EXTENSIONS
More terms from Robert G. Wilson v and R. J. Mathar, May 16 2006
STATUS
approved