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.

A247243 a(n) = smallest positive integer k not already in the sequence such that the decimal expansion of 2^(n-1) begins with k.

This page as a plain text file.
%I A247243 #36 Nov 08 2022 01:41:29
%S A247243 1,2,4,8,16,3,6,12,25,5,10,20,40,81,163,32,65,13,26,52,104,209,41,83,
%T A247243 167,33,67,134,268,53,107,21,42,85,17,34,68,137,27,54,109,219,43,87,
%U A247243 175,35,7,14,28,56,11,22,45,9,18,36,72,144,288,57,115,23,46,92
%N A247243 a(n) = smallest positive integer k not already in the sequence such that the decimal expansion of 2^(n-1) begins with k.
%C A247243 Is this a permutation of the positive integers?
%H A247243 Paul Tek, <a href="/A247243/b247243.txt">Table of n, a(n) for n = 1..10000</a>
%H A247243 Paul Tek, <a href="/A247243/a247243.pl.txt">Perl program for this sequence</a>
%e A247243 +----+---------+------+
%e A247243 +  n | 2^(n-1) | a(n) |
%e A247243 +----+---------+------+
%e A247243 |  1 |       1 |    1 |
%e A247243 |  2 |       2 |    2 |
%e A247243 |  3 |       4 |    4 |
%e A247243 |  4 |       8 |    8 |
%e A247243 |  5 |      16 |   16 |
%e A247243 |  6 |      32 |    3 |
%e A247243 |  7 |      64 |    6 |
%e A247243 |  8 |     128 |   12 |
%e A247243 |  9 |     256 |   25 |
%e A247243 | 10 |     512 |    5 |
%e A247243 | 11 |    1024 |   10 |
%e A247243 +----+---------+------+
%o A247243 (Perl) See Link section.
%o A247243 (Python)
%o A247243 from itertools import count, islice
%o A247243 def ispal(n): s = str(n); return s == s[::-1]
%o A247243 def agen(): # generator of terms
%o A247243     aset, mink = set(), 1
%o A247243     for n in count(1):
%o A247243         k, target = mink, str(2**(n-1))
%o A247243         while k in aset or not target.startswith(str(k)): k += 1
%o A247243         an = k; aset.add(an); yield an
%o A247243         while mink in aset: mink += 1
%o A247243 print(list(islice(agen(), 65))) # _Michael S. Branicky_, Nov 07 2022
%Y A247243 Cf. A008952.
%K A247243 nonn,base
%O A247243 1,2
%A A247243 _Paul Tek_, Nov 30 2014