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.

A147612 If n is a Jacobsthal number then 1 else 0.

This page as a plain text file.
%I A147612 #21 Apr 18 2025 17:44:43
%S A147612 1,1,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
%T A147612 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,0,
%U A147612 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
%N A147612 If n is a Jacobsthal number then 1 else 0.
%C A147612 a(A001045(n)) = 1; a(A147613(n)) = 0.
%H A147612 Antti Karttunen, <a href="/A147612/b147612.txt">Table of n, a(n) for n = 0..43692</a>
%H A147612 <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F A147612 a(n) = 0^(j(n,1)*j(n,-1)) with j(n,i) = if n mod 2 = 0 then n else j((n+i)/2,-i).
%F A147612 a(n) = A105348(n), for n <> 1. - _R. J. Mathar_, Nov 19 2008
%F A147612 For n > 0, a(n) = A000035(A281228(A265746(n))), where A000035(A281228(n)) is the characteristic function of powers of 3 (A000244). - _Antti Karttunen_, Oct 09 2017
%t A147612 With[{s = LinearRecurrence[{1, 2}, {0, 1}, 24]}, Array[If[FreeQ[s, #], 0, 1] &, 105, 0]] (* _Michael De Vlieger_, Oct 09 2017 *)
%o A147612 (PARI)
%o A147612 A147612aux(n,i) = if(!(n%2),n,A147612aux((n+i)/2,-i));
%o A147612 A147612(n) = 0^(A147612aux(n,1)*A147612aux(n,-1)); \\ _Antti Karttunen_, Oct 09 2017
%o A147612 (Python)
%o A147612 def A147612(n): return int((m:=3*n+1).bit_length()>(m-3).bit_length()) if n else 1 # _Chai Wah Wu_, Apr 18 2025
%Y A147612 Cf. A001045, A105348, A265746, A293431, A293432, A293433, A293434.
%K A147612 nonn
%O A147612 0,1
%A A147612 _Reinhard Zumkeller_, Nov 08 2008