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.

A295235 Numbers k such that the positions of the ones in the binary representation of k are in arithmetic progression.

This page as a plain text file.
%I A295235 #33 Jul 23 2019 00:43:34
%S A295235 0,1,2,3,4,5,6,7,8,9,10,12,14,15,16,17,18,20,21,24,28,30,31,32,33,34,
%T A295235 36,40,42,48,56,60,62,63,64,65,66,68,72,73,80,84,85,96,112,120,124,
%U A295235 126,127,128,129,130,132,136,144,146,160,168,170,192,224,240,248
%N A295235 Numbers k such that the positions of the ones in the binary representation of k are in arithmetic progression.
%C A295235 Also numbers k of the form Sum_{b=0..h-1} 2^(i+j*b) for some h >= 0, i >= 0, j > 0 (in fact, h = A000120(k), and if k > 0, i = A007814(k)).
%C A295235 There is a simple bijection between the finite sets of nonnegative integers in arithmetic progression and the terms of this sequence: s -> Sum_{i in s} 2^i; the term 0 corresponds to the empty set.
%C A295235 For any n > 0, A054519(n) gives the numbers of terms with n+1 digits in binary representation.
%C A295235 For any n >= 0, n is in the sequence iff 2*n is in the sequence.
%C A295235 For any n > 0, A000695(a(n)) is in the sequence.
%C A295235 The first prime numbers in the sequence are: 2, 3, 5, 7, 17, 31, 73, 127, 257, 8191, 65537, 131071, 262657, 524287, ...
%C A295235 This sequence contains the following sequences: A000051, A000079, A000225, A000668, A002450, A019434, A023001, A048645.
%C A295235 For any k > 0, 2^k - 2, 2^k - 1, 2^k, 2^k + 1 and 2^k + 2 are in the sequence (e.g., 14, 15, 16, 17, and 18).
%C A295235 Every odd term is a binary palindrome (and thus belongs to A006995).
%C A295235 Odd terms are A064896. - _Robert Israel_, Nov 20 2017
%H A295235 Rémy Sigrist, <a href="/A295235/b295235.txt">Table of n, a(n) for n = 1..1000</a>
%e A295235 The binary representation of the number 42 is "101010" and has ones evenly spaced, hence 42 appears in the sequence.
%e A295235 The first terms, alongside their binary representations, are:
%e A295235    n  a(n)  a(n) in binary
%e A295235   --  ----  --------------
%e A295235    1    0           0
%e A295235    2    1           1
%e A295235    3    2          10
%e A295235    4    3          11
%e A295235    5    4         100
%e A295235    6    5         101
%e A295235    7    6         110
%e A295235    8    7         111
%e A295235    9    8        1000
%e A295235   10    9        1001
%e A295235   11   10        1010
%e A295235   12   12        1100
%e A295235   13   14        1110
%e A295235   14   15        1111
%e A295235   15   16       10000
%e A295235   16   17       10001
%e A295235   17   18       10010
%e A295235   18   20       10100
%e A295235   19   21       10101
%e A295235   20   24       11000
%p A295235 f:= proc(d) local i,j,k;
%p A295235   op(sort([seq(seq(add(2^(d-j*k),k=0..m),m=1..d/j),j=1..d),2^(d+1)]))
%p A295235 end proc:
%p A295235 0,1,seq(f(d),d=0..10); # _Robert Israel_, Nov 20 2017
%t A295235 bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
%t A295235 Select[Range[100],SameQ@@Differences[bpe[#]]&] (* _Gus Wiseman_, Jul 22 2019 *)
%o A295235 (PARI) is(n) = my(h=hammingweight(n)); if(h<3, return(1), my(i=valuation(n,2),w=#binary(n)); if((w-i-1)%(h-1)==0, my(j=(w-i-1)/(h-1)); return(sum(k=0,h-1,2^(i+j*k))==n), return(0)))
%Y A295235 Cf. A000051, A000079, A000120, A000225, A000668, A000695, A002450, A006995, A007814, A019434, A023001, A048645, A054519, A064896.
%Y A295235 Cf. A029931, A048793 (binary indices triangle), A070939, A291166, A325328 (prime indices rather than binary indices), A326669, A326675.
%K A295235 nonn,base
%O A295235 1,3
%A A295235 _Rémy Sigrist_, Nov 18 2017