A082745 Duplicate of A064955.
2, 5, 10, 14, 20, 28, 33, 37, 43, 57, 61, 67, 74, 81, 89, 100, 107, 115, 128, 134, 138, 151
Offset: 1
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.
a(2) = 2, a(3) = 4 (gcd(2,4) = 2), a(4) = 6 (gcd(4,6) = 2), a(5) = 3 (gcd(6,3) = 3), a(6) = 9 (6 already used so next number which shares a factor is 9 since gcd(3,9) = 3).
import Data.List (delete, genericIndex) a064413 n = genericIndex a064413_list (n - 1) a064413_list = 1 : f 2 [2..] where ekg x zs = f zs where f (y:ys) = if gcd x y > 1 then y : ekg y (delete y zs) else f ys -- Reinhard Zumkeller, May 01 2014, Sep 17 2011
h := array(1..20000); a := array(1..10000); maxa := 300; maxn := 2*maxa; for n from 1 to maxn do h[n] := -1; od: a[1] := 2; h[2] := 1; c := 2; for n from 2 to maxa do for m from 2 to maxn do t1 := gcd(m,c); if t1 > 1 and h[m] = -1 then c := m; a[n] := c; h[c] := n; break; fi; od: od: ap := []: for n from 1 to maxa do ap := [op(ap),a[n]]; od: hp := []: for n from 2 to maxa do hp := [op(hp),h[n]]; od: convert(ap,list); convert(hp,list); # this is very crude! N:= 1000: # to get terms before the first term > N V:= Vector(N): A[1]:= 1: A[2]:= 2: V[2]:= 1: for n from 3 do S:= {seq(seq(k*p,k=1..N/p),p=numtheory:-factorset(A[n-1]))}; for s in sort(convert(S,list)) do if V[s] = 0 then A[n]:= s; break fi od; if V[s] = 1 then break fi; V[s]:= 1; od: seq(A[i],i=1..n-1); # Robert Israel, Jan 18 2016
maxN = 100; ekg = {1, 2}; unused = Range[3, maxN]; found = True; While[found, found = False; i = 0; While[ !found && i < Length[unused], i++; If[GCD[ekg[[-1]], unused[[i]]] > 1, found = True; AppendTo[ekg, unused[[i]]]; unused = Delete[unused, i]]]]; ekg (* Ayres *) ekGrapher[s_List] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++ ]; Append[s, k]]; Nest[ekGrapher, {1, 2}, 71] (* Robert G. Wilson v, May 20 2009 *)
a1=1; a2=2; v=[1,2]; for(n=3,100,a3=if(n<0,0,t=1;while(vecmin(vector(length(v),i,abs(v[i]-t)))*(gcd(a2,t)-1)==0,t++);t);a2=a3;v=concat(v,a3);); a(n)=v[n]; /* Benoit Cloitre, Sep 23 2012 */
from math import gcd A064413_list, l, s, b = [1,2], 2, 3, {} for _ in range(10**5): i = s while True: if not i in b and gcd(i, l) > 1: A064413_list.append(i) l, b[i] = i, True while s in b: b.pop(s) s += 1 break i += 1 # Chai Wah Wu, Dec 08 2014
a(8) = 4 because gcd(A064413(7), A064413(8)) = gcd(12, 8) = 4. From _Michael De Vlieger_, Sep 27 2023: (Start) Let b(n) = A064413(n): a(11068) = 12 since gcd(b(11067), b(11068)) = gcd(11484, 11472) = 12, a(58836) = 18 since gcd(b(58835), b(58836)) = gcd(60786, 60678) = 18. (End)
a073734 n = a073734_list !! (n-2) a073734_list = zipWith gcd a064413_list $ tail a064413_list -- Reinhard Zumkeller, Sep 17 2001
t = {1, 2}; Join[{1}, Table[k = 3; While[MemberQ[t, k] || (y = GCD[Last[t], k]) == 1, k++];AppendTo[t, k]; y, {91}]] (* Jayanta Basu, Jul 09 2013 *)
terms = 100; ekg[s_] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]]; EKG = Nest[ekg, {2, 4}, 12 terms]; a[n_] := FirstPosition[EKG, Prime[n]][[1]]; Array[a, terms] (* Jean-François Alcover, Sep 02 2018, after Robert G. Wilson v in A064413 *)
A379248(1169) = 41, A379248(1175) = 43, with a difference in indices of 6. Worth noting is the values of the terms in this, and similar, ranges: . . A379248(1167) = 943 = 23*41 , the lowest unseen multiple of 23. A379248(1168) = 1681 = 41^2. A379248(1169) = 41. A379248(1170) = 3362 = 2*41^2 , which shows the pattern of p^2 -> p -> 2*p^2. A379248(1171) = 697 = 17*41 , the lowest unseen multiple of 17. A379248(1172) = 2023 = 7*17^2 , the lowest unseen multiple of 17^2. A379248(1173) = 731 = 17*43, the lowest unseen multiple of 17. A379248(1174) = 1849 = 43^2. A379248(1175) = 43. . .
The position of 2^2 = 4 is 3 - the second term in the sequence. The position of 3^2 = 9 is 6 - the third term in the sequence.
import Data.List (findIndices) a064957 n = a064957_list !! (n-1) a064957_list = map (+ 1) $ findIndices odd a064413_list -- Reinhard Zumkeller, Sep 17 2001
ekg[s_List] := Block[{m = s[[-1]], k = 3}, While[MemberQ[s, k] || GCD[m, k] == 1, k++]; Append[s, k]]; A064413 = Nest[ekg, {1, 2}, 200]; Position[A064413, ?OddQ] // Flatten (* _Jean-François Alcover, Aug 02 2018, after Robert G. Wilson v *)
A304527(n) = -sumdiv(n, d, (dA064664(d));
Comments