login
A006048
Number of entries in first n rows of Pascal's triangle not divisible by 3.
(Formerly M2519)
11
1, 3, 6, 8, 12, 18, 21, 27, 36, 38, 42, 48, 52, 60, 72, 78, 90, 108, 111, 117, 126, 132, 144, 162, 171, 189, 216, 218, 222, 228, 232, 240, 252, 258, 270, 288, 292, 300, 312, 320, 336, 360, 372, 396, 432, 438, 450, 468, 480, 504, 540, 558, 594, 648, 651, 657, 666, 672, 684, 702, 711, 729, 756, 762, 774, 792, 804, 828, 864, 882, 918, 972, 981, 999, 1026, 1044, 1080, 1134, 1161, 1215, 1296
OFFSET
0,2
REFERENCES
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197.
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 53.
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Periodic minimum in the count of binomial coefficients not divisible by a prime, arXiv:2408.06817 [math.NT], 2024. See p. 1.
Akhlesh Lakhtakia and Russell Messier, Self-similar sequences and chaos from Gauss sums, Computers & graphics 13.1 (1989): 59-62.
Akhlesh Lakhtakia and Russell Messier, Self-similar sequences and chaos from Gauss sums, Computers & Graphics 13.1 (1989), 59-62. (Annotated scanned copy)
Akhlesh Lakhtakia and Russell Messier, Self-similar sequences and chaos from Gauss sums, Computers & Graphics 13.1 (1989), 59-60. (Annotated scanned copy)
MATHEMATICA
Table[Sum[Times@@(IntegerDigits[m, 3]+1), {m, 0, n}], {n, 0, 80}] (* Vincenzo Librandi, Feb 18 2026 *)
PROG
(Python)
from math import prod
from gmpy2 import digits
def A006048(n): return sum(prod(int(d)+1 for d in digits(m, 3)) for m in range(n+1)) # Chai Wah Wu, Aug 10 2025
(Python)
from math import prod
from gmpy2 import digits
def A006048(n):
d = list(map(lambda x:int(x)+1, digits(n+1, 3)[::-1]))
return sum((b-1)*prod(d[a:])*6**a for a, b in enumerate(d))>>1 # Chai Wah Wu, Aug 13 2025
(Magma) [&+[ &*[ d+1 : d in (m eq 0 select [0] else IntegerToSequence(m, 3))]: m in [0..n]] : n in [0..67]]; // Vincenzo Librandi, Feb 18 2026
CROSSREFS
Partial sums of A006047.
Sequence in context: A301283 A288218 A212984 * A245989 A350928 A049827
KEYWORD
nonn
EXTENSIONS
More terms from N. J. A. Sloane, Apr 23 2025
STATUS
approved