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.

A317931 Numerators of rational valued sequence whose Dirichlet convolution with itself yields A002487, Stern's Diatomic sequence.

This page as a plain text file.
%I A317931 #14 Sep 23 2018 21:28:17
%S A317931 1,1,1,3,3,1,3,5,3,3,5,3,5,3,1,35,5,3,7,9,5,5,7,5,19,5,5,9,7,1,5,63,1,
%T A317931 5,9,9,11,7,5,15,11,5,13,15,13,7,9,35,27,19,7,15,13,5,7,15,3,7,11,3,9,
%U A317931 5,-7,231,-1,1,11,15,7,9,13,15,15,11,47,21,19,5,13,105,27,11,19,15,27,13,11,25,17,13,23,21,11,9,1,63
%N A317931 Numerators of rational valued sequence whose Dirichlet convolution with itself yields A002487, Stern's Diatomic sequence.
%H A317931 Antti Karttunen, <a href="/A317931/b317931.txt">Table of n, a(n) for n = 1..16384</a>
%H A317931 <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>
%F A317931 a(n) = numerator of f(n), where f(1) = 1, f(n) = (1/2) * (A002487(n) - Sum_{d|n, d>1, d<n} f(d) * f(n/d)) for n > 1.
%o A317931 (PARI)
%o A317931 A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
%o A317931 A317931perA317932(n) = if(1==n,n,(A002487(n)-sumdiv(n,d,if((d>1)&&(d<n),A317931perA317932(d)*A317931perA317932(n/d),0)))/2);
%o A317931 A317931(n) = numerator(A317931perA317932(n));
%o A317931 (PARI)
%o A317931 \\ Memoized implementation:
%o A317931 memo = Map();
%o A317931 A317931perA317932(n) = if(1==n,n,if(mapisdefined(memo,n),mapget(memo,n),my(v = (A002487(n)-sumdiv(n,d,if((d>1)&&(d<n),A317931perA317932(d)*A317931perA317932(n/d),0)))/2); mapput(memo,n,v); (v)));
%Y A317931 Cf. A002487, A317932 (denominators, conjectured).
%Y A317931 Cf. also A299151, A317927, A317839, A317843.
%K A317931 sign,frac,look
%O A317931 1,4
%A A317931 _Antti Karttunen_, Aug 11 2018