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.

Original entry on oeis.org

5, 14, 17, 19, 22, 31, 33, 36, 38, 47, 50, 52, 55, 64, 67, 70, 79, 82, 84, 87, 96, 98, 101, 103, 112, 115, 117, 120, 131, 132, 143, 146, 148, 151, 160, 162, 165, 167, 176, 179, 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
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2013

Keywords

Comments

The positions of entries equal to 2 in A228085, or numbers that appear exactly twice in A092391.
Numbers that can be expressed as the sum of distinct terms of the form 2^n+1, n=0,1,... in exactly two ways.

Examples

			5 = 3 + 2 = 4 + 1, so 5 is in this list.
		

Crossrefs

Programs

  • Haskell
    a230091 n = a230091_list !! (n-1)
    a230091_list = filter ((== 2) . a228085) [1..]
    -- Reinhard Zumkeller, Oct 13 2013
  • Maple
    # Maple code for A000120, A092391, A228085, A010061, A228088, A230091, A230092
    with(LinearAlgebra):
    read transforms;
    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
    M:=1000;
    lis1:=Array(0..M);
    lis2:=Array(0..M);
    ctmax:=4;
    for i from 0 to ctmax do ct[i]:=Array(0..M); od:
    for n from 0 to M do
    m:=n+wt(n);
    lis1[n]:=m;
    if (m <= M) then lis2[m]:=lis2[m]+1; fi;
    od:
    t1:=[seq(lis1[i],i=0..M)]; # A092391
    t2:=[seq(lis2[i],i=0..M)]; # A228085
    COMPl(t1); # A010061
    for i from 1 to M do h:=lis2[i];
    if h <= ctmax then ct[h]:=[op(ct[h]),i]; fi; od:
    len:=nops(ct[0]); [seq(ct[0][i],i=1..len)]; # A010061 again
    len:=nops(ct[1]); [seq(ct[1][i],i=1..len)]; # A228088
    len:=nops(ct[2]); [seq(ct[2][i],i=1..len)]; # A230091
    len:=nops(ct[3]); [seq(ct[3][i],i=1..len)]; # A230092
  • Mathematica
    nt = 100; (* number of terms to produce *)
    S[kmax_] := S[kmax] = Table[k + Total[IntegerDigits[k, 2]], {k, 0, kmax}] // Tally // Select[#, #[[2]] == 2&][[All, 1]]& // PadRight[#, nt]&;
    S[nt];
    S[kmax = 2 nt];
    While[S[kmax] =!= S[kmax/2], kmax *= 2];
    S[kmax] (* Jean-François Alcover, Mar 04 2023 *)