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.

A361838 a(n) is the number of 2s in the binary hereditary representation of 2n.

This page as a plain text file.
%I A361838 #34 Aug 18 2025 19:25:57
%S A361838 1,2,3,2,3,4,5,3,4,5,6,5,6,7,8,3,4,5,6,5,6,7,8,6,7,8,9,8,9,10,11,4,5,
%T A361838 6,7,6,7,8,9,7,8,9,10,9,10,11,12,7,8,9,10,9,10,11,12,10,11,12,13,12,
%U A361838 13,14,15,4,5,6,7,6,7,8,9,7,8,9,10,9,10,11,12,7
%N A361838 a(n) is the number of 2s in the binary hereditary representation of 2n.
%C A361838 See comments on A266201 for the definition of hereditary representation.
%H A361838 Antti Karttunen, <a href="/A361838/b361838.txt">Table of n, a(n) for n = 1..65537</a>
%e A361838 A table of n, the binary hereditary representation of 2n, and the number of 2s in the representation:
%e A361838  n | hereditary rep. of 2n   | number of 2s
%e A361838 ---+-------------------------+--------------
%e A361838  1 | 2                       |      1
%e A361838  2 | 2^2                     |      2
%e A361838  3 | 2^2+2                   |      3
%e A361838  4 | 2^(2+1)                 |      2
%e A361838  5 | 2^(2+1)+2               |      3
%e A361838  6 | 2^(2+1)+2^2             |      4
%e A361838  7 | 2^(2+1)+2^2+2           |      5
%e A361838  8 | 2^2^2                   |      3
%e A361838  9 | 2^2^2+2                 |      4
%e A361838 10 | 2^2^2+2^2               |      5
%e A361838 11 | 2^2^2+2^2+2             |      6
%e A361838 12 | 2^2^2+2^(2+1)           |      5
%e A361838 13 | 2^2^2+2^(2+1)+2         |      6
%e A361838 14 | 2^2^2+2^(2+1)+2^2       |      7
%e A361838 15 | 2^2^2+2^(2+1)+2^2+2     |      8
%e A361838 16 | 2^(2^2+1)               |      3
%e A361838 17 | 2^(2^2+1)+2             |      4
%e A361838 18 | 2^(2^2+1)+2^2           |      5
%e A361838 19 | 2^(2^2+1)+2^2+2         |      6
%e A361838 20 | 2^(2^2+1)+2^(2+1)       |      5
%e A361838 21 | 2^(2^2+1)+2^(2+1)+2     |      6
%e A361838 22 | 2^(2^2+1)+2^(2+1)+2^2   |      7
%e A361838 23 | 2^(2^2+1)+2^(2+1)+2^2+2 |      8
%e A361838 24 | 2^(2^2+1)+2^2^2         |      6
%e A361838 25 | 2^(2^2+1)+2^2^2+2       |      7
%e A361838 26 | 2^(2^2+1)+2^2^2+2^2     |      8
%e A361838 27 | 2^(2^2+1)+2^2^2+2^2+2   |      9
%e A361838 28 | 2^(2^2+1)+2^2^2+2^(2+1) |      8
%o A361838 (PARI) a(n)=if(n==0, 0, sum(k=0, logint(n,2), if(bittest(n,k), 1 + a((k+1)\2)))) \\ _Andrew Howroyd_, Apr 07 2023
%Y A361838 Cf. A005245, A025280.
%K A361838 nonn,base,hear
%O A361838 1,2
%A A361838 _Jodi Spitz_, Mar 26 2023