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.

A381957 If n = Sum 2^e(k), then a(n) = Sum 2^a(e(k)), with a(0) = 1.

This page as a plain text file.
%I A381957 #11 Mar 18 2025 15:48:03
%S A381957 1,2,4,6,16,18,20,22,64,66,68,70,80,82,84,86,65536,65538,65540,65542,
%T A381957 65552,65554,65556,65558,65600,65602,65604,65606,65616,65618,65620,
%U A381957 65622,262144,262146,262148,262150,262160,262162,262164,262166,262208,262210,262212,262214,262224,262226
%N A381957 If n = Sum 2^e(k), then a(n) = Sum 2^a(e(k)), with a(0) = 1.
%C A381957 Replace 2^k in the binary representation of n with 2^a(k).
%F A381957 G.f.: 1 + (1/(1 - x)) * Sum_{k>=0} 2^a(k) * x^(2^k) / (1 + x^(2^k)).
%e A381957 25 = 2^4 + 2^3 + 2^0, hence a(25) = 2^a(4) + 2^a(3) + 2^a(0) = 2^16 + 2^6 + 2^1 = 65602.
%t A381957 e[n_] := -1 + Position[Reverse[IntegerDigits[n, 2]], 1] // Flatten; a[0] = 1; a[n_] := a[n] = Total[2^a /@ e[n]]; Array[a, 50, 0] (* _Amiram Eldar_, Mar 11 2025 *)
%o A381957 (PARI) a(n) = if (n==0, 1, my(v=Vecrev(binary(n))); sum(k=1, #v, if (v[k], 2^a(k-1)))); \\ _Michel Marcus_, Mar 11 2025
%Y A381957 Cf. A029931, A033922, A073642.
%K A381957 nonn,base
%O A381957 0,2
%A A381957 _Ilya Gutkovskiy_, Mar 11 2025