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.

A333979 Array read by antidiagonals, n >= 0, k >= 2: T(n,k) is the "digital derivative" of n in base k; if the base k representation of n is Sum_{j>=0} d_j*k^j, then T(n,k) = Sum_{j>=1} d_j*j*k^(j-1).

This page as a plain text file.
%I A333979 #20 May 05 2021 13:40:39
%S A333979 0,0,0,0,0,1,0,0,0,1,0,0,0,1,4,0,0,0,0,1,4,0,0,0,0,1,1,5,0,0,0,0,0,1,
%T A333979 2,5,0,0,0,0,0,1,1,2,12,0,0,0,0,0,0,1,1,2,12,0,0,0,0,0,0,1,1,2,6,13,0,
%U A333979 0,0,0,0,0,0,1,1,2,6,13
%N A333979 Array read by antidiagonals, n >= 0, k >= 2: T(n,k) is the "digital derivative" of n in base k; if the base k representation of n is Sum_{j>=0} d_j*k^j, then T(n,k) = Sum_{j>=1} d_j*j*k^(j-1).
%H A333979 Pontus von Brömssen, <a href="/A333979/b333979.txt">Antidiagonals n = 0..99, flattened</a>
%H A333979 M. J. Bannister, Z. Cheng, W. E. Devanny, and D. Eppstein, <a href="http://dx.doi.org/10.7155/jgaa.00318">Superpatterns and universal point sets</a>, Journal of Graph Algorithms and Applications 18(2) (2014), 177-209.
%F A333979 T(n,k) = floor(n/k) + k*T(floor(n/k),k). Proof: With n = Sum_{j>=0} d_j*k^j we have floor(n/k) + k*T(floor(n/k),k) = Sum_{j>=1} (d_j*k^(j-1) + k*d_j*(j-1)*k^(j-2)) = Sum_{j>=1} d_j*j*k^(j-1) = T(n,k).
%F A333979 T(n,k) = T(n-1,k) + A055129(A286561(n,k),k). Proof: Let n = Sum_{j>=0} d_j*k^j and pick v so that d_j = 0 for j < v and d_v > 0 (so v = A286561(n,k)). Then n - 1 = sum_{j>=0} e_j*k^j, where e_j = k - 1 for j < v, e_v = d_v - 1, and e_j = d_j for j > v. We get T(n,k) - T(n-1,k) = Sum_{j>=1} j*(d_j-e_j)*k^(j-1) = v*k^(v-1) - (k-1)*Sum_{1<=j<v} j*k^(j-1). Working out the sum and simplifying, we get T(n,k) - T(n-1,k) = (k^v - 1)/(k - 1) = A055129(A286561(n,k),k).
%F A333979 For fixed k, T(n,k) ~ n*log(n)/(k*log(k)). (The proof for k = 2 by Bannister et al. (p. 182) can be adapted to general k.)
%F A333979 T(n,k) = Sum_{j>=0} k^j*floor(n/k**(j+1)).
%e A333979 Array begins:
%e A333979   n\k|  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16
%e A333979   ---|---------------------------------------------
%e A333979    0 |  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
%e A333979    1 |  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
%e A333979    2 |  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
%e A333979    3 |  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0
%e A333979    4 |  4  1  1  0  0  0  0  0  0  0  0  0  0  0  0
%e A333979    5 |  4  1  1  1  0  0  0  0  0  0  0  0  0  0  0
%e A333979    6 |  5  2  1  1  1  0  0  0  0  0  0  0  0  0  0
%e A333979    7 |  5  2  1  1  1  1  0  0  0  0  0  0  0  0  0
%e A333979    8 | 12  2  2  1  1  1  1  0  0  0  0  0  0  0  0
%e A333979    9 | 12  6  2  1  1  1  1  1  0  0  0  0  0  0  0
%e A333979   10 | 13  6  2  2  1  1  1  1  1  0  0  0  0  0  0
%e A333979   11 | 13  6  2  2  1  1  1  1  1  1  0  0  0  0  0
%e A333979   12 | 16  7  3  2  2  1  1  1  1  1  1  0  0  0  0
%e A333979   13 | 16  7  3  2  2  1  1  1  1  1  1  1  0  0  0
%e A333979   14 | 17  7  3  2  2  2  1  1  1  1  1  1  1  0  0
%e A333979   15 | 17  8  3  3  2  2  1  1  1  1  1  1  1  1  0
%e A333979   16 | 32  8  8  3  2  2  2  1  1  1  1  1  1  1  1
%e A333979 64 = 2*3^3 + 1*3^2 + 0*3^1 + 1*3^0, so T(64,3) = 2*3*3^2 + 1*2*3^1 + 0*1*3^0 = 60. Alternatively, using the formula T(n,k) = floor(n/k) + k*T(floor(n/k),k), we get T(64,3) = 21 + 3*T(21,3) = 21 + 3*(7 + 3*T(7,3)) = 42 + 9*(2 + 3*T(2,3)) = 60.
%o A333979 (Python)
%o A333979 import sympy
%o A333979 def A333979(n,k):
%o A333979   d=sympy.ntheory.factor_.digits(n,k)
%o A333979   return sum(j*d[-j-1]*k**(j-1) for j in range(1,len(d)-1))
%o A333979 (Python)
%o A333979 # Second program (faster)
%o A333979 def A333979(n,k):
%o A333979   return n//k+k*A333979(n//k,k) if n>=k else 0
%Y A333979 Cf. A136013 (column k=2), A080277 (every second term of column k=2), A080333 (every third term of column k=3).
%Y A333979 Cf. A007824, A055129, A286561.
%K A333979 nonn,base,tabl
%O A333979 0,15
%A A333979 _Pontus von Brömssen_, Sep 04 2020