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.

A249344 A(n,k) = exponent of the largest power of n-th prime which divides k, square array read by antidiagonals.

This page as a plain text file.
%I A249344 #39 Feb 28 2025 05:54:42
%S A249344 0,1,0,0,0,0,2,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,3,0,0,0,0,0,
%T A249344 0,0,0,0,0,0,0,0,0,0,0,1,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,
%U A249344 1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0
%N A249344 A(n,k) = exponent of the largest power of n-th prime which divides k, square array read by antidiagonals.
%C A249344 Square array A(n,k), where n = row, k = column, read by antidiagonals: A(1,1), A(1,2), A(2,1), A(1,3), A(2,2), A(3,1), ... (transpose of array A060175).
%C A249344 A(n,k) is the (p_n)-adic valuation of k, where p_n is the n-th prime, A000040(n).
%C A249344 Each row is effectively a ruler function, s, with s(1) = 0. - _Peter Munn_, Apr 30 2022
%F A249344 Row n, as a sequence, is completely additive with A(n, prime(n)) = 1, A(n, prime(m)) = 0 for m <> n. - _Peter Munn_, Apr 30 2022
%F A249344 Sum_{k=1..m} A(n,k) ~ (1/(prime(n)-1)) * m. - _Amiram Eldar_, Oct 01 2023
%e A249344 The top-left corner of the array:
%e A249344   0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, ...
%e A249344   0, 0, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, ...
%e A249344   0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ...
%e A249344   0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, ...
%e A249344   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, ...
%e A249344   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, ...
%e A249344   ...
%e A249344 A(1,8) = 3, because 2^3 is the largest power of 2 (= p_1 = A000040(1)) that divides 8.
%e A249344 a(2,9) = 2, because 3^2 is the largest power of 3 (= p_2) that divides 9.
%e A249344 a(3,15) = 1, because 5^1 is the largest power of 5 (= p_3) that divides 15.
%t A249344 A[n_, k_] := IntegerExponent[k, Prime[n]]; Table[A[k, n - k + 1], {n, 1, 15}, {k, 1, n}] // Flatten (* _Amiram Eldar_, Oct 01 2023 *)
%o A249344 (Scheme)
%o A249344 (define (A249344 n) (A249344bi (A002260 n) (A004736 n)))
%o A249344 (define (A249344bi row col) (let ((p (A000040 row))) (let loop ((n col) (i 0)) (cond ((not (zero? (modulo n p))) i) (else (loop (/ n p) (+ i 1)))))))
%o A249344 (Python)
%o A249344 from sympy import prime
%o A249344 def a(n, k):
%o A249344     p=prime(n)
%o A249344     i=z=0
%o A249344     while p**i<=k:
%o A249344         if k%(p**i)==0: z=i
%o A249344         i+=1
%o A249344     return z
%o A249344 for n in range(1, 10): print([a(k, n - k + 1) for k in range(1, n + 1)]) # _Indranil Ghosh_, Jun 24 2017
%o A249344 (PARI) a(n, k) = valuation(k, prime(n)); \\ _Michel Marcus_, Jun 24 2017
%Y A249344 Transpose: A060175.
%Y A249344 Row 1: A007814.
%Y A249344 Row 2: A007949.
%Y A249344 Row 3: A112765.
%Y A249344 Row 4: A214411.
%Y A249344 Cf. also A000040, A002260, A004736, A085604, A090622, A115627, A249421.
%Y A249344 Completely additive sequences where more than one prime is mapped to 1, all other primes to 0: A065339, A083025, A087436, A169611.
%Y A249344 Ruler functions, s, with s(1) = 0 that are not rows here: A122840, A122841, A235127, A244413.
%K A249344 nonn,tabl,easy
%O A249344 1,7
%A A249344 _Antti Karttunen_, Oct 28 2014