login
A256433
Characteristic function of dodecahedral numbers.
2
1, 1, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
OFFSET
0
COMMENTS
Dodecahedral numbers are of the form m(3m-1)(3m-2)/2.
FORMULA
For n > 0, a(n) = floor(t(n) + 1/(27 * t(n)) + 1/3) - floor(t(n-1) + 1/(27 * t(n-1)) + 1/3), where t(n) = ( sqrt(243*n^2-1)/(3^(9/2)) + n/9 )^(1/3).
For n>0, a(n) = 1 if n==m*(3*m-1)*(3*m-2)/2 and a(n) = 0 otherwise where m = floor((2*n/9)^(1/3))+1. - Chai Wah Wu, Oct 02 2025
MATHEMATICA
With[{ddn=Table[m(3m-1)(3m-2)/2, {m, 0, 10}]}, Table[If[MemberQ[ddn, n], 1, 0], {n, 0, 100}]] (* Harvey P. Dale, Oct 18 2015 *)
PROG
(PARI)
A006566(n) = (n*(3*n-1)*(3*n-2)/2);
A256433(n) = { my(i=0); while(A006566(i) < n, i++); return(A006566(i) == n); }; \\ Antti Karttunen, Aug 05 2018
(Python)
from sympy import integer_nthroot
def A256433(n): return int((m:=integer_nthroot((k:=n<<1)//9, 3)[0]+1)*(3*m-1)*(3*m-2)==k) if n else 1 # Chai Wah Wu, Oct 02 2025
CROSSREFS
Cf. A006566 (dodecahedral numbers).
Sequence in context: A292547 A014032 A014055 * A014028 A014047 A016411
KEYWORD
nonn
AUTHOR
Mikael Aaltonen, Mar 28 2015
STATUS
approved