login
Composite numbers together with 1 but excluding 4.
7

%I #24 Aug 01 2024 01:39:10

%S 1,6,8,9,10,12,14,15,16,18,20,21,22,24,25,26,27,28,30,32,33,34,35,36,

%T 38,39,40,42,44,45,46,48,49,50,51,52,54,55,56,57,58,60,62,63,64,65,66,

%U 68,69,70,72,74,75,76,77,78,80,81,82,84,85,86,87,88,90,91,92,93,94,95

%N Composite numbers together with 1 but excluding 4.

%C These are also the numbers k such that k divides (k-1)!.

%H Vincenzo Librandi, <a href="/A056653/b056653.txt">Table of n, a(n) for n = 1..1000</a>

%p for n from 1 to 100 do

%p if irem(factorial(n-1),n) = 0 then print(n) end if;

%p end do: # _Peter Bala_, Jan 24 2017

%t Select[ Range[ 1, 100 ], Mod[ (# - 1)!, # ] == 0 & ]

%t Join[{1},Select[Range[5,100],CompositeQ]] (* _Harvey P. Dale_, Jun 14 2024 *)

%o (Python)

%o from sympy import composite

%o def A056653(n): return composite(n) if n>1 else 1 # _Chai Wah Wu_, Jul 31 2024

%Y Cf. A018252, A002808, A226198, A014076 (odd terms).

%K nonn,easy

%O 1,2

%A _Robert G. Wilson v_, Aug 30 2000

%E Edited by _Vladeta Jovovic_, Apr 30 2003