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.

A100129 Numbers k such that 2^k starts with k.

This page as a plain text file.
%I A100129 #42 Apr 11 2023 08:42:33
%S A100129 6,10,1542,77075,113939,1122772,2455891300,2830138178,136387767490,
%T A100129 2111259099790,3456955336468,4653248164310,10393297007134,
%U A100129 321249146279171,972926121017616,72780032758751764
%N A100129 Numbers k such that 2^k starts with k.
%C A100129 According to van de Lune, Erdős observed that 2^6 = 64 and 2^10 = 1024 were two examples where the decimal expansion of 2^k starts with that of k. At that time no other examples were known. Jan van de Lune computed the first 6 terms in 1978. - _Juan Arias-de-Reyna_, Feb 12 2016
%H A100129 J. van de Lune, <a href="https://ir.cwi.nl/pub/7417/">A note on a problem of Erdős</a>, Department of Pure Mathematics, ZW 87/78, Mathematisch Centrum, Amsterdam 1978, 1-3.
%F A100129 The sequence contains k if and only if 0 <= {k*log_10(2)} - {log_10(k)} < log_10(k+1) - log_10(k), where {x} denotes the fractional part of x. See the van de Lune article. - _David Radcliffe_, Jun 02 2019
%e A100129 2^6 = 64, which begins with 6;
%e A100129 2^10 = 1024, which begins with 10.
%t A100129 f[n_] := Floor[ 10^Floor[ Log[10, n]](10^FractionalPart[n*N[ Log[10, 2], 24]])]; Do[ If[ f[n] == n, Print[n]], {n, 125000000}] (* _Robert G. Wilson v_, Nov 16 2004 *)
%o A100129 (Python) # Caveat: fails for large n due to rounding error.
%o A100129 from math import log10 as log
%o A100129 frac = lambda x: x - int(x)
%o A100129 is_a100129 = lambda n: 0 <= frac(n * log(2)) - frac(log(n)) < log(n + 1) - log(n) # _David Radcliffe_, Jun 02 2019
%o A100129 (Python)
%o A100129 from itertools import count, islice
%o A100129 def A100129_gen(startvalue=1): # generator of terms
%o A100129     a = 1<<(m:=max(startvalue,1))
%o A100129     for n in count(m):
%o A100129         if (s:=str(n))==str(a)[:len(s)]:
%o A100129             yield n
%o A100129         a <<= 1
%o A100129 A100129_list = list(islice(A100129_gen(),4)) # _Chai Wah Wu_, Apr 10 2023
%Y A100129 Cf. A064541 (2^k ending with k), A032740 (k a substring of 2^k), A131494.
%K A100129 nonn,base
%O A100129 1,1
%A A100129 Mark Hudson (mrmarkhudson(AT)hotmail.com), Nov 15 2004
%E A100129 a(5) and a(6) from _Robert G. Wilson v_, Nov 16 2004
%E A100129 More terms from _Robert Gerbicz_, Aug 22 2006