A273729 Number of n-ary heaps on n levels (i.e., of A023037(n) elements).
1, 1, 2, 7484400
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..4
- Wikipedia, D-ary heap
Formula
a(n) = A273712(n,n).
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.
lst={};Do[s=0;Do[s+=n^a,{a,0,n-1}];If[PrimeQ[s],AppendTo[lst,s]],{n,0,2*5!}];lst
f1[n_]:=Module[{s=0},Do[s+=n^a,{a,0,n-1}];s]; f2[n_]:=Last/@FactorInteger[n]=={1,1}||Last/@FactorInteger[n]=={2}; Select[Table[f1[n],{n,50}],f2[ # ]&]
(* Warning: this program is just a verification of the existing data and should not be used to extend the sequence beyond a(28) *) BellMod[k_, m_] := Mod[Sum[Mod[StirlingS2[k, j], m], {j, 1, k}], m]; BellMod[k_, 1] := BellB[k]; period[nn_List] := Module[{lgmin=2, lgmax=5, nn1}, lg=If[Length[nn]<=lgmax, lgmin, lgmax]; nn1 = nn[[1;;lg]]; km=Length[nn]-lg; Catch[Do[If[nn1==nn[[k;;k+lg-1]], Throw[k-1]]; If[k==km, Throw[0]], {k, 2, km}]]]; dd[n_] := SelectFirst[Table[{d, n/d}, {d, Divisors[n][[2;;-2]]}], GCD@@#==1&]; a[1]=1; a[p_?PrimeQ] := a[p] = (p^p-1)/(p-1); a[n_/;n>4 && dd[n]!={}] := With[{g = dd[n]}, LCM[a[g[[1]]], a[g[[2]]]]]; a[n_/;MemberQ[FactorInteger[n][[All, 2]], 1]] := a[n]= With[{pp = Select[FactorInteger[n], #1[[2]] ==1 &][[All, 1]]}, a[n/Times@@pp]*Times@@a/@pp]; a[n_/;n>4 && GCD @@ FactorInteger[n][[All, 2]]>1] := a[n]= With[{g=GCD @@ FactorInteger[n][[All, 2]]}, n^(1/g)*a[n^(1-1/g)]]; a[n_] := period[Table[BellMod[k, n], {k, 1, 28}]]; Table[a[n], {n, 1, 28}] (* Jean-François Alcover, Jul 31 2012, updated May 06 2024 *)
For n=3, a(n) = 3^3 - 1 = 27 - 1 = 26. - _Michael B. Porter_, Nov 12 2017
[ n^n-1: n in [1..25]]; // Vincenzo Librandi, Dec 29 2010
Table[n^n - 1, {n, 1, 50}] (* G. C. Greubel, Nov 10 2017 *)
a(n)=n^n-1 \\ Charles R Greathouse IV, Feb 24 2012
T(3,5)=31 because 111 base 5 represents 25+5+1=31. 1 1 1 1 1 1 1 2 3 4 5 6 7 8 3 7 13 21 31 43 57 4 15 40 85 156 259 400 5 31 121 341 781 1555 2801 6 63 364 1365 3906 9331 19608 7 127 1093 5461 19531 55987 137257 Starting with the second column, the q-th column list the numbers that are written as 11...1 in base q. - _John Keith_, Apr 12 2021
A055129 := proc(n,k) add(k^j,j=0..n-1) ; end proc: # R. J. Mathar, Dec 09 2015
Table[FromDigits[ConstantArray[1, #], k] &[n - k + 1], {n, 11}, {k, n, 1, -1}] // Flatten (* or *) Table[If[k == 1, n, (k^# - 1)/(k - 1) &[n - k + 1]], {n, 11}, {k, n, 1, -1}] // Flatten (* Michael De Vlieger, Dec 11 2016 *)
a(3) = 3^0 + 3^1 + 3^2 + 3^3 = 40.
[&+[n^k: k in [0..n]]: n in [0..30]]; // Vincenzo Librandi, Apr 18 2011
a:= proc(n) local c, i; c:=1; for i to n do c:= c*n+1 od; c end: seq(a(n), n=0..20); # Alois P. Heinz, Aug 15 2013
Join[{1},Table[Total[n^Range[0,n]],{n,20}]] (* Harvey P. Dale, Nov 13 2011 *)
a(n)=(n^(n+1)-1)/(n-1) \\ Charles R Greathouse IV, Mar 26 2014
[lucas_number1(n,n,n-1) for n in range(1, 19)] # Zerinvary Lajos, May 16 2009
a(10)=111111111; i.e., just nine 1's (converted from base 10 to decimal).
[0] cat [ (n^(n-1) -1)/(n-1) : n in [2..25]]; // G. C. Greubel, Aug 15 2022
Join[{0},Array[(#^(#-1)-1)/(#-1)&,20,2]] (* Harvey P. Dale, Jun 04 2013 *)
a(n) = if (n==1, 0, (n^(n - 1) - 1)/(n - 1)); \\ Harry J. Smith, Jul 01 2009
[0]+[(n^(n-1) -1)/(n-1) for n in (2..25)] # G. C. Greubel, Aug 15 2022
First 4 rows: 1: [1]_2 2: [11]_2 ........ [11]_3 3: [111]_2 ....... [111]_3 ....... [111]_4 4: [1111]_2 ...... [1111]_3 ...... [1111]_4 ...... [1111]_5 _ 1: 1 2: 2+1 ........... 3+1 3: (2+1)*2+1 ..... (3+1)*3+1 ..... (4+1)*4+1 4: ((2+1)*2+1)*2+1 ((3+1)*3+1)*3+1 ((4+1)*4+1)*4+1 ((5+1)*5+1)*5+1.
[((k+1)^n -1)/k : k in [1..n], n in [1..12]]; // G. C. Greubel, Aug 15 2022
Table[((k+1)^n -1)/k, {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Aug 15 2022 *)
def A125118(n,k): return ((k+1)^n -1)/k flatten([[A125118(n,k) for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Aug 15 2022
a(n) = n^(n*(n-1)/2); \\ Joerg Arndt, Nov 04 2013
Comments