A359497 Greatest positive integer whose weakly increasing prime indices have weighted sum (A304818) equal to n.
1, 2, 3, 5, 7, 11, 13, 17, 19, 25, 29, 35, 49, 55, 77, 121, 91, 143, 169, 187, 221, 289, 247, 323, 361, 391, 437, 539, 605, 847, 1331, 715, 1001, 1573, 1183, 1859, 2197, 1547, 2431, 2873, 3179, 3757, 4913, 3553, 4199, 5491, 4693, 6137, 6859, 9317, 14641
Offset: 0
Keywords
Examples
The terms together with their prime indices begin: 1: {} 2: {1} 3: {2} 5: {3} 7: {4} 11: {5} 13: {6} 17: {7} 19: {8} 25: {3,3} 29: {10} 35: {3,4} 49: {4,4} 55: {3,5} 77: {4,5} The 5 numbers with weighted sum of prime indices 12, together with their prime indices: 20: {1,1,3} 27: {2,2,2} 33: {2,5} 37: {12} 49: {4,4} Hence a(12) = 49.
Links
- Andrew Howroyd, Table of n, a(n) for n = 0..500
Crossrefs
The reverse version is A359683.
Programs
-
Mathematica
nn=10; primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; ots[y_]:=Sum[i*y[[i]],{i,Length[y]}]; seq=Table[ots[primeMS[n]],{n,1,2^nn}]; Table[Position[seq,k][[-1,1]],{k,0,nn}]
-
PARI
a(n)={ my(recurse(r, k, m) = if(k==1, if(m>=r, prime(r)), my(z=0); for(j=1, min(m, (r-k*(k-1)/2)\k), z=max(z, self()(r-k*j, k-1, j)*prime(j))); z)); if(n==0, 1, vecmax(vector((sqrtint(8*n+1)-1)\2, k, recurse(n, k, n)))); } \\ Andrew Howroyd, Jan 21 2023
Extensions
Terms a(21) and beyond from Andrew Howroyd, Jan 21 2023
Comments