Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #17 Aug 20 2023 04:35:46
%S 1,4,2,6,8,3,12,5,16,7,20,9,24,10,14,18,22,26,28,11,32,13,36,15,40,17,
%T 44,19,48,21,52,23,56,25,60,27,64,29,68,30,34,38,42,46,50,54,58,62,66,
%U 70,72,31,76,33,80,35,84,37,88,39,92,41,96,43,100,45,104
%N Lexicographically earliest sequence of distinct positive integers such that the product of two consecutive terms is always divisible by 4.
%C For any k > 0, let f_k be the lexicographically earliest sequence of distinct positive integers such that the product of two consecutive terms is always divisible by k:
%C - in particular:
%C f_1 = f_2 = A000027,
%C f_3 = A006368,
%C f_4 = a (this sequence),
%C f_6 = A330531,
%C - f_k is a permutation of the natural numbers,
%C - f_k(1) = 1, f_k(2) = max(2, k),
%C - if k is prime, then f_k corresponds to the integers that are not multiple of k interspersed with the integers that are multiple of k.
%C Apparently:
%C - for m > 0, the m-th run of consecutive terms such that gcd(a(n), 4) = 2 has A153893(m+1) terms,
%C - for m > 1, the m-th run of consecutive terms such that gcd(a(n), 4) = 1 or 4 has A068156(m+1) terms.
%H Rémy Sigrist, <a href="/A330530/b330530.txt">Table of n, a(n) for n = 1..10000</a>
%H Rémy Sigrist, <a href="/A330530/a330530.png">Colored scatterplot of the first 10000 terms</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%e The first terms, alongside their product with the next term, are:
%e n a(n) a(n)*a(n+1)
%e -- ---- -----------
%e 1 1 4
%e 2 4 8
%e 3 2 12
%e 4 6 48
%e 5 8 24
%e 6 3 36
%e 7 12 60
%e 8 5 80
%e 9 16 112
%e 10 7 140
%o (PARI) s=0; v=1; for (n=1, 10 000, print (n " " v); s+=2^v; for (w=1, oo, if (!bittest(s,w) && (v*w)%4==0, v=w; break)))
%Y Cf. A006368, A068156, A153893, A330531 (f_6), A330576 (inverse).
%K nonn,easy,look
%O 1,2
%A _Rémy Sigrist_, Dec 17 2019