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.

A230091 Numbers of the form k + wt(k) for exactly two distinct k, where wt(k) = A000120(k) is the binary weight of k.

This page as a plain text file.
%I A230091 #24 Mar 04 2023 08:56:19
%S A230091 5,14,17,19,22,31,33,36,38,47,50,52,55,64,67,70,79,82,84,87,96,98,101,
%T A230091 103,112,115,117,120,131,132,143,146,148,151,160,162,165,167,176,179,
%U A230091 181,184,193,196,199,208,211,213,216,225,227,230,232,241,244,246,249,258,260,262,271,274,276,279,288,290,293,295
%N A230091 Numbers of the form k + wt(k) for exactly two distinct k, where wt(k) = A000120(k) is the binary weight of k.
%C A230091 The positions of entries equal to 2 in A228085, or numbers that appear exactly twice in A092391.
%C A230091 Numbers that can be expressed as the sum of distinct terms of the form 2^n+1, n=0,1,... in exactly two ways.
%H A230091 Reinhard Zumkeller, <a href="/A230091/b230091.txt">Table of n, a(n) for n = 1..10000</a>
%H A230091 <a href="/index/Coi#Colombian">Index entries for Colombian or self numbers and related sequences</a>
%e A230091 5 = 3 + 2 = 4 + 1, so 5 is in this list.
%p A230091 # Maple code for A000120, A092391, A228085, A010061, A228088, A230091, A230092
%p A230091 with(LinearAlgebra):
%p A230091 read transforms;
%p A230091 wt := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: # A000120
%p A230091 M:=1000;
%p A230091 lis1:=Array(0..M);
%p A230091 lis2:=Array(0..M);
%p A230091 ctmax:=4;
%p A230091 for i from 0 to ctmax do ct[i]:=Array(0..M); od:
%p A230091 for n from 0 to M do
%p A230091 m:=n+wt(n);
%p A230091 lis1[n]:=m;
%p A230091 if (m <= M) then lis2[m]:=lis2[m]+1; fi;
%p A230091 od:
%p A230091 t1:=[seq(lis1[i],i=0..M)]; # A092391
%p A230091 t2:=[seq(lis2[i],i=0..M)]; # A228085
%p A230091 COMPl(t1); # A010061
%p A230091 for i from 1 to M do h:=lis2[i];
%p A230091 if h <= ctmax then ct[h]:=[op(ct[h]),i]; fi; od:
%p A230091 len:=nops(ct[0]); [seq(ct[0][i],i=1..len)]; # A010061 again
%p A230091 len:=nops(ct[1]); [seq(ct[1][i],i=1..len)]; # A228088
%p A230091 len:=nops(ct[2]); [seq(ct[2][i],i=1..len)]; # A230091
%p A230091 len:=nops(ct[3]); [seq(ct[3][i],i=1..len)]; # A230092
%t A230091 nt = 100; (* number of terms to produce *)
%t A230091 S[kmax_] := S[kmax] = Table[k + Total[IntegerDigits[k, 2]], {k, 0, kmax}] // Tally // Select[#, #[[2]] == 2&][[All, 1]]& // PadRight[#, nt]&;
%t A230091 S[nt];
%t A230091 S[kmax = 2 nt];
%t A230091 While[S[kmax] =!= S[kmax/2], kmax *= 2];
%t A230091 S[kmax] (* _Jean-François Alcover_, Mar 04 2023 *)
%o A230091 (Haskell)
%o A230091 a230091 n = a230091_list !! (n-1)
%o A230091 a230091_list = filter ((== 2) . a228085) [1..]
%o A230091 -- _Reinhard Zumkeller_, Oct 13 2013
%Y A230091 Cf. A000120, A010061, A092391, A228088, A228085, A230058, A230092.
%Y A230091 Cf. A227915.
%K A230091 nonn,base
%O A230091 1,1
%A A230091 _N. J. A. Sloane_, Oct 10 2013