login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A377722
n appears n^4 times.
1
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
OFFSET
1,2
FORMULA
a(n) = m+1 if n>m(m+1)(2m+1)(3m^2+3m-1)/30 and a(n) = m otherwise where m = floor((5n)^(1/5)).
For a sequence a_k(n) where n appears n^(k-1) times, a_k(n) = m+1 if n > Sum_{i=1..m} i^(k-1) and a_k(n) = m otherwise where m = floor((kn)^(1/k)).
MATHEMATICA
A377722[n_] := # + Boole[n > #*(# + 1)*(2*# + 1)*(3*#^2 + 3*# - 1)/30] & [Floor[(5*n)^(1/5)]];
Array[A377722, 354] (* or *)
Flatten[Table[k, {k, 4}, {k^4}]] (* Paolo Xausa, Nov 05 2024 *)
PROG
(Python)
from sympy import integer_nthroot
def A377722(n): return (m:=integer_nthroot(5*n, 5)[0])+(30*n>m*(m+1)*((m<<1)+1)*(3*m*(m+1)-1))
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Nov 04 2024
STATUS
approved