A246946 a(1)=6; for n > 1, a(n) is the least integer not occurring earlier such that a(n) shares exactly two distinct prime divisors with a(n-1).
6, 12, 18, 24, 30, 10, 20, 40, 50, 60, 15, 45, 75, 90, 36, 42, 14, 28, 56, 70, 35, 105, 21, 63, 84, 48, 54, 66, 22, 44, 88, 110, 55, 165, 33, 99, 132, 72, 78, 26, 52, 104, 130, 65, 195, 39, 117, 156, 96, 102, 34, 68, 136, 170, 80, 100, 120, 108, 114, 38, 76
Offset: 1
Keywords
Examples
18 is in the sequence because the common prime distinct divisors between a(2)=12 and a(3)=18 are 2 and 3.
Links
- Michel Lagneau, Table of n, a(n) for n = 1..2000
Programs
-
Maple
with(numtheory):a0:={2,3}:lst:={}: for n from 6 to 100 do: ii:=0: for k from 3 to 50000 while(ii=0) do: y:=factorset(k):n0:=nops(y):lst1:={}: for j from 1 to n0 do: lst1:=lst1 union {y[j]}: od: a1:=a0 intersect lst1: if {k} intersect lst ={} and a1 <> {} and nops(a1)=2 then printf(`%d, `,k):lst:=lst union {k}:a0:=lst1:ii:=1: else fi: od: od:
-
Mathematica
f[s_List]:=Block[{m=s[[-1]],k=6},While[MemberQ[s,k]||Intersection[Transpose[FactorInteger[k]][[1]],Transpose[FactorInteger[m]][[1]]]=={}|| Length[Intersection[Transpose[FactorInteger[k]][[1]],Transpose[FactorInteger[m]][[1]]]]!=2,k++];Append[s,k]];Nest[f,{6},71]
-
PARI
lista(nn) = {a = 6; print1(a, ", "); fa = (factor(a)[,1])~; va = [a]; k = 0; while (k != nn, k = 1; while (!((#setintersect(fa, (factor(k)[,1])~) == 2) && (! vecsearch(va, k))), k++); a = k; print1(a, ", "); fa = (factor(a)[,1])~; va = vecsort(concat(va, k)););} \\ Michel Marcus, Nov 23 2015
Comments