OFFSET
0,7
COMMENTS
In other words, in binary expansion of n, replace 2^i by 2^(k*i).
LINKS
FORMULA
EXAMPLE
Square array A(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10
------------------------------------------------------------------
0| 0 0 0 0 0 0 0 0 0 0 0
1| 1 1 1 1 1 1 1 1 1 1 1
2| 1 2 4 8 16 32 64 128 256 512 1024
3| 2 3 5 9 17 33 65 129 257 513 1025
4| 1 4 16 64 256 1024 4096 16384 65536 262144 1048576
5| 2 5 17 65 257 1025 4097 16385 65537 262145 1048577
6| 2 6 20 72 272 1056 4160 16512 65792 262656 1049600
7| 3 7 21 73 273 1057 4161 16513 65793 262657 1049601
PROG
(PARI) A(n, k) = { my (v=0, e); while (n, n-=2^e=valuation(n, 2); v+=2^(k*e)); v }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Feb 27 2022
STATUS
approved