%I #58 Jul 02 2024 02:16:38
%S 12,7,4,7,4,7,12,3,12,7,4,7,4,7,12,3,12,7,4,7,4,7,12,3,12,7,4,7,4,7,
%T 12,3,12,7,4,7,4,7,12,3,12,7,4,7,4,7,12,3,12,7,4,7,4,7,12,3,12,7,4,7,
%U 4,7,12,3,12,7,4,7,4,7,12,3,12,7,4,7,4,7,12,3
%N Sequence of gaps between deletions of multiples of 7 in step 4 of the sieve of Eratosthenes.
%C This sequence is a repeating cycle 12, 7, 4, 7, 4, 7, 12, 3 of length A005867(4) = 8 = (prime(1)-1)*(prime(2)-1)*(prime(3)-1).
%C The mean of the cycle is prime(4) = 7.
%C The cycle is constructed from the sieve of Eratosthenes as follows.
%C In the first 2 steps of the sieve, the gaps between the deleted numbers are constant: gaps of 2 in step 1 when we delete multiples of 2, and gaps of 3 in step 2 when we delete multiples of 3.
%C In step 3, when we delete all multiples of 5, the gaps are alternately 7 and 3 (i.e., cycle [7,3]).
%C For this sequence, we look at the interesting cycle from step 4 (multiples of 7).
%C Excluding the final 3, the cycle has reflective symmetry: 12, 7, 4, 7, 4, 7, 12. This is true for every subsequent step of the sieve too.
%C The central element is 7 (BUT not all steps have their active prime number as the central element).
%C a(1) is A054272(4).
%C a(8) = 3, the first appearance of the last element of the cycle, corresponds to deletion of 217 = A002110(4)+7.
%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,0,0,0,1).
%F a(n) = A236175(n)+1. - _Peter Munn_, Jan 21 2023
%e After sieve step 3, multiples of 2,3,5 have been eliminated leaving
%e 7,11,13,17,19,23,29,31,37,41,43,47,49,53, ...
%e ^ ^
%e The first two multiples of 7 are 7 itself and 49 and they are distance 12 apart in the list so that a(1) = 12.
%e For n = 2, a(n) = 7, because the third multiple of 7 that is not a multiple of 2, 3 or 5 is 77 = 7 * 11, which is located 7 numbers after 49 = 7*7 in the list of numbers without the multiples of 2, 3 and 5.
%t PadRight[{}, 100, {12, 7, 4, 7, 4, 7, 12, 3}] (* _Paolo Xausa_, Jul 01 2024 *)
%o (Python)
%o numbers = []
%o for i in range(2,880):
%o numbers.append(i)
%o gaps = []
%o step = 4
%o current_step = 1
%o while current_step <= step:
%o prime = numbers[0]
%o new_numbers = []
%o gaps = []
%o gap = 0
%o for i in range(1,len(numbers)):
%o gap += 1
%o if numbers[i] % prime != 0:
%o new_numbers.append(numbers[i])
%o else:
%o gaps.append(gap)
%o gap = 0
%o current_step += 1
%o numbers = new_numbers
%o print(gaps)
%Y Cf. A002110, A005867, A054272, A236175.
%Y Equivalent sequences for steps 1..3: A007395, A010701, A010705 (without the initial 3).
%K nonn,easy
%O 1,1
%A _Alexandre Herrera_, Jan 08 2023