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.

A261751 Numbers n with property that binary expansion of n^3 begins with the binary expansion of n.

This page as a plain text file.
%I A261751 #11 Dec 24 2019 17:30:39
%S A261751 0,1,2,3,4,6,8,16,23,32,64,91,128,256,512,1024,2048,4096,5793,8192,
%T A261751 16384,32768,46341,65536,92682,131072,185364,262144,370728,524288,
%U A261751 1048576,2097152,2965821,4194304,5931642,8388608,16777216,33554432,47453133,67108864,94906266
%N A261751 Numbers n with property that binary expansion of n^3 begins with the binary expansion of n.
%C A261751 2^k is always a term in this sequence.
%C A261751 It appears that all solutions are either a power of 2 or approximately sqrt(2) * a power of 2. - _Andrew Howroyd_, Dec 24 2019
%H A261751 Andrew Howroyd, <a href="/A261751/b261751.txt">Table of n, a(n) for n = 1..1000</a>
%e A261751 23 is a term of this sequence because its cube written in base 2 (10111110000111) starts with its representation in base 2 (10111).
%t A261751 SetBeginSet[set1_, set2_] :=
%t A261751   Do[For[i = 1, i <= Length[set1], i++,If[! set1[[i]] == set2[[i]], Return[False]]];Return[True], {1}];
%t A261751 For[k = 0; set = {}, k <= 100000, k++,If[SetBeginSet[IntegerDigits[k, 2], IntegerDigits[k^3, 2]],Print[k]]]
%o A261751 (PARI) ok(n)={my(t=n^3); t == 0 || t>>(logint(t,2)-logint(n,2))==n} \\ _Andrew Howroyd_, Dec 23 2019
%o A261751 (PARI) \\ for larger values
%o A261751 viable(b,k)={my(p=b^3, q=(b+2^k-1)^3, s=logint(q,2), t=s-logint(b,2)+k); (p>>s)==0 || ((p>>t)<=(b>>k) && (b>>k)<=(q>>t))}
%o A261751 upto(n)={
%o A261751   local(L=List([0]));
%o A261751   my(recurse(b,k)=; if(b <= n && viable(b,k), k--; if(k<0, listput(L, b), self()(b,k); self()(b+2^k,k))));
%o A261751   for(k=0, logint(n,2), recurse(2^k, k));
%o A261751   Vec(L);
%o A261751 } \\ _Andrew Howroyd_, Dec 24 2019
%Y A261751 Base 2 version of A052210.
%Y A261751 Cf. A004539.
%K A261751 nonn,base,easy
%O A261751 1,3
%A A261751 _Dhilan Lahoti_, Aug 30 2015
%E A261751 Terms a(31) and beyond from _Andrew Howroyd_, Dec 23 2019