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.
%I A110529 #30 Sep 11 2024 14:24:58 %S A110529 9,18,27,28,29,36,45,54,55,56,63,72,82,83,84,85,86,87,88,89,90,99,108, %T A110529 109,110,117,126,135,136,137,144,153,163,164,165,166,167,168,169,170, %U A110529 171,180,189,190,191,198,207,216,217,218,225,234,243,246,247,248,249 %N A110529 Numbers n such that n in ternary representation (A007089) has a block of exactly a prime number of consecutive zeros. %C A110529 Related to the Baum-Sweet sequence, but ternary rather than binary and prime rather than odd. %C A110529 a(n) is in this sequence iff n (base 3) = A007089(n) has a block (not a subblock) of a prime number (A000040) of consecutive zeros. %D A110529 J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 157. %H A110529 W. Zane Billings, <a href="/A110529/b110529.txt">Table of n, a(n) for n = 1..10000</a> %H A110529 J.-P. Allouche, <a href="http://www.mat.univie.ac.at/~slc/s/s30allouche.html">Finite Automata and Arithmetic</a>, Séminaire Lotharingien de Combinatoire, B30c (1993), 23 pp. %e A110529 a(1) = 9 because 9 (base 3) = 100, which has a block of 2 zeros. %e A110529 a(2) = 18 because 18 (base 3) = 200, which has a block of 2 zeros. %e A110529 a(3) = 27 because 27 (base 3) = 1000, which has a block of 3 zeros. %e A110529 81 is not in this sequence because 81 (base 3) = 10000 has a block of 4 consecutive zeros and it does not matter that this has subblocks with 2 or 3 consecutive zeros because subblocks do not count here. %e A110529 243 is in this sequence because 243 (base 3) = 100000, which has a block of 5 zeros. %e A110529 252 is in this sequence because 252 (base 3) = 100100 which has two blocks of 2 consecutive zeros, but we do not require there to be only one such prime-zeros block. %e A110529 2187 is in this sequence because 2187 (base 3) = 10000000, which has a block of 7 zeros. %t A110529 Select[Range[250], Or @@ (First[ # ] == 0 && PrimeQ[Length[ # ]] &) /@ Split[IntegerDigits[ #, 3]] &] (* _Ray Chandler_, Sep 12 2005 *) %o A110529 (Python) %o A110529 from re import split %o A110529 from sympy import isprime %o A110529 def ternary (n): %o A110529 if n == 0: %o A110529 return '0' %o A110529 nums = [] %o A110529 while n: %o A110529 n, r = divmod(n, 3) %o A110529 nums.append(str(r)) %o A110529 return ''.join(reversed(nums)) %o A110529 seq_list, n = [],1 %o A110529 while len(seq_list) < 10000: %o A110529 for d in split('1+|2+', ternary(n)[1:]): %o A110529 if isprime(len(d)): %o A110529 seq_list.append(n) %o A110529 n += 1 %o A110529 # _W. Zane Billings_, Jun 28 2019 %Y A110529 Cf. A007089, A037011, A086747, A110471, A110472, A110474. %K A110529 base,easy,nonn %O A110529 1,1 %A A110529 _Jonathan Vos Post_, Sep 11 2005