login
a(n) = 1 if n can be written as a product of factorials (A000142), 0 otherwise; Characteristic function of Jordan-Polya numbers (A001013).
2

%I #9 May 20 2021 04:59:43

%S 1,1,0,1,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,

%T 0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,

%U 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1

%N a(n) = 1 if n can be written as a product of factorials (A000142), 0 otherwise; Characteristic function of Jordan-Polya numbers (A001013).

%H Antti Karttunen, <a href="/A344438/b344438.txt">Table of n, a(n) for n = 1..65536</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F For all n, a(n) <= A322585(n).

%o (PARI)

%o search_up_to = 120;

%o A076934(n) = for(k=2, oo , if(n%k, return(n), n /= k));

%o A093411(n) = if(!n,n, if(n%2, n, A093411(A076934(n)))); \\ _Antti Karttunen_, May 19 2021

%o A001013list(lim, mx=lim)=if(lim<2, return([1])); my(v=[1], t=1); for(n=2, mx, t*=n; if(t>lim, break); v=concat(v, t*A001013list(lim\t, t))); Set(v) \\ From A001013

%o v001013 = A001013list(search_up_to);

%o A344438(n) = if(v001013[#v001013]<n,-(1/0),!!vecsearch(v001013,n));

%Y Cf. A000142, A001013 (positions of ones), A093373 (of zeros), A322585.

%K nonn

%O 1

%A _Antti Karttunen_, May 19 2021