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.

A218085 Let S_5(x) denote the difference in counts of multiples of 5 in the interval [0,x), those with even digit sums in base 4 in one set, those with odd digit sums in base 4 in the other. Then a(n) = (-1)^s_4(n) *(S_5(n) -10*S_5(floor(n/16)) +5*S_5(floor(n/256))), where s_4(n) = A053737(n).

This page as a plain text file.
%I A218085 #38 Feb 11 2021 09:04:36
%S A218085 0,-1,1,-1,-1,1,-2,2,2,-2,2,-3,-3,3,-3,3,6,-6,6,-6,-6,5,-5,5,5,-5,4,
%T A218085 -4,-4,4,-4,3,-3,3,-3,3,4,-4,4,-4,-4,3,-3,3,3,-3,2,-2,2,-2,2,-3,-3,3,
%U A218085 -3,3,4,-4,4,-4,-4,3,-3,3,3,-3,2,-2,-2,2,-2,1,1,-1,1,-1,0,0,0,0,0
%N A218085 Let S_5(x) denote the difference in counts of multiples of 5 in the interval [0,x), those with even digit sums in base 4 in one set, those with odd digit sums in base 4 in the other. Then a(n) = (-1)^s_4(n) *(S_5(n) -10*S_5(floor(n/16)) +5*S_5(floor(n/256))), where s_4(n) = A053737(n).
%C A218085 The sequence S_5(n) starts 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, ... for n >= 0. Apart from the initial 0, these are blocks of 5 repetitions of 1, 2, 3, 4, 5, 6, 7, 6, 7, 8, 7, 6, 7, 8, 9, 10, 11, 12, 13, 14, ...
%C A218085 Theorem. The sequence is periodic with period 2560.
%C A218085 The theorem allows us to write a recursion for S_5(n), considering n modulo 2560: S_5(n) = 10*S_5(floor(n/16)) - 5*S_5(floor(n/256)) + (-1)^s_4(n)*a(n).
%H A218085 Peter J. C. Moses, <a href="/A218085/b218085.txt">Table of n, a(n) for n = 0..2559</a>
%H A218085 Vladimir Shevelev and Peter J. C. Moses, <a href="http://arxiv.org/abs/1209.5705">A family of digit functions with large periods</a>, arXiv:1209.5705 [math.NT], 2012.
%F A218085 -9 <= a(n) <= 9, all 19 values are actually achieved.
%e A218085 a(n)=-9 for n=2411, 2412, 2414, 2491, 2492, 2494 (mod 2560);
%e A218085 a(n)=9 for n=2413, 2415, 2493, 2495 (mod 2560).
%p A218085 S := proc(n,j,x)
%p A218085     a := 0 ;
%p A218085     for r from j to x-1 by n do
%p A218085         add(d,d=convert(r,base,n-1)) ;
%p A218085         a := a+(-1)^% ;
%p A218085     end do:
%p A218085     a ;
%p A218085 end proc:
%p A218085 A218085 := proc(n)
%p A218085     S(5,0,n)-10*S(5,0,floor(n/16))+5*S(5,0,floor(n/256)) ;
%p A218085     %*(-1)^A053737(n) ;
%p A218085 end proc:
%p A218085 seq(A218085(n),n=0..80) ; # _R. J. Mathar_, Oct 31 2012
%Y A218085 Cf. A214458, A217971, A053737.
%K A218085 sign,base,easy
%O A218085 0,7
%A A218085 _Vladimir Shevelev_ and _Peter J. C. Moses_, Oct 20 2012