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.

A105348 An indicator sequence for the Jacobsthal numbers.

This page as a plain text file.
%I A105348 #16 Apr 18 2025 22:22:23
%S A105348 1,2,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 A105348 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 A105348 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0
%N A105348 An indicator sequence for the Jacobsthal numbers.
%C A105348 a(n) is the number of solutions to the Diophantine equation 2*x^2 - (9*n+1)*x + 9*n^2 = 1 where valid solutions are restricted to powers of 4. - _Hieronymus Fischer_, May 17 2007
%H A105348 Antti Karttunen, <a href="/A105348/b105348.txt">Table of n, a(n) for n = 0..87381</a>
%F A105348 G.f.: Sum_{k>=0} x^A001045(k).
%F A105348 a(n) = 1 + floor(log_2(3n+1)) - ceiling(log_2(3n-1)) = floor(log_2(3n+1)) - floor(log_2(3n-2)) for n >= 1. Also true: a(n) = 1 + A130249(n) - A130250(n) = A130253(n) - A130250(n) = A130250(n+1) - A130250(n) for n >= 0. - _Hieronymus Fischer_, May 17 2007
%e A105348 a(1)=2 since J(1)=J(2)=1.
%o A105348 (PARI)
%o A105348 A147612aux(n,i) = if(!(n%2),n,A147612aux((n+i)/2,-i));
%o A105348 A147612(n) = 0^(A147612aux(n,1)*A147612aux(n,-1));
%o A105348 A105348(n) = if(1==n,2,A147612(n)); \\ _Antti Karttunen_, Nov 02 2018
%o A105348 (Python)
%o A105348 def A105348(n): return (m:=3*n+1).bit_length()-(m-3).bit_length() if n else 1 # _Chai Wah Wu_, Apr 18 2025
%Y A105348 For partial sums see A130253. Cf. A130249, A130250, A147612.
%K A105348 easy,nonn
%O A105348 0,2
%A A105348 _Paul Barry_, Apr 01 2005