login
First differences of composite numbers.
39

%I #28 Oct 18 2024 14:37:10

%S 2,2,1,1,2,2,1,1,2,2,1,1,2,1,1,1,1,2,2,1,1,1,1,2,1,1,2,2,1,1,2,1,1,1,

%T 1,2,1,1,1,1,2,2,1,1,1,1,2,1,1,2,2,1,1,1,1,2,1,1,2,1,1,1,1,2,1,1,1,1,

%U 1,1,2,1,1,2,2,1,1,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,2,2,1

%N First differences of composite numbers.

%C Also, the highest common factors of pair of successive composite numbers. - _Amarnath Murthy_, Jan 31 2003

%C All terms are 1 or 2. Runs of 1's may be of arbitrary lengths, while the lengths of runs of 2's are 1 or 2. - _Zak Seidov_, Mar 18 2013

%H Reinhard Zumkeller, <a href="/A073783/b073783.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A002808(n+1) - A002808(n).

%F a(n) = A073784(n) + 1.

%e a(7) = A002808(8) - A002808(7) = 15 - 14 = 1.

%t c[x_] := FixedPoint[x + PrimePi[#] + 1 &, x]; Differences[c /@ Range[106]] (* _Jayanta Basu_, Jul 09 2013 *)

%o (Haskell)

%o a073783 n = a073783_list !! (n-1)

%o a073783_list = zipWith (-) (tail a002808_list) a002808_list

%o -- _Reinhard Zumkeller_, Jan 10 2013

%o (PARI) m=4;forcomposite(n=6,1e3,print1(n-m", ");m=n) \\ _Charles R Greathouse IV_, Mar 20 2013

%Y Cf. A002808, A073784.

%Y a(n) = A136527(n, n+1).

%Y Cf. A073445 (first differences).

%K easy,nonn

%O 1,1

%A _Lior Manor_, Aug 11 2002