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.

A078677 Write n in binary; repeatedly sum the "digits" until reaching 1; a(n) = sum of these sums (including '1' and n itself).

This page as a plain text file.
%I A078677 #11 Mar 12 2025 17:27:25
%S A078677 1,3,6,5,8,9,13,9,12,13,17,15,19,20,20,17,20,21,25,23,27,28,28,27,31,
%T A078677 32,32,34,34,35,39,33,36,37,41,39,43,44,44,43,47,48,48,50,50,51,55,51,
%U A078677 55,56,56,58,58,59,63,62,62,63,67,65,69,70,72,65,68,69,73,71,75,76,76,75
%N A078677 Write n in binary; repeatedly sum the "digits" until reaching 1; a(n) = sum of these sums (including '1' and n itself).
%H A078677 Paolo Xausa, <a href="/A078677/b078677.txt">Table of n, a(n) for n = 1..10000</a>
%F A078677 a(1) = 1; for n > 1, a(n) = n + a(A000120(n)).
%F A078677 a(n) = Sum_{k = 0..A180094(n)} A381962(n,k). - _Paolo Xausa_, Mar 12 2025
%e A078677 a(13) = 19 because 13 = (1101) -> (1+1+0+1 = 11) -> (1+1 = 10) -> (1+0 = 1) = 1 and 1101+11+10+1 (binary) = 19 (decimal).
%t A078677 A078677[n_] := Total[NestWhileList[DigitSum[#, 2] &, n, # > 1 &]];
%t A078677 Array[A078677, 100] (* _Paolo Xausa_, Mar 11 2025 *)
%o A078677 (Python)
%o A078677 def a(n):
%o A078677     s = n if n > 1 else 0
%o A078677     while (n:=n.bit_count()) > 1:
%o A078677         s += n
%o A078677     return s + 1
%o A078677 print([a(n) for n in range(1, 73)]) # _Michael S. Branicky_, Mar 12 2025
%Y A078677 Cf. A000120, A078627, A180094.
%Y A078677 Row sums of A381962.
%K A078677 base,easy,nonn
%O A078677 1,2
%A A078677 Frank Schwellinger (nummer_eins(AT)web.de), Dec 17 2002