cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A202238 Characteristic function of positive integers not prime and not a power of 2.

This page as a plain text file.
%I A202238 #18 Mar 11 2025 17:28:48
%S A202238 0,0,0,0,0,1,0,0,1,1,0,1,0,1,1,0,0,1,0,1,1,1,0,1,1,1,1,1,0,1,0,0,1,1,
%T A202238 1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1,1,0,1,1,0,1,
%U A202238 1,1,0,1,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,0,1,1
%N A202238 Characteristic function of positive integers not prime and not a power of 2.
%H A202238 Antti Karttunen, <a href="/A202238/b202238.txt">Table of n, a(n) for n = 1..65537</a>
%H A202238 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F A202238 A111775(n) = 0 if and only if a(n) = 0.
%F A202238 A111787(n) = 0 if and only if a(n) = 0.
%F A202238 a(n) = 1 for n in A111774. - _Michel Marcus_, Aug 28 2017
%o A202238 (PARI) {a(n) = n>0 && !isprime(n) && n != 2^valuation(n, 2)}
%o A202238 (Python)
%o A202238 from sympy import isprime
%o A202238 def A202238(n): return int(not isprime(n) and bool((n&-n)^n)) # _Chai Wah Wu_, Mar 11 2025
%Y A202238 Cf. A010051, A111774, A111775, A111787, A209229.
%K A202238 nonn,easy
%O A202238 1,1
%A A202238 _Michael Somos_, Dec 16 2011