OFFSET
0,4
COMMENTS
Consider the infinite array given in A054238:
0 1 4 5 16 17 20 21 ...
2 3 6 7 18 19 22 23 ...
8 9 12 13 24 25 28 29 ...
10 11 14 15 26 27 30 31 ...
32 33 36 37 48 49 52 53 ...
34 35 38 39 50 51 54 55 ...
40 41 44 45 56 57 60 61 ...
42 43 46 47 58 59 62 63 ...
The element in row i and column j is obtained from doing a perfect shuffle, interleaving the base-2 representations of i and j (with the shorter one padded on the left with 0's, if necessary, to make them the same length). Each natural number appears exactly once in this array. Then a(n) is the sum of the row and column numbers where n appears.
Every natural number k appears in the sequence exactly k+1 times.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 0..8192
FORMULA
a(4n) = 2*a(n).
a(4n+1) = a(4n+2) = 2*a(n) - a(2n) + a(2n+1).
a(4n+3) = 2*a(n) - 2*a(2n) + 2*a(2n+1).
PROG
(Python)
def A393253_list(nmax):
A = [0, 1, 1, 2]
if nmax < 4:
return A[:nmax+1:]
for n in range(4, nmax+1):
y = n//4
r = (n%4 + n%2)//2
A.append(2*A[y] - r*A[2*y] + r*A[2*y+1])
return A # John Tyler Rascoe, Feb 16 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jeffrey Shallit, Feb 07 2026
STATUS
approved